/* ════════════════════════════════════════════════════════════════════════
   Marketing › Sales — the sale page (_sale_landing_top.php + the store's
   listing of every sale product), a sale category's page (_sale_header.php
   + its listing) and the "starts on / has ended" notice (sale-landing.php).

   Every colour is the sale's Look setting, set inline on .sale-scope and on
   the listing section as custom properties (SaleStorefrontService::cssVars()):
     --sale-primary  headings on the page, prices
     --sale-accent   ornaments, hairlines, the eyebrow
     --sale-background / --sale-text         the listing part of the page
     --sale-surface  / --sale-surface-text   the hero and the category band
     --sale-tag-bg   / --sale-tag-fg         the SALE tag and the buttons
     --sale-tag-text the SALE tag's words in this language
   Headings use the store's font, or a display serif with .sale-font-elegant.
   Loaded only on sale pages.
   ════════════════════════════════════════════════════════════════════════ */

.sale-scope,
.sale-listing {
    --sale-display: var(--sec-font, inherit);
    --sale-muted: color-mix(in srgb, var(--sale-text, #1F2933) 62%, transparent);
    --sale-hair: color-mix(in srgb, var(--sale-text, #1F2933) 12%, transparent);
    --sale-line: color-mix(in srgb, var(--sale-accent-on-surface, #B08D57) 50%, transparent);
    --sale-gilt: var(--sale-accent-on-surface, var(--sale-accent, #B08D57)); /* the accent, readable on the surface */
    --sale-on-surface: color-mix(in srgb, var(--sale-surface-text, #FFFFFF) 74%, transparent);
    --sale-on-surface-hair: color-mix(in srgb, var(--sale-surface-text, #FFFFFF) 16%, transparent);
    --sale-radius: 4px;
}
.sale-scope.sale-font-elegant { --sale-display: "Cormorant Garamond", Garamond, "Times New Roman", serif; }

/* Preview ribbon (admin's signed link only) */
.sale-preview-bar {
    position: relative;
    z-index: 2;
    padding: 9px 16px;
    background: repeating-linear-gradient(-45deg, #FFE066 0 14px, #FFD43B 14px 28px);
    color: #111111;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* ── Shared bits ──────────────────────────────────────────────────────── */
.sale-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0 0 28px;
    font-size: 12px;
    letter-spacing: .16em;
    line-height: 1.6;
    text-transform: uppercase;
}
.sale-scope .sale-crumbs a,
.sale-scope .sale-crumbs span { color: var(--sale-on-surface); font-size: inherit; font-weight: 400; letter-spacing: inherit; text-decoration: none; }
.sale-scope .sale-crumbs a:hover { color: var(--sale-surface-text); }
.sale-scope .sale-crumbs [aria-current] { color: var(--sale-surface-text); }
.sale-crumbs-sep { opacity: .5; }

.sale-scope .sale-eyebrow {
    margin: 0 0 14px;
    color: var(--sale-gilt);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .3em;
    line-height: 1.6;
    text-transform: uppercase;
}
.sale-scope .sale-eyebrow span { margin: 0 .5em; opacity: .7; }

/* line ◇ line */
.sale-ornament { position: relative; display: block; width: 180px; height: 12px; margin: 22px 0; }
.sale-ornament::before,
.sale-ornament::after { content: ''; position: absolute; top: 50%; width: 76px; height: 1px; background: var(--sale-line); }
.sale-ornament::before { left: 0; }
.sale-ornament::after { right: 0; }
.sale-ornament i { position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; border: 1px solid var(--sale-gilt); transform: translate(-50%, -50%) rotate(45deg); }

.sale-scope .sale-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 28px;
    border: 0;
    border-radius: 2px;
    background: var(--sale-tag-bg, #B08D57);
    color: var(--sale-tag-fg, #111111);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .16em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--sale-tag-bg, #B08D57) 80%, transparent);
    transition: transform .2s, filter .2s, box-shadow .2s;
}
.sale-scope .sale-cta:hover { color: var(--sale-tag-fg, #111111); filter: brightness(1.07); transform: translateY(-2px); }
.sale-scope .sale-cta:focus-visible { outline: 2px solid var(--sale-surface-text, #FFFFFF); outline-offset: 3px; }

/* A soft glow and an inset hairline frame behind the hero and the header. */
.sale-hero-glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 80% at 12% 20%, color-mix(in srgb, var(--sale-accent, #B08D57) 18%, transparent), transparent 70%),
        radial-gradient(50% 60% at 95% 100%, color-mix(in srgb, var(--sale-tag-bg, #B08D57) 14%, transparent), transparent 70%);
    pointer-events: none;
}
.sale-hero-glow::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid var(--sale-on-surface-hair);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.sale-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 52px 0 64px;
    background: var(--sale-surface, #22222A);
    color: var(--sale-surface-text, #FFFFFF);
}
.sale-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.sale-hero-copy { display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.sale-hero.has-image .sale-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 56px; }
.sale-hero.has-image .sale-crumbs { justify-content: center; }

.sale-scope .sale-hero-title,
.sale-scope .sale-head-title {
    margin: 0;
    color: var(--sale-surface-text, #FFFFFF);
    font-family: var(--sale-display);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.05;
    text-transform: none;
    text-wrap: balance;
}
.sale-scope.sale-font-elegant .sale-hero-title,
.sale-scope.sale-font-elegant .sale-head-title {
    font-size: clamp(46px, 6.6vw, 92px);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    line-height: .98;
}
.sale-scope .sale-hero-intro {
    max-width: 560px;
    margin: 0;
    color: var(--sale-on-surface);
    font-size: 17px;
    line-height: 1.7;
}
.sale-scope.sale-font-elegant .sale-hero-intro { font-family: var(--sale-display); font-size: 21px; font-style: italic; line-height: 1.5; }

.sale-hero-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 30px; }
.sale-scope .sale-ends {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 8px;
    margin: 0;
    color: var(--sale-on-surface);
    font-size: 14px;
}
.sale-scope .sale-ends strong { color: var(--sale-surface-text, #FFFFFF); font-weight: 600; }
.sale-ends svg { color: var(--sale-gilt); }

.sale-hero-media { position: relative; margin: 0; }
.sale-hero-media::before { /* offset frame, like a gilded mount */
    content: '';
    position: absolute;
    inset: -12px 12px 12px -12px;
    border: 1px solid var(--sale-line);
    pointer-events: none;
}
.sale-hero-media img {
    position: relative;
    display: block;
    width: 100%;
    height: auto; /* the width/height attributes only reserve space; the ratio sets the box */
    aspect-ratio: 4 / 3;
    max-height: 460px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}

/* ── Sale categories band ─────────────────────────────────────────────── */
.sale-band {
    padding: 8px 0 72px;
    background: var(--sale-surface, #22222A);
    color: var(--sale-surface-text, #FFFFFF);
}
.sale-band > .container { padding-top: 56px; border-top: 1px solid var(--sale-on-surface-hair); }
.sale-section-head { max-width: 640px; margin: 0 auto 36px; text-align: center; }
.sale-scope .sale-section-title {
    margin: 0;
    color: var(--sale-surface-text, #FFFFFF);
    font-family: var(--sale-display);
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.15;
    text-transform: none;
}
.sale-scope.sale-font-elegant .sale-section-title { font-size: clamp(32px, 3.6vw, 46px); font-weight: 500; letter-spacing: 0; }
.sale-scope .sale-section-sub { margin: 10px 0 0; color: var(--sale-on-surface); font-size: 15px; line-height: 1.6; }

.sale-cards {
    --sale-cols: 6;
    --sale-gap: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* a sale with only a few categories stays centred */
    gap: var(--sale-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}
.sale-cards > li { flex: 0 0 calc((100% - (var(--sale-cols) - 1) * var(--sale-gap)) / var(--sale-cols)); min-width: 0; }
.sale-scope .sale-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--sale-line);
    border-radius: 2px;
    background: color-mix(in srgb, var(--sale-surface-text, #FFFFFF) 4%, var(--sale-surface, #22222A));
    color: inherit;
    text-decoration: none;
    transition: border-color .25s, transform .25s, box-shadow .25s;
}
.sale-scope .sale-card:hover,
.sale-scope .sale-card:focus-visible {
    border-color: var(--sale-gilt);
    transform: translateY(-3px);
    box-shadow: 0 18px 36px -22px rgba(0, 0, 0, .7);
}
.sale-scope .sale-card:focus-visible { outline: 2px solid var(--sale-gilt); outline-offset: 3px; }
.sale-card-img { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: color-mix(in srgb, var(--sale-surface-text, #FFFFFF) 8%, var(--sale-surface, #22222A)); }
.sale-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.sale-scope .sale-card:hover .sale-card-img img { transform: scale(1.05); }
.sale-card-body { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px 18px; text-align: center; }
.sale-card-name { color: var(--sale-surface-text, #FFFFFF); font-family: var(--sale-display); font-size: 17px; font-weight: 500; line-height: 1.3; }
.sale-scope.sale-font-elegant .sale-card-name { font-size: 21px; }
.sale-card-count { color: var(--sale-gilt); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }

/* ── A sale category's header ─────────────────────────────────────────── */
.sale-head {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 44px 0 40px;
    background: var(--sale-surface, #22222A);
    color: var(--sale-surface-text, #FFFFFF);
    text-align: center;
}
.sale-head .sale-crumbs { justify-content: center; margin-bottom: 22px; }
.sale-head .sale-ornament { margin: 18px auto; }
.sale-scope .sale-head-title { font-size: clamp(32px, 4.4vw, 56px); }
.sale-scope.sale-font-elegant .sale-head-title { font-size: clamp(42px, 5.6vw, 76px); }
.sale-scope .sale-head-intro { max-width: 640px; margin: 0 auto 14px; color: var(--sale-on-surface); font-size: 16px; line-height: 1.7; }
.sale-scope .sale-head-count { margin: 0; color: var(--sale-gilt); font-size: 12px; letter-spacing: .26em; text-transform: uppercase; }


/* ── The notice (not running / nothing on sale) ───────────────────────── */
.sale-notice-wrap { padding: 56px 0 80px; background: var(--sale-background, #FFFFFF); }
.sale-notice {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 32px;
    border: 1px solid var(--sale-hair);
    border-radius: var(--sale-radius);
    background: var(--sale-background, #FFFFFF);
    color: var(--sale-text, #1F2933);
    text-align: center;
    box-shadow: 0 24px 48px -36px rgba(0, 0, 0, .35);
}
.sale-notice-icon {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--sale-accent, #B08D57) 14%, transparent);
    color: var(--sale-primary, #2A2A2E);
}
.sale-scope .sale-notice h2 { margin: 0 0 8px; color: var(--sale-text, #1F2933); font-family: var(--sale-display); font-size: 26px; font-weight: 600; text-transform: none; }
.sale-scope .sale-notice p { margin: 0 0 24px; color: var(--sale-muted); font-size: 16px; line-height: 1.6; }

/* ── The store's listing on a sale page ───────────────────────────────── */
.sale-anchor { display: block; scroll-margin-top: 110px; }
/* The listing underneath (filters, sort box, wishlist and cart buttons, prices) keeps the
   store's own theme colours: only the hero, the band and the SALE tag carry the sale's. */
.sale-listing.product_list_wrapper { padding-top: 40px; }
.sale-listing .filterMenu .text.desk { font-weight: 600; }
.sale-listing .sale-list-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0;
    color: var(--sale-text, #1F2933);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.25;
    text-transform: none;
}
.sale-listing .sale-list-title span { color: var(--sale-muted); font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }

/* ── Widths ───────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
    .sale-cards { --sale-cols: 4; }
    .sale-hero.has-image .sale-hero-grid { gap: 40px; }
}
@media (max-width: 991px) {
    .sale-hero.has-image .sale-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .sale-hero-media { order: -1; width: 100%; max-width: 640px; }
    .sale-hero-media img { aspect-ratio: 16 / 10; }
    .sale-cards { --sale-cols: 3; }
}
@media (min-width: 768px) and (max-width: 991px) {
    /* The filter bar's own sort box would sit above the one in the "All sale pieces" heading. */
    .sale-listing .filterMenu .right_box { display: none !important; }
}
@media (max-width: 767px) {
    .sale-hero { padding: 36px 0 44px; }
    .sale-hero-glow::after { inset: 8px; }
    .sale-hero-media::before { inset: -8px 8px 8px -8px; }
    .sale-crumbs { margin-bottom: 18px; font-size: 10.5px; letter-spacing: .12em; }
    .sale-scope .sale-eyebrow { font-size: 10.5px; letter-spacing: .22em; }
    .sale-scope .sale-hero-intro { font-size: 15.5px; }
    .sale-scope.sale-font-elegant .sale-hero-intro { font-size: 18px; }
    .sale-scope .sale-cta { width: 100%; justify-content: center; }
    .sale-band { padding-bottom: 48px; }
    .sale-band > .container { padding-top: 40px; }
    .sale-cards { --sale-cols: 2; --sale-gap: 10px; }
    .sale-card-body { padding: 12px 8px 14px; }
    .sale-card-name { font-size: 15px; }
    .sale-scope.sale-font-elegant .sale-card-name { font-size: 18px; }
    .sale-card-count { font-size: 10px; letter-spacing: .16em; }
    .sale-head { padding: 32px 0 30px; }
    .sale-listing.product_list_wrapper { padding-top: 24px; }
    .sale-notice { padding: 32px 20px; }
    .sale-listing .ProductContentBox { padding-top: 0; }
    .sale-listing .productListing { --bs-gutter-y: 12px; }
    .sale-listing .card .price { justify-content: flex-start; }
    .sale-listing .card .price .price-was { flex: 1 0 100%; text-align: left; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .sale-scope .sale-card, .sale-card-img img, .sale-scope .sale-cta, .sale-listing .main-product { transition: none; }
    .sale-scope .sale-card:hover, .sale-scope .sale-cta:hover { transform: none; }
    .sale-scope .sale-card:hover .sale-card-img img { transform: none; }
}
