/* ==========================================================================
   Seasonal promo banner (Components/Shared/SeasonalPromoBanner.razor)
   - Each theme only sets the --sp-* tokens below; layout is shared.
   - Responsive to the banner's own width via container queries.
   ========================================================================== */

.seasonal-promo {
    --sp-bg: #1a2340;
    --sp-bg-image: none;
    --sp-ink: #ffffff;
    --sp-muted: rgba(255, 255, 255, 0.72);
    --sp-accent: #ffd166;
    --sp-eyebrow: var(--sp-accent);
    --sp-line: rgba(255, 255, 255, 0.28);
    --sp-ticket-bg: #ffd166;
    --sp-ticket-ink: #1a2340;
    --sp-ticket-action-bg: rgba(0, 0, 0, 0.08);
    --sp-copied-bg: #15803d;

    container-type: inline-size;
    position: relative;
    overflow: hidden;
    width: 100%;
    color: var(--sp-ink);
    background-color: var(--sp-bg);
    background-image: var(--sp-bg-image);
    font-family: 'Baloo Chettan 2', 'Merriweather Sans', system-ui, sans-serif;
}

.seasonal-promo__inner {
    position: relative;
    display: flex;
    align-items: center;
    /* Equal space either side of the offer, whatever the title/dates widths */
    justify-content: space-between;
    gap: 40px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 40px;
}

.seasonal-promo__actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- Headline ---------------------------------------------------------- */

.seasonal-promo__headline {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.seasonal-promo__eyebrow {
    margin-bottom: 6px;
    color: var(--sp-eyebrow);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.seasonal-promo__title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* --- Offer ------------------------------------------------------------- */

.seasonal-promo__offer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.seasonal-promo__percent {
    display: flex;
    align-items: flex-start;
    color: var(--sp-accent);
    font-size: 68px;
    font-weight: 800;
    line-height: 0.85;
    font-variant-numeric: tabular-nums;
}

.seasonal-promo__percent-sign {
    margin-left: 2px;
    font-size: 0.5em;
    line-height: 1;
}

.seasonal-promo__offer-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.seasonal-promo__off {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
}

.seasonal-promo__coverage {
    color: var(--sp-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* --- Dates ------------------------------------------------------------- */

.seasonal-promo__dates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px 5px;
    border: 1px solid var(--sp-line);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Code ticket ------------------------------------------------------- */

.seasonal-promo__code {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
        "label  action"
        "value  action";
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--sp-ticket-bg);
    color: var(--sp-ticket-ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.seasonal-promo__code:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.seasonal-promo__code:focus-visible {
    outline: 3px solid var(--sp-ink);
    outline-offset: 3px;
}

.seasonal-promo__code-label {
    grid-area: label;
    padding: 10px 18px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.75;
}

.seasonal-promo__code-value {
    grid-area: value;
    padding: 0 18px 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Perforated tear-off with notches cut in the banner colour */
.seasonal-promo__code-action {
    grid-area: action;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: stretch;
    padding: 0 18px;
    border-left: 2px dashed currentColor;
    border-radius: 0 10px 10px 0;
    background: var(--sp-ticket-action-bg);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.seasonal-promo__code-action::before,
.seasonal-promo__code-action::after {
    content: "";
    position: absolute;
    left: -8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--sp-bg);
}

.seasonal-promo__code-action::before { top: -7px; }
.seasonal-promo__code-action::after { bottom: -7px; }

.seasonal-promo__code.is-copied .seasonal-promo__code-action {
    background: var(--sp-copied-bg);
    color: #ffffff;
}

/* --- Responsive (by banner width) -------------------------------------- */

/* Narrower desktops: tighten before reflowing */
@container (max-width: 1100px) {
    .seasonal-promo__inner { gap: 24px; padding: 18px 28px; }
    .seasonal-promo__title { font-size: 30px; }
    .seasonal-promo__percent { font-size: 58px; }
    .seasonal-promo__off { font-size: 24px; }
    .seasonal-promo__actions { gap: 14px; }
}

@container (max-width: 820px) {
    .seasonal-promo__actions { display: contents; }

    .seasonal-promo__inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "headline offer"
            "dates    code";
        gap: 12px 16px;
        padding: 16px 20px;
    }

    .seasonal-promo__headline { grid-area: headline; }
    .seasonal-promo__offer { grid-area: offer; justify-self: end; }
    .seasonal-promo__dates { grid-area: dates; justify-self: start; }
    .seasonal-promo__code { grid-area: code; justify-self: end; }

    .seasonal-promo__title { font-size: 26px; }
    .seasonal-promo__percent { font-size: 50px; }
    .seasonal-promo__off { font-size: 20px; }
}

@container (max-width: 460px) {
    .seasonal-promo__inner {
        grid-template-areas:
            "headline offer"
            "dates    offer"
            "code     code";
        gap: 6px 12px;
        padding: 14px 16px;
    }

    .seasonal-promo__title { font-size: 21px; white-space: normal; }
    .seasonal-promo__percent { font-size: 40px; }

    /* Dates become a quiet caption under the title */
    .seasonal-promo__dates {
        padding: 0;
        border: 0;
        color: var(--sp-muted);
        font-size: 13px;
    }

    .seasonal-promo__code {
        justify-self: stretch;
        grid-template-columns: 1fr auto;
        grid-template-areas: "value action";
    }

    .seasonal-promo__code-label { display: none; }
    .seasonal-promo__code-value { padding: 8px 14px 6px; font-size: 20px; }
    .seasonal-promo__code-action { justify-content: center; min-width: 96px; }
}

/* Don't crowd the open mobile nav menu (mirrors the old .promo-banner rule) */
body:has(.navbar-collapse.show) .seasonal-promo {
    display: none;
}

@media (prefers-contrast: more) {
    .seasonal-promo {
        --sp-bg: #000000;
        --sp-bg-image: none;
        --sp-muted: #ffffff;
        --sp-accent: #ffffff;
        --sp-eyebrow: #ffffff;
        --sp-line: #ffffff;
        --sp-ticket-bg: #ffffff;
        --sp-ticket-ink: #000000;
    }

    .seasonal-promo__code {
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .seasonal-promo__code,
    .seasonal-promo__code-action {
        transition: none;
    }

    .seasonal-promo__code:hover {
        transform: none;
    }
}

/* ==========================================================================
   Themes
   ========================================================================== */

/* Black Friday: near-black with a gold light sweep */
.seasonal-promo--black-friday {
    --sp-bg: #0d0d10;
    --sp-bg-image:
        linear-gradient(112deg, transparent 0 58%, rgba(245, 197, 66, 0.12) 58% 64%, transparent 64% 67%, rgba(245, 197, 66, 0.07) 67% 69%, transparent 69%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 10px);
    --sp-muted: #b8b8c2;
    --sp-accent: #f5c542;
    --sp-line: rgba(245, 197, 66, 0.45);
    --sp-ticket-bg: #f5c542;
    --sp-ticket-ink: #0d0d10;
}

/* Cyber Monday: deep indigo, neon grid, magenta glow */
.seasonal-promo--cyber-monday {
    --sp-bg: #0f0a33;
    --sp-bg-image:
        radial-gradient(ellipse 40% 140% at 88% 50%, rgba(255, 79, 195, 0.28), transparent 70%),
        radial-gradient(ellipse 35% 120% at 10% 50%, rgba(34, 230, 255, 0.18), transparent 70%),
        linear-gradient(rgba(34, 230, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 230, 255, 0.07) 1px, transparent 1px);
    --sp-muted: #bdb8f0;
    --sp-accent: #22e6ff;
    --sp-eyebrow: #ff6fd0;
    --sp-line: rgba(34, 230, 255, 0.5);
    --sp-ticket-bg: #22e6ff;
    --sp-ticket-ink: #0f0a33;

    background-size: auto, auto, 22px 22px, 22px 22px;
}

/* Christmas: pine green with soft falling snow, red ticket */
.seasonal-promo--christmas {
    --sp-bg: #0f4a33;
    --sp-bg-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.22) 1.5px, transparent 2.5px),
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 2px);
    --sp-muted: #cfe6d9;
    --sp-accent: #ffd166;
    --sp-line: rgba(255, 255, 255, 0.35);
    --sp-ticket-bg: #d62839;
    --sp-ticket-ink: #ffffff;
    --sp-ticket-action-bg: rgba(0, 0, 0, 0.14);

    background-size: 34px 34px, 22px 22px;
    background-position: 0 0, 11px 13px;
}

/* Boxing Day: gift-box red with a gold ribbon and wrapping-paper stripes */
.seasonal-promo--boxing-day {
    --sp-bg: #b3122a;
    --sp-bg-image:
        linear-gradient(90deg, transparent 0 56px, #f2c14e 56px 74px, transparent 74px),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 12px, transparent 12px 24px);
    --sp-muted: #ffdce1;
    --sp-accent: #ffe08a;
    --sp-line: rgba(255, 255, 255, 0.45);
    --sp-ticket-bg: #fff7e6;
    --sp-ticket-ink: #8f0e22;
}
