/* ==========================================================================
   DiscountRoof — store page (store4/index.blade.php)

   Loaded after homepage4.css and built from the same tokens and components.
   Only store-page pieces live here, all prefixed s4- and scoped under .h4.
   ========================================================================== */

/* Anchored sections and offers stop below the sticky header. */
.h4 #all-codes,
.h4 #store-overview,
.h4 #how-it-works,
.h4 #similar,
.h4 #faq,
.h4 #expired-codes,
.h4 .s4-offer { scroll-margin-top: 96px; }

.h4 .s4-crumbs,
.h4 .s4-jump { margin: 0; }

/* ---------- Hero ---------- */
.h4 .s4-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 22px 0 52px;
    background: var(--h4-wash-hero);
}
.h4 .s4-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: var(--h4-dots);
    background-size: 18px 18px;
    opacity: .5;
}
.h4 .s4-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .88));
}

.h4 .s4-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .8125rem; color: var(--h4-mute); }
.h4 .s4-crumbs li + li::before { content: "/"; margin: 0 9px; color: #b9b5ad; }
.h4 .s4-crumbs a:hover { color: var(--h4-ink); text-decoration: underline; text-underline-offset: 3px; }
.h4 .s4-crumbs [aria-current] { color: var(--h4-ink2); }

.h4 .s4-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
    align-items: center;
    gap: 64px;
    margin-top: 30px;
}
.h4 .s4-hero__grid--solo { grid-template-columns: minmax(0, 1fr); }

.h4 .s4-hero__id { display: flex; align-items: center; gap: 22px; }
.h4 .s4-hero__logo { width: 96px; height: 96px; border-radius: 22px; font-size: 1.6rem; }
.h4 .s4-hero__logo img { padding: 10px; }
.h4 .s4-hero .h4-eyebrow { margin-bottom: 8px; }
.h4 .s4-hero h1 {
    max-width: none;
    font-size: clamp(1.9rem, 3.5vw, 2.85rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}
.h4 .s4-hero h1 span {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    font-size: .5em;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--h4-ink2);
}
.h4 .s4-hero .h4-hero__lede { max-width: 58ch; margin-top: 22px; }

.h4 .s4-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.h4 .s4-hero__actions p { font-size: .875rem; color: var(--h4-ink2); }

.h4 .s4-top { padding: 24px 24px 26px; }
.h4 .s4-top .h4-board__head { margin-bottom: 14px; }
.h4 .s4-top .h4-board__head h2 { font-size: 1.05rem; color: var(--h4-ink2); }
.h4 .s4-top__value { font: 800 clamp(2.75rem, 5vw, 3.75rem)/1 var(--h4-display); letter-spacing: -.03em; }
.h4 .s4-top__value span { margin-left: 8px; font-weight: 600; font-size: 1.25rem; letter-spacing: 0; color: var(--h4-ink2); }
.h4 .s4-top__title { margin-top: 12px; font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.h4 .s4-top__meta { margin-top: 6px; font-size: .875rem; color: var(--h4-mute); }
.h4 .s4-top .h4-btn { width: 100%; min-height: 50px; margin-top: 20px; font-size: 1rem; }

/* ---------- On this page ---------- */
.h4 .s4-jump { border-bottom: 1px solid var(--h4-line); background: #fff; }
.h4 .s4-jump ul {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.h4 .s4-jump ul::-webkit-scrollbar { display: none; }
.h4 .s4-jump a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--h4-paper);
    font-weight: 600;
    font-size: .875rem;
    color: var(--h4-ink2);
    transition: background-color .15s ease, color .15s ease;
}
.h4 .s4-jump a:hover { background: var(--h4-sun-t); color: var(--h4-ink); }
.h4 .s4-jump a span {
    min-width: 22px;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--h4-ink);
    font-size: .72rem;
    line-height: 1.2;
    text-align: center;
    color: #fff;
}

/* ---------- Offers + sidebar layout ---------- */
.h4 .s4-main { padding: 48px 0 64px; }
.h4 .s4-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 48px; }
.h4 .s4-head { margin-bottom: 20px; }

.h4 .s4-notes { display: grid; gap: 6px; margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: var(--h4-sun-t); }
.h4 .s4-notes li { display: flex; align-items: flex-start; gap: 8px; font-size: .875rem; line-height: 1.45; color: var(--h4-ink); }
.h4 .s4-notes .h4-icon { margin-top: 2px; }

/* ---------- Offer rows ---------- */
.h4 .s4-offers { display: grid; gap: 12px; }
.h4 .s4-offer {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 14px 20px 14px 14px;
    border: 1px solid var(--h4-line);
    border-radius: 18px;
    background: #fff;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.h4 .s4-offer:hover { box-shadow: var(--h4-shadow); }
.h4 .s4-offer:target { border-color: var(--h4-ink); box-shadow: 0 0 0 3px var(--h4-sun); }
.h4 .s4-offer.is-best { border-color: var(--h4-ink); }

.h4 .s4-offer__value {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    align-self: stretch;
    min-height: 88px;
    padding: 8px 6px;
    border-radius: 12px;
    background: var(--h4-paper);
    text-align: center;
}
.h4 .s4-offer__value strong { font: 800 1.85rem/1 var(--h4-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.h4 .s4-offer__value span {
    font-weight: 700;
    font-size: .72rem;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--h4-ink2);
}
.h4 .s4-offer__value--md strong { font-size: 1.05rem; line-height: 1.15; letter-spacing: 0; }
.h4 .s4-offer__value--icon { color: var(--h4-red); }
.h4 .s4-offer.is-best .s4-offer__value { background: var(--h4-sun); }

.h4 .s4-offer__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.h4 .s4-tag {
    padding: 4px 8px;
    border-radius: 6px;
    background: #dff1e8;
    font-weight: 700;
    font-size: .68rem;
    line-height: 1.2;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--h4-green);
}
.h4 .s4-tag--best { background: var(--h4-ink); color: #fff; }
.h4 .s4-tag--verified { background: #dff1e8; color: var(--h4-green); }
.h4 .s4-tag--listed { background: #eeebe6; color: var(--h4-ink2); }
.h4 .s4-tag--ended { background: #eeebe6; color: var(--h4-mute); }

.h4 .s4-offer h3 {
    margin-top: 8px;
    font: 600 1.06rem/1.35 var(--h4-body);
    color: var(--h4-ink);
    overflow-wrap: anywhere;
}
.h4 .s4-offer__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: .8125rem; color: var(--h4-mute); }
.h4 .s4-offer__meta:empty { display: none; }
.h4 .s4-offer__meta li { display: inline-flex; align-items: center; gap: 6px; }

.h4 .s4-offer__terms { margin-top: 8px; }
.h4 .s4-offer__terms summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: .8125rem;
    color: var(--h4-ink2);
    list-style: none;
    cursor: pointer;
}
.h4 .s4-offer__terms summary::-webkit-details-marker { display: none; }
.h4 .s4-offer__terms summary:hover { color: var(--h4-ink); }
.h4 .s4-offer__terms summary .h4-icon { transition: transform .2s ease; }
.h4 .s4-offer__terms[open] summary .h4-icon { transform: rotate(180deg); }
.h4 .s4-offer__terms p { max-width: 64ch; margin-top: 6px; font-size: .875rem; color: var(--h4-ink2); }

/* "Get code" shows the end of the code as a teaser; the full code is in the modal. */
.h4 .s4-get { min-width: 148px; min-height: 48px; }
.h4 .s4-get--peek { position: relative; justify-content: flex-start; padding: 0 58px 0 22px; overflow: hidden; }
.h4 .s4-get__peek {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 52px;
    padding-right: 12px;
    border-left: 1.5px dashed rgba(255, 255, 255, .7);
    background: var(--h4-red-d);
    font: 700 .8rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: .04em;
    color: #fff;
}

/* Ended offers */
.h4 .s4-expired { margin-top: 48px; }
.h4 .s4-expired h2 { font-size: 1.4rem; letter-spacing: 0; }
.h4 .s4-expired > p { margin: 6px 0 18px; font-size: .95rem; color: var(--h4-ink2); }
.h4 .s4-offer.is-expired { background: #f6f8fa; }
.h4 .s4-offer.is-expired:hover { box-shadow: none; }
.h4 .s4-offer.is-expired .s4-offer__value strong,
.h4 .s4-offer.is-expired h3 { color: var(--h4-mute); }
.h4 .s4-offer.is-expired h3 { text-decoration: line-through; text-decoration-color: #c9c5bd; }
.h4 .s4-offer.is-expired .h4-badge { background: #eeebe6; color: var(--h4-mute); }

.h4 .s4-offers__empty { padding: 28px 0 4px; text-align: center; color: var(--h4-ink2); }
.h4 .s4-offers__more { display: flex; justify-content: center; margin-top: 22px; }

.h4 .s4-empty { padding: 44px 24px; border: 1.5px dashed #cfd6de; border-radius: 20px; background: var(--h4-paper); text-align: center; }
.h4 .s4-empty__icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    color: var(--h4-red);
}
.h4 .s4-empty h3 { margin-top: 14px; font-weight: 700; font-size: 1.3rem; }
.h4 .s4-empty p { max-width: 48ch; margin: 8px auto 0; color: var(--h4-ink2); }
.h4 .s4-empty .h4-btn { margin-top: 20px; }

/* ---------- Adverts ---------- */
.h4 .s4-ad > p {
    margin-bottom: 6px;
    font-weight: 700;
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--h4-mute);
}
.h4 .s4-ad--wide { margin-top: 40px; }

/* ---------- Sidebar ---------- */
.h4 .s4-side { display: grid; gap: 20px; }
.h4 .s4-card { padding: 22px; border: 1px solid var(--h4-line); border-radius: 20px; background: #fff; }
.h4 .s4-card h2 { font-size: 1.2rem; line-height: 1.2; letter-spacing: 0; overflow-wrap: anywhere; }

.h4 .s4-split { display: flex; gap: 3px; height: 10px; margin-top: 18px; overflow: hidden; border-radius: 999px; }
.h4 .s4-split span { flex: 1 1 0; min-width: 6px; }
.h4 .s4-split__codes { background: var(--h4-red); }
.h4 .s4-split__deals { background: var(--h4-ink); }
.h4 .s4-split__key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-weight: 600; font-size: .8125rem; color: var(--h4-ink2); }
.h4 .s4-split__key li { display: inline-flex; align-items: center; gap: 7px; }
.h4 .s4-split__key li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--h4-ink); }
.h4 .s4-split__key li.is-codes::before { background: var(--h4-red); }

.h4 .s4-facts { margin-top: 14px; }
.h4 .s4-facts > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-top: 1px solid var(--h4-line);
    font-size: .9rem;
}
.h4 .s4-facts dt { color: var(--h4-ink2); }
.h4 .s4-facts dd { font-weight: 700; text-align: right; }
.h4 .s4-facts dd a { text-decoration: underline; text-decoration-color: var(--h4-red); text-underline-offset: 3px; }

.h4 .s4-week { padding: 14px 0 4px; border-top: 1px solid var(--h4-line); }
.h4 .s4-week p { font-size: .875rem; color: var(--h4-ink2); }
.h4 .s4-week p strong { color: var(--h4-ink); }
.h4 .s4-week ol { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 74px; margin-top: 12px; }
.h4 .s4-week li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; min-height: 0; }
.h4 .s4-week li span { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--h4-sun); }
.h4 .s4-week li small { flex: none; font-size: .68rem; line-height: 1; color: var(--h4-mute); }

.h4 .s4-glance .h4-btn { width: 100%; margin-top: 16px; }
.h4 .s4-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 14px; font-weight: 600; font-size: .8125rem; color: var(--h4-ink2); }
.h4 .s4-social a:hover { color: var(--h4-red); text-decoration: underline; text-underline-offset: 3px; }

.h4 .s4-alike ul { margin-top: 8px; }
.h4 .s4-alike li + li { border-top: 1px solid var(--h4-line); }
.h4 .s4-alike a { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; }
.h4 .s4-alike a span { min-width: 0; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.h4 .s4-alike a small { flex: none; font-size: .8125rem; color: var(--h4-mute); }
.h4 .s4-alike a:hover span { color: var(--h4-red); }
.h4 .s4-alike li:last-child a { padding-bottom: 0; }

/* ---------- About + table ---------- */
.h4 .s4-about { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 56px; }
.h4 .s4-about--solo { grid-template-columns: minmax(0, 1fr); }
.h4 .s4-about__copy p { max-width: 68ch; margin-top: 14px; color: var(--h4-ink2); }
.h4 .s4-about__copy p a {
    color: var(--h4-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--h4-red);
    text-underline-offset: 3px;
}

.h4 .s4-table { padding: 22px 22px 8px; border: 1px solid var(--h4-line); border-radius: 20px; background: #fff; }
.h4 .s4-table h3 { font-weight: 700; font-size: 1.2rem; }
.h4 .s4-table__scroll { margin-top: 10px; overflow-x: auto; }
.h4 .s4-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.h4 .s4-table th,
.h4 .s4-table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--h4-line); text-align: left; vertical-align: top; }
.h4 .s4-table th:last-child,
.h4 .s4-table td:last-child { padding-right: 0; white-space: nowrap; }
.h4 .s4-table tbody tr:last-child td { border-bottom: 0; }
.h4 .s4-table th {
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--h4-mute);
}
.h4 .s4-table td:first-child { font-weight: 700; white-space: nowrap; }
.h4 .s4-table td a { color: var(--h4-ink); }
.h4 .s4-table td a:hover { color: var(--h4-red); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- If a code doesn't work ---------- */
.h4 .h4-how .s4-fix ul { display: grid; gap: 10px; margin: 14px 0 16px; }
.h4 .h4-how .s4-fix li { display: flex; align-items: flex-start; gap: 10px; color: var(--h4-ink2); }
.h4 .h4-how .s4-fix li .h4-icon { margin-top: 4px; color: var(--h4-green); }

/* ---------- Similar stores ---------- */
.h4 .s4-cloud { margin-top: 28px; }
.h4 .s4-cloud a { background: #fff; }
.h4 .s4-cloud a:hover { background: #fff; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .h4 .s4-hero__grid { gap: 40px; }
    .h4 .s4-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 32px; }
    .h4 .s4-offer { grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; }
    .h4 .s4-about { gap: 36px; }
}

@media (max-width: 900px) {
    .h4 #all-codes,
    .h4 #store-overview,
    .h4 #how-it-works,
    .h4 #similar,
    .h4 #faq,
    .h4 #expired-codes,
    .h4 .s4-offer { scroll-margin-top: 72px; }

    .h4 .s4-hero { padding: 16px 0 40px; }
    .h4 .s4-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 22px; }
    .h4 .s4-main { padding: 36px 0 48px; }
    .h4 .s4-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .h4 .s4-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .h4 .s4-about { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 600px) {
    .h4 .s4-hero__id { gap: 14px; }
    .h4 .s4-hero__logo { width: 68px; height: 68px; border-radius: 16px; font-size: 1.2rem; }
    .h4 .s4-hero__logo img { padding: 7px; }
    .h4 .s4-hero .h4-eyebrow { margin-bottom: 4px; font-size: .72rem; }
    .h4 .s4-hero h1 { font-size: 1.7rem; }
    .h4 .s4-hero h1 span { margin-top: 5px; font-size: .56em; }
    .h4 .s4-hero .h4-hero__lede { margin-top: 18px; }
    /* The visit button and newest-offer date are repeated in the "at a glance" card. */
    .h4 .s4-hero__actions { display: none; }
    .h4 .s4-hero__grid { gap: 28px; }
    .h4 .s4-top { padding: 20px 18px 22px; }

    .h4 .s4-head .h4-tabs { align-self: stretch; }
    .h4 .s4-head .h4-tabs button { flex: 1; padding: 0 8px; }

    /* Offer rows: value + text on top, a full-width button underneath. */
    .h4 .s4-offer {
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: start;
        gap: 12px 14px;
        padding: 12px;
        border-radius: 16px;
    }
    .h4 .s4-offer__value { align-self: start; min-height: 76px; }
    .h4 .s4-offer__value strong { font-size: 1.45rem; }
    .h4 .s4-offer__value--md strong { font-size: .9rem; }
    .h4 .s4-offer h3 { margin-top: 6px; font-size: 1rem; }
    .h4 .s4-offer__cta { grid-column: 1 / -1; }
    .h4 .s4-get { width: 100%; }
    .h4 .s4-get--peek { justify-content: center; padding: 0 58px; }

    .h4 .s4-side { grid-template-columns: minmax(0, 1fr); }
    .h4 .s4-card { padding: 18px; }
    .h4 .s4-table { padding: 18px 16px 6px; }
    .h4 .s4-table th:nth-child(3),
    .h4 .s4-table td:nth-child(3) { display: none; }
    .h4 .s4-empty { padding: 32px 18px; }
}
