/* Coupon page: the bounties section as one page from a grocery coupon book.
   One paper sheet, a store masthead, then every partner as a row: its label down the left (number, chip, name, where in the store)
   and its bounties as clipped coupons, each ringed by a perforated cut line with scissors.
   Loaded after solana-spaces.css. Everything is scoped under .ss-shelves / .ss-coupon- / .ss-cpn- so the hero panel, which clones
   .ss-chip and .ss-bl out of a partner row, keeps the shared panel styles; the coupon-only bits inside a <li> (logo, expiry, barcode)
   are hidden in the panel at the bottom of this file. */

/* the section sits on the alt surface (life, cream > coupons, alt > asks, cream) */
.ss-shelves { background: var(--ss-alt); --ss-action: #B02E12; /* 5.1:1 on the alt surface */ }

/* ---------- the page ---------- */
.ss-coupon-page {
    --pad: clamp(14px, 2.4vw, 26px);
    position: relative; background: var(--ss-paper); color: var(--ss-ink);
    border: 1.5px solid var(--ss-ink); border-radius: 6px;
    box-shadow: 0 4px 0 var(--ss-ink), 0 22px 40px -26px rgba(10, 10, 10, .55);
    padding: 0 var(--pad) var(--pad);
}
/* masthead: the store's name across the top of the page, the page's facts on the right */
.ss-coupon-mast {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3rem 1rem;
    margin: 0 calc(-1 * var(--pad)); padding: .62rem var(--pad) .58rem;
    background: var(--ss-ink); color: var(--ss-cream); border-radius: 4px 4px 0 0;
}
.ss-coupon-mast-store { font-family: var(--ss-display); font-weight: 800; font-size: .95rem; letter-spacing: .07em; text-transform: uppercase; line-height: 1.2; }
.ss-coupon-mast-right { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; font-family: var(--ss-mono); font-size: .64rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ss-muted-dark); line-height: 1.3; }
.ss-coupon-mast-right span + span::before { content: "\00B7"; margin-right: .55rem; color: var(--ss-honey); }

/* ---------- a partner row: label on the left, coupons on the right ---------- */
.ss-cpn-grp {
    --pc: #0A0A0A; --pt: #E8E4D8; --tc: var(--pd, var(--pc));
    display: grid; grid-template-columns: 228px repeat(2, minmax(0, 1fr)); gap: .9rem; align-items: start;
    padding: 1rem 0 1.1rem; border-top: 1.5px dashed rgba(10, 10, 10, .32);
    scroll-margin-top: 6rem;
}
.ss-coupon-mast + .ss-cpn-grp { border-top: 0; padding-top: 1.1rem; }
.ss-cpn-grp[data-partner="amua-dscvr"], .ss-cpn-grp[data-partner="houdini"], .ss-cpn-grp[data-partner="flipcash"] { --tc: var(--ss-ink); }
.ss-cpn-grp .ss-bl { display: contents; }
/* a partner with one bounty gets a double-width coupon, like the big coupon on a sheet */
.ss-cpn-grp .ss-bl li:only-child { grid-column: 2 / -1; }

/* the label: number and name on one line, the chip under it, then where in the store */
.ss-cpn-head {
    min-width: 0; position: relative; align-self: stretch;
    display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: .55rem; align-content: start; row-gap: .3rem;
    padding: .15rem .85rem .15rem .9rem; border-right: 1.5px dashed rgba(10, 10, 10, .25);
}
.ss-cpn-head::before { content: ""; position: absolute; left: 0; top: .15rem; bottom: .15rem; width: 4px; border-radius: 2px; background: var(--pc); }
.ss-cpn-head .ss-shelf-head { display: contents; }
.ss-cpn-head .ss-shelf-n { grid-column: 1; grid-row: 1; align-self: center; }
.ss-cpn-head .ss-shelf-title { grid-column: 2; grid-row: 1; align-self: center; font-size: 1.15rem; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.ss-cpn-head .ss-chip { grid-column: 2; grid-row: 2; justify-self: start; max-width: 100%; height: 36px; padding: 0 .6rem; margin-top: .25rem; }
.ss-cpn-head .ss-chip img { height: 18px; }
.ss-cpn-head .ss-chip-ss img { height: 22px; }
.ss-cpn-head .ss-chip-pair img { height: 14px; }
.ss-cpn-head .ss-chip-dscvr { padding: .2rem .35rem; }
.ss-cpn-head .ss-chip-dscvr img { height: 12px; }
.ss-cpn-head .ss-shelf-where { grid-column: 2; grid-row: 3; margin: .2rem 0 0; font-size: .84rem; line-height: 1.4; overflow-wrap: anywhere; }
.ss-cpn-head .ss-shelf-note { grid-column: 2; grid-row: 4; margin: .35rem 0 0; padding-top: .4rem; border-top: 1px dashed var(--ss-line); font-size: .78rem; line-height: 1.4; }

/* ---------- a coupon ----------
   li grid: col 1 the value, col 2 the icon, col 3 the wording.
   row 1 the tinted strip (logo left, spots right), 2 value + icon + wording, 3 unit, 4 claim, 5 barcode + expiry, 6 coupon number */
.ss-cpn-grp .ss-bl li {
    position: relative; min-width: 0; align-self: stretch;
    display: grid; grid-template-columns: 86px 24px minmax(0, 1fr); grid-template-rows: 38px auto auto auto auto auto;
    column-gap: .6rem; row-gap: 0; align-content: start;
    padding: 0 .85rem .7rem; border: 1.5px dashed var(--ss-ink); border-radius: 4px;
    background: #fff; font-size: .92rem; line-height: 1.4;
    transition: translate .18s ease, box-shadow .18s ease;
}
.ss-cpn-grp .ss-bl li:hover, .ss-cpn-grp .ss-bl li:focus-within { translate: 0 -2px; box-shadow: 0 12px 20px -14px rgba(10, 10, 10, .55); }
/* scissors riding the top cut line; the halo knocks the dashes out behind them */
.ss-cpn-grp .ss-bl li::before {
    content: ""; position: absolute; top: -10px; left: 12px; width: 28px; height: 19px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 28 20'%3E%3Cpath fill='%230A0A0A' stroke='%23FFFDF8' stroke-width='2.4' stroke-linejoin='round' paint-order='stroke' d='M25.2 3.2 11.6 9.6l-2.7-1.3a3.6 3.6 0 1 0 0 1.4L11.6 8.4l13.6 6.4-2.1.6-11-4.5 11 4.5-2.1.6L10 11.6l-1.1.6a3.6 3.6 0 1 1-.9-2.3l1.2-.6L25.2 3.2zM5.4 4.6a1.9 1.9 0 1 0 0 3.8 1.9 1.9 0 0 0 0-3.8zm0 5a1.9 1.9 0 1 0 0 3.8 1.9 1.9 0 0 0 0-3.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* the strip: partner logo on the tint, "5 spots" pinned on the right */
.ss-cpn-logo {
    grid-column: 1 / -1; grid-row: 1; min-width: 0;
    display: flex; align-items: center; gap: .5rem;
    margin: 0 -.85rem; padding: 0 .85rem; height: 38px;
    background: var(--pt); border-bottom: 1px dashed rgba(10, 10, 10, .3); border-radius: 3px 3px 0 0;
}
.ss-cpn-logo img, .ss-cpn-logo picture { display: block; }
.ss-cpn-logo img { height: 16px; width: auto; max-width: 100%; }
.ss-cpn-logo.is-ss img { height: 21px; }
.ss-cpn-logo.is-dark img { box-sizing: border-box; height: 26px; padding: 5px 7px; background: var(--ss-ink); border-radius: 6px; }
.ss-cpn-logo.is-pair img { height: 13px; }
.ss-cpn-logo.is-pair .ss-cpn-logo-dscvr img { box-sizing: border-box; height: 22px; padding: 5px 6px; background: var(--ss-ink); border-radius: 5px; }
.ss-cpn-grp .ss-buy, .ss-cpn-grp .ss-price { display: contents; }
.ss-cpn-grp .ss-price::before { display: none; }
.ss-cpn-grp .ss-price em {
    grid-column: 3; grid-row: 1; justify-self: end; align-self: center; z-index: 1;
    font-style: normal; font-family: var(--ss-mono); font-size: .58rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; line-height: 1;
    color: var(--tc); border: 1px solid currentColor; border-radius: 999px; padding: .3em .6em .28em; background: rgba(255, 255, 255, .55); white-space: nowrap;
}
/* the value */
.ss-cpn-grp .ss-price b { grid-column: 1; grid-row: 2; margin-top: .72rem; font-family: var(--ss-display); font-weight: 800; font-size: 1.78rem; letter-spacing: -.035em; line-height: 1; color: var(--tc); font-variant-numeric: tabular-nums; }
.ss-cpn-grp .ss-price small { grid-column: 1; grid-row: 3; margin-top: .3rem; font-family: var(--ss-mono); font-size: .6rem; font-weight: 600; letter-spacing: .02em; line-height: 1.3; color: var(--tc); }
/* the wording */
.ss-cpn-grp .ss-bl li .ss-bi { grid-column: 2; grid-row: 2 / span 2; margin-top: .8rem; }
.ss-cpn-grp .ss-bl li > .ss-bi + span { grid-column: 3; grid-row: 2 / span 2; margin-top: .72rem; min-width: 0; overflow-wrap: anywhere; }
.ss-cpn-grp .ss-tag { white-space: normal; }
/* the claim */
.ss-cpn-grp .ss-claim { grid-column: 1 / -1; grid-row: 4; justify-self: start; margin-top: .75rem; min-height: 44px; padding: .45em 1.15em; font-size: .9rem; white-space: nowrap; }
/* barcode, number under it, expiry on the right */
.ss-cpn-bar {
    grid-column: 1 / 3; grid-row: 5; margin-top: .85rem; height: 22px; align-self: end;
    /* bars as an SVG tile (not a gradient) so every PDF viewer prints them */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='22' viewBox='0 0 54 22' fill='%230A0A0A'%3E%3Crect width='1' height='22'/%3E%3Crect x='3' width='1' height='22'/%3E%3Crect x='7' width='2' height='22'/%3E%3Crect x='10' width='1' height='22'/%3E%3Crect x='14' width='1' height='22'/%3E%3Crect x='16' width='2' height='22'/%3E%3Crect x='21' width='1' height='22'/%3E%3Crect x='24' width='1' height='22'/%3E%3Crect x='27' width='2' height='22'/%3E%3Crect x='31' width='1' height='22'/%3E%3Crect x='33' width='1' height='22'/%3E%3Crect x='36' width='3' height='22'/%3E%3Crect x='41' width='1' height='22'/%3E%3Crect x='44' width='1' height='22'/%3E%3Crect x='46' width='2' height='22'/%3E%3Crect x='50' width='1' height='22'/%3E%3Crect x='52' width='1' height='22'/%3E%3C/svg%3E") 0 0 / 54px 22px repeat-x;
}
.ss-cpn-grp .ss-price i { grid-column: 1 / 3; grid-row: 6; margin-top: .25rem; font-style: normal; font-family: var(--ss-mono); font-size: .6rem; letter-spacing: .14em; text-align: center; color: var(--ss-muted); }
.ss-cpn-grp .ss-price i::before { content: "No. "; }
.ss-cpn-exp { grid-column: 3; grid-row: 5 / span 2; justify-self: end; align-self: end; font-family: var(--ss-mono); font-size: .6rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ss-muted); text-align: right; line-height: 1.3; }

/* ---------- the store render after the page ---------- */

/* ---------- motion: coupons settle onto the page as their row reveals (transform, so the hover lift still composes) ---------- */
@keyframes ss-cpn-settle {
    from { opacity: 0; transform: translateY(10px) rotate(-.5deg); }
    to { opacity: 1; transform: none; }
}
.js .ss-cpn-grp.ss-reveal.is-in .ss-bl li { animation: ss-cpn-settle .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.12s + var(--k, 0) * 90ms); }
.ss-cpn-grp .ss-bl li:nth-child(2) { --k: 1; }
.ss-cpn-grp .ss-bl li:nth-child(3) { --k: 2; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .ss-cpn-grp { grid-template-columns: 204px repeat(2, minmax(0, 1fr)); gap: .8rem; }
    .ss-cpn-head { padding-right: .6rem; }
}
@media (max-width: 999px) {
    /* the label becomes a strip across its row, coupons two across */
    .ss-cpn-grp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ss-cpn-grp .ss-bl li:only-child { grid-column: 1 / -1; }
    .ss-cpn-head {
        grid-column: 1 / -1; align-self: auto; border-right: 0; padding: .1rem 0 .1rem .9rem;
        grid-template-columns: 28px auto minmax(0, 1fr); column-gap: .6rem; row-gap: .1rem; align-items: center;
    }
    .ss-cpn-head::before { top: 0; bottom: 0; }
    .ss-cpn-head .ss-shelf-n { grid-row: 1 / span 2; }
    .ss-cpn-head .ss-chip { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
    .ss-cpn-head .ss-shelf-title { grid-column: 3; grid-row: 1; align-self: end; }
    .ss-cpn-head .ss-shelf-where { grid-column: 3; grid-row: 2; margin: 0; align-self: start; }
    .ss-cpn-head .ss-shelf-note { grid-column: 3; grid-row: 3; margin-top: .3rem; }
}
@media (max-width: 699px) {
    /* one coupon per row on phones; the chip leaves the label (every coupon carries the logo) */
    .ss-cpn-grp { grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: .85rem 0 .95rem; }
    .ss-cpn-grp .ss-bl li:only-child { grid-column: 1; }
    .ss-cpn-head { grid-template-columns: 28px minmax(0, 1fr); }
    .ss-cpn-head .ss-chip { display: none; }
    .ss-cpn-head .ss-shelf-n { grid-row: 1; }
    .ss-cpn-head .ss-shelf-title { grid-column: 2; grid-row: 1; align-self: center; }
    .ss-cpn-head .ss-shelf-where { grid-column: 2; grid-row: 2; margin-top: .1rem; }
    .ss-cpn-head .ss-shelf-note { grid-column: 2; grid-row: 3; }
    .ss-cpn-grp .ss-claim { justify-self: stretch; justify-content: center; }
    .ss-coupon-mast-store { font-size: .85rem; }
}
@media (max-width: 380px) {
    .ss-cpn-grp .ss-bl li { grid-template-columns: 78px 24px minmax(0, 1fr); column-gap: .5rem; padding: 0 .7rem .65rem; }
    .ss-cpn-logo { margin: 0 -.7rem; padding: 0 .7rem; }
    .ss-cpn-grp .ss-price b { font-size: 1.55rem; }
}

/* ---------- reduced motion: the shared sheet already stops every animation and transition under .ss ---------- */
@media (prefers-reduced-motion: reduce) {
    .ss-cpn-grp .ss-bl li, .js .ss-cpn-grp.ss-reveal.is-in .ss-bl li { animation: none; opacity: 1; transform: none; }
    .ss-cpn-grp .ss-bl li:hover, .ss-cpn-grp .ss-bl li:focus-within { translate: none; }
}

/* ---------- print: every coupon, none split across pages, colours kept ---------- */
@media print {
    .ss-shelves { background: #fff; }
    .ss-shelves .ss-reveal { opacity: 1 !important; translate: none !important; transition: none !important; }
    .ss-coupon-page { box-shadow: none; }
    .ss-cpn-grp { grid-template-columns: repeat(2, minmax(0, 1fr)); break-inside: auto; }
    .ss-cpn-grp .ss-bl li:only-child { grid-column: 1 / -1; }
    .ss-cpn-head { grid-column: 1 / -1; border-right: 0; padding: .1rem 0 .1rem .9rem; grid-template-columns: 28px auto minmax(0, 1fr); align-items: center; break-after: avoid; }
    .ss-cpn-head .ss-shelf-n { grid-row: 1 / span 2; }
    .ss-cpn-head .ss-chip { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
    .ss-cpn-head .ss-shelf-title { grid-column: 3; grid-row: 1; }
    .ss-cpn-head .ss-shelf-where { grid-column: 3; grid-row: 2; margin: 0; }
    .ss-cpn-head .ss-shelf-note { grid-column: 3; grid-row: 3; }
    .ss-cpn-grp .ss-bl li { break-inside: avoid; page-break-inside: avoid; animation: none !important; opacity: 1 !important; transform: none !important; translate: none !important; box-shadow: none; }
    .ss-coupon-mast, .ss-cpn-head::before, .ss-cpn-logo, .ss-cpn-logo img, .ss-cpn-bar, .ss-cpn-grp .ss-bi, .ss-cpn-grp .ss-claim, .ss-cpn-grp .ss-shelf-n { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- the hero panel clones a partner's .ss-bl: coupon-only parts stay out of it ---------- */
.ss-panel-list .ss-cpn-logo, .ss-panel-list .ss-cpn-exp, .ss-panel-list .ss-cpn-bar { display: none; }

/* ---------- the shared rules under the section intro, and each coupon's Steps and rules ---------- */
.ss-rules { max-width: 62ch; margin: -1.2rem 0 1.6rem; font-size: .92rem; line-height: 1.5; }
.ss-rules-k { font-weight: 600; white-space: nowrap; }
/* coupon rows: 2 value + wording, 3 unit, 4 steps and rules, 5 claim, 6 barcode + expiry, 7 number */
.ss-cpn-grp .ss-bl li { grid-template-rows: 38px auto auto auto auto auto auto; }
.ss-terms { grid-column: 1 / -1; grid-row: 4; margin-top: .7rem; border-top: 1px dashed rgba(10, 10, 10, .25); padding-top: .55rem; font-size: .86rem; line-height: 1.45; min-width: 0; }
.ss-terms summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; cursor: pointer; list-style: none; font-family: var(--ss-mono); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tc); }
.ss-terms summary::-webkit-details-marker { display: none; }
.ss-terms summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: .8rem; line-height: 1; }
.ss-terms[open] summary::before { content: "\2212"; }
.ss-terms summary:focus-visible { outline: 2px solid var(--ss-ink); outline-offset: 2px; border-radius: 3px; }
.ss-terms-body { padding: .35rem 0 .1rem; overflow-wrap: anywhere; }
.ss-terms-steps { margin: 0 0 .55rem; padding-left: 1.2rem; }
/* the coupon rules target ".ss-bl li", which also matches these nested items: reset them */
.ss-cpn-grp .ss-bl .ss-terms li { display: list-item; position: static; padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; line-height: inherit; box-shadow: none; translate: none; animation: none !important; opacity: 1 !important; transform: none !important; }
.ss-cpn-grp .ss-bl .ss-terms li::before, .ss-cpn-grp .ss-bl .ss-terms li::after { content: none; }
.ss-terms-req { list-style: none; margin: 0; padding: 0; }
.ss-terms-req li + li { margin-top: .2rem; }
.ss-terms-req b { font-weight: 600; }
.ss-terms-links { margin: .5rem 0 0; }
.ss-cpn-grp .ss-claim { grid-row: 5; }
.ss-cpn-bar { grid-row: 6; }
.ss-cpn-grp .ss-price i { grid-row: 7; }
.ss-cpn-exp { grid-row: 6 / span 2; }
@media print { .ss-terms summary { display: none; } .ss-terms:not([open]) { display: none; } }
/* the hero panel stays compact: it links down to the coupons */
.ss-panel-list .ss-terms { display: none; }
