/* Merchant voucher listing — Figma node 7:503. Values use the site's 750px canvas. */

body { background: var(--ds-bg); }

#wrapper.merchant-listing-page {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 190px;
    background: var(--ds-bg);
    color: var(--ds-text);
    font-family: var(--ds-font);
    box-sizing: border-box;
}

.merchant-hero {
    padding: 40px 22px 14px;
    background: var(--ds-primary);
    border-radius: 0 0 67px 67px;
    box-shadow: var(--ds-shadow-100);
}

.listing-search {
    height: 90px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 24px;
    border-radius: 999px;
    background: #fff;
    box-sizing: border-box;
}

.listing-search svg {
    width: 30px;
    height: 30px;
    color: var(--ds-text-tertiary);
    flex: 0 0 auto;
}

.listing-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ds-text);
    font: 400 26px/1.4 var(--ds-font);
}

.listing-search input::placeholder { color: var(--ds-placeholder); }

.merchant-discovery {
    padding: 23px 30px 20px;
    background: #fff;
}

.listing-section-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-text);
    font-size: 41px;
    line-height: 52px;
    font-weight: 600;
    text-decoration: none;
}

.merchant-carousel {
    display: flex;
    gap: 0;
    margin: 20px -30px 0;
    padding: 0 30px 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.merchant-carousel::-webkit-scrollbar,
.merchant-category-carousel::-webkit-scrollbar { display: none; }

.merchant-carousel-item {
    width: 187px;
    flex: 0 0 187px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-text);
    font-family: var(--ds-font);
    scroll-snap-align: start;
}

.merchant-carousel-logo {
    width: 134px;
    height: 134px;
    border: 3px solid #fff;
    border-radius: 45px;
    overflow: hidden;
    /* 商戶 logo 統一用顏色托底（client feedback 2026-08 p.6）：白底 logo
       用 multiply 溶入托底色，唔會浮喺白色上面 */
    background: var(--ds-logo-tint);
    padding: 12px;
    box-sizing: border-box;
    box-shadow: 0 0 0 0 var(--ds-primary);
    transition: box-shadow .18s ease;
}

.merchant-carousel-item.is-active .merchant-carousel-logo {
    box-shadow: 0 0 0 5px var(--ds-primary-bright);
}

.merchant-carousel-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
}

.merchant-carousel-name {
    width: 100%;
    min-height: 60px;
    display: -webkit-box;
    padding: 0 8px;
    box-sizing: border-box;
    overflow: hidden;
    font-size: 22px;
    line-height: 30px;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.merchant-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(12, 12, 13, .08);
}

.merchant-category-carousel {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    gap: 18px;
    padding: 11px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.merchant-category {
    min-width: 149px;
    height: 60px;
    flex: 0 0 auto;
    padding: 0 22px;
    border: 2px solid var(--ds-border);
    border-radius: 999px;
    background: var(--ds-bg);
    color: var(--ds-text-secondary);
    font: 400 30px/1 var(--ds-font);
    white-space: nowrap;
}

/* 按鈕轉實色更明顯（client feedback 2026-08 p.6）：選中 chip 實色 primary + 白字 */
.merchant-category.is-active {
    border-color: var(--ds-primary);
    background: var(--ds-primary);
    color: #fff;
    font-weight: 500;
}

.listing-sort {
    width: 180px;
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-primary);
    font: 400 24px/1.2 var(--ds-font);
    text-align: left;
}

.listing-sort svg {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    transition: transform .18s ease;
}

.listing-sort.is-ascending svg { transform: scaleY(-1); }

.merchant-voucher-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
}

/* PDF p.5 兩件式卡：白色資訊 panel 貼住較高嘅托底 logo tile，冇撕票虛線
   （client feedback 2026-08-12：中間唔要留白罅）*/
.merchant-voucher-card {
    min-height: 224px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    column-gap: 10px;
    align-items: stretch;
    color: var(--ds-text);
    text-decoration: none;
}

.merchant-voucher-copy {
    padding: 26px 18px 22px 22px;
    min-width: 0;
    margin: 10px 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--ds-shadow-100);
}

.merchant-voucher-brand {
    color: var(--ds-text);
    font-size: 28px;
    line-height: 36px;
    font-weight: 600;
}

.merchant-voucher-title {
    margin-top: 2px;
    overflow: hidden;
    color: var(--ds-text-secondary);
    font-size: 24px;
    line-height: 31px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.merchant-voucher-face {
    margin-top: 5px;
    color: var(--ds-primary);
    font: 400 28px/34px var(--ds-font-num);
}

.merchant-voucher-tag {
    width: max-content;
    margin-top: 4px;
    padding: 3px 12px;
    background: #fff6dc;
    color: #d48c00;
    font-size: 22px;
    line-height: 26px;
}

.merchant-voucher-reward {
    display: flex;
    align-items: center;
    max-width: 360px;
    height: 42px;
    margin-top: 6px;
    overflow: hidden;
    border: 2px solid var(--ds-primary-bright);
    border-radius: 7px;
    color: var(--ds-primary-bright);
    font-size: 23px;
    line-height: 1;
}

.merchant-voucher-reward-label {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--ds-primary-bright);
    color: #fff;
}

.merchant-voucher-reward-value {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    white-space: nowrap;
}

.merchant-voucher-reward .rp-coin {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
}

/* 撕票虛線已剷（PDF p.5 冇）*/
.merchant-voucher-perforation { display: none; }

.merchant-voucher-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 22px;
    /* 優惠券 logo 統一用顏色托底（client feedback 2026-08 p.5）*/
    background: var(--ds-logo-tint);
}

.merchant-voucher-image img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    mix-blend-mode: multiply;
}

.merchant-ad {
    display: block;
    height: auto;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: 18px;
    background: var(--ds-bg-secondary);
}

.merchant-ad-rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.merchant-ad-rail::-webkit-scrollbar {
    display: none;
}

.merchant-ad-rail .merchant-ad {
    flex: 0 0 calc(100% - 48px);
    scroll-snap-align: start;
}

.merchant-ad img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.listing-loading,
.listing-empty {
    padding: 70px 20px;
    color: var(--ds-text-tertiary);
    font-size: 26px;
    line-height: 38px;
    text-align: center;
}
