/* ===== Season colors =====
   Fall is the default. holiday-offer.js sets data-season on the dialog to switch themes. */
.holiday-offer {
    --offer-ink: #2f2738;
    --offer-primary: #564666;
    --offer-primary-rgb: 86, 70, 102;
    --offer-accent: #cc1303;
    --offer-accent-rgb: 204, 19, 3;
    --offer-paper: #fff9f1;
    --offer-art-bg: #fff3df;
    --offer-shade-rgb: 52, 19, 13;
    --offer-card-shadow: rgba(28, 17, 35, 0.5);
}

.holiday-offer[data-season="christmas"] {
    --offer-ink: #21302a;
    --offer-primary: #1d5a36;
    --offer-primary-rgb: 29, 90, 54;
    --offer-accent: #c41e2a;
    --offer-accent-rgb: 196, 30, 42;
    --offer-paper: #fffdf9;
    --offer-art-bg: #f3f5f6;
    --offer-shade-rgb: 34, 48, 62;
    --offer-card-shadow: rgba(8, 24, 16, 0.55);
}

/* ::backdrop doesn't reliably inherit the variables above, so each season sets its own */
.holiday-offer::backdrop {
    background: rgba(32, 21, 42, 0.78);
}

.holiday-offer[data-season="christmas"]::backdrop {
    background: rgba(10, 30, 22, 0.8);
}

.holiday-offer {
    /* Height of header + footer + borders, used to size the card from the screen height */
    --offer-chrome: 150px;
    --offer-close-space: 0px;
    --offer-side-space: 120px;
    box-sizing: border-box;
    width: fit-content;
    height: fit-content;
    max-width: none;
    max-height: none;
    margin: auto;
    padding: var(--offer-close-space) 0 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--offer-ink);
}

.holiday-offer[open] {
    display: block;
}

.holiday-offer[open] .holiday-offer-card {
    animation: holiday-offer-enter 750ms cubic-bezier(.16, 1, .3, 1) both;
}

.holiday-offer[open] .holiday-offer-close {
    animation: holiday-offer-fade-in 500ms ease 450ms both;
}

.holiday-offer::backdrop {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: holiday-offer-fade-in 500ms ease-out both;
}

/* Exit: the card drops back and fades while the page behind un-blurs into view */
.holiday-offer.is-closing .holiday-offer-card {
    animation: holiday-offer-exit 480ms cubic-bezier(.4, 0, .2, 1) both;
}

.holiday-offer.is-closing .holiday-offer-close {
    animation: holiday-offer-fade-out 200ms ease both;
}

.holiday-offer.is-closing::backdrop {
    animation: holiday-offer-fade-out 520ms ease-in both;
}

/* The flyer's height follows the screen; the card is wider than the flyer so the sides
   reach further across the screen, filled with a blurred copy of it.
   --offer-ratio (flyer width / height) is set by holiday-offer.js for each season. */
.holiday-offer-card {
    --offer-ratio: 0.777;
    --offer-side-extra: 1.35;
    --offer-max-width: calc(100vw - 32px - var(--offer-side-space));
    --offer-art-height: min(calc(92vh - var(--offer-chrome) - var(--offer-close-space)), calc(var(--offer-max-width) / var(--offer-ratio)));
    --offer-art-height: min(calc(92dvh - var(--offer-chrome) - var(--offer-close-space)), calc(var(--offer-max-width) / var(--offer-ratio)));
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(var(--offer-max-width), calc(var(--offer-art-height) * var(--offer-ratio) * var(--offer-side-extra)));
    max-height: calc(100vh - 32px - var(--offer-close-space));
    max-height: calc(100dvh - 32px - var(--offer-close-space));
    overflow: hidden;
    border: 2px solid var(--offer-primary);
    border-radius: 18px;
    background: var(--offer-paper);
    box-shadow: 0 28px 80px var(--offer-card-shadow);
    outline: none;
}

.holiday-offer-header,
.holiday-offer-footer {
    position: relative;
    z-index: 2;
    flex: none;
    background: var(--offer-paper);
}

.holiday-offer-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(var(--offer-primary-rgb), 0.2);
    text-align: center;
}

.holiday-offer-eyebrow {
    display: block;
    margin-bottom: 4px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--offer-accent);
}

.holiday-offer-header h2 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: clamp(16px, 4vw, 21px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    color: var(--offer-primary);
}

/* Sits outside the card, to the right of it on wide screens */
.holiday-offer-close {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.holiday-offer-close:hover {
    color: white;
    background: var(--offer-accent);
    border-color: var(--offer-accent);
    transform: rotate(90deg);
}

.holiday-offer-close:focus-visible,
.holiday-offer-book:focus-visible {
    outline: 3px solid var(--offer-accent);
    outline-offset: 3px;
}

.holiday-offer-art {
    position: relative;
    z-index: 0;
    flex: 0 1 auto;
    height: var(--offer-art-height);
    min-height: 0;
    overflow: hidden;
    background: var(--offer-art-bg);
}

/* Blurred copy of the flyer filling the space beside it (--flyer is set by holiday-offer.js) */
.holiday-offer-art::before {
    content: "";
    position: absolute;
    inset: -30px;
    background: var(--flyer, none) center / cover no-repeat;
    filter: blur(22px) brightness(1.05) saturate(1.1);
    opacity: 0.85;
}

.holiday-offer-art img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(var(--offer-shade-rgb), 0.25));
}

.holiday-offer-footer {
    padding: 11px 16px 14px;
    border-top: 1px solid rgba(var(--offer-primary-rgb), 0.18);
}

.holiday-offer-book {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 10px 20px;
    border: 1px solid var(--offer-accent);
    border-radius: 9px;
    background: var(--offer-accent);
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(var(--offer-accent-rgb), 0.24);
    transition: background 240ms ease, border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.holiday-offer-book:hover {
    background: var(--offer-primary);
    border-color: var(--offer-primary);
    box-shadow: 0 9px 20px rgba(var(--offer-primary-rgb), 0.32);
    transform: translateY(-2px);
}

.holiday-offer-book-label {
    display: block;
    line-height: 1;
}

.holiday-offer-arrows {
    display: inline-flex;
    align-items: center;
    height: 1em;
}

.holiday-offer-arrows svg {
    display: block;
    width: 9px;
    height: 14px;
    margin-left: -1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.holiday-offer-arrows svg:nth-child(2) { opacity: 0.55; }
.holiday-offer-arrows svg:nth-child(3) { opacity: 0.25; }

/* While hovered, the chevrons light up one after another on a loop */
.holiday-offer-book:hover .holiday-offer-arrows svg,
.holiday-offer-book:focus-visible .holiday-offer-arrows svg {
    animation: holiday-offer-chevron 1.1s ease-in-out infinite both;
}

.holiday-offer-book:hover .holiday-offer-arrows svg:nth-child(2),
.holiday-offer-book:focus-visible .holiday-offer-arrows svg:nth-child(2) {
    animation-delay: .18s;
}

.holiday-offer-book:hover .holiday-offer-arrows svg:nth-child(3),
.holiday-offer-book:focus-visible .holiday-offer-arrows svg:nth-child(3) {
    animation-delay: .36s;
}

/* Narrow screens: no room beside the card, so the X sits above its top-right corner */
@media (max-width: 640px) {
    .holiday-offer {
        --offer-close-space: 54px;
        --offer-side-space: 0px;
    }

    .holiday-offer-close {
        left: auto;
        right: 0;
        margin-left: 0;
    }
}

/* ===== Falling particles (positions and timing come from holiday-offer.js) ===== */
.holiday-offer-particles {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.holiday-offer-particles span {
    position: absolute;
    top: -48px;
    left: var(--p-left);
    font-size: var(--p-size);
    line-height: 1;
    opacity: 0;
}

/* Fall: tumbling leaves */
.holiday-offer[data-season="fall"] .holiday-offer-particles span {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    filter: drop-shadow(0 3px 2px rgba(var(--offer-shade-rgb), 0.22));
    animation: holiday-offer-leaf var(--p-duration) ease-in var(--p-delay) both;
}

/* Christmas: white snow drifting gently side to side, outlined so it shows on the white flyer */
.holiday-offer[data-season="christmas"] .holiday-offer-particles span {
    font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', sans-serif;
    color: #fff;
    text-shadow: 0 0 1px rgba(25, 55, 85, 0.9), 0 0 2px rgba(25, 55, 85, 0.8), 0 1px 5px rgba(25, 55, 85, 0.5);
    animation: holiday-offer-snow var(--p-duration) linear var(--p-delay) both;
}

@keyframes holiday-offer-enter {
    from { opacity: 0; transform: translateY(35px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes holiday-offer-exit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(24px) scale(.94); }
}

@keyframes holiday-offer-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes holiday-offer-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes holiday-offer-chevron {
    0% { opacity: 0.25; transform: translateX(0); }
    35% { opacity: 1; transform: translateX(4px); }
    70%, 100% { opacity: 0.25; transform: translateX(0); }
}

@keyframes holiday-offer-leaf {
    0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-20deg); }
    12% { opacity: .9; }
    80% { opacity: .9; }
    100% { opacity: 0; transform: translate3d(var(--p-drift), 100dvh, 0) rotate(420deg); }
}

@keyframes holiday-offer-snow {
    0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
    10% { opacity: .95; }
    25% { transform: translate3d(calc(var(--p-drift) * -0.5), 25dvh, 0) rotate(45deg); }
    50% { transform: translate3d(calc(var(--p-drift) * 0.6), 50dvh, 0) rotate(90deg); }
    75% { transform: translate3d(calc(var(--p-drift) * -0.3), 75dvh, 0) rotate(135deg); }
    88% { opacity: .95; }
    100% { opacity: 0; transform: translate3d(var(--p-drift), 100dvh, 0) rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
    .holiday-offer[open] .holiday-offer-card,
    .holiday-offer[open] .holiday-offer-close,
    .holiday-offer::backdrop,
    .holiday-offer-book:hover .holiday-offer-arrows svg,
    .holiday-offer-book:focus-visible .holiday-offer-arrows svg {
        animation: none;
    }

    /* No falling particles at all */
    .holiday-offer .holiday-offer-particles {
        display: none;
    }

    .holiday-offer-close,
    .holiday-offer-book {
        transition: none;
    }
}
