/* ──────────── FLASH SALE CARD ────────────
 * Floating promo card pinned to the bottom-right of every page,
 * rendered by _flash_sale.twig (included globally in layout.html).
 *
 *  - dark frosted card matching the basket/navbar glass, with the
 *    red radial glow + diagonal shard pattern from the product cards
 *  - dashed "coupon" code chip that copies NANO35 on click
 *  - live HH:MM:SS countdown driven by data-ends on the card
 *  - dismiss collapses it into a small round pill (same corner);
 *    clicking the pill re-opens the card
 *
 * Visibility is JS-driven: both elements ship with [hidden] and the
 * inline script in _flash_sale.twig reveals one of them (or neither,
 * once data-ends has passed). Dismissal is remembered per-session.
 *
 * z-index: 200 — above all in-page content (root-level z ≤ 10),
 * below the basket overlay (250) and navbar (1000) so the promo
 * never covers the chrome or an open basket.
 *
 * The shard texture comes through --asset-card-pattern (declared in
 * layout.html's :root via asset()) — plain CSS can't call asset().
 * ───────────────────────────────────────── */

/* "Reservation Wide" is only declared in styles.css (homepage).
 * Re-declare it here so the big 35% renders on every page; duplicate
 * identical @font-face rules resolve to one download. */
@font-face {
    font-family: "Reservation Wide";
    src: url("https://s3.nanoscripts.cloud/tebex/fonts/Reservation%20Wide%20Black.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.flash-card {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    width: min(320px, calc(100vw - 32px));
    border-radius: 10px;
    background:
        radial-gradient(130% 95% at 88% 112%, rgba(250, 64, 57, 0.30) 0%, rgba(250, 64, 57, 0) 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%),
        #131722;
    outline: 2px solid rgba(255, 255, 255, 0.06);
    outline-offset: -2px;
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.55),
        0 4px 18px rgba(250, 64, 57, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    /* Entrance: slid down + faded until JS adds .is-in. */
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.flash-card.is-in {
    opacity: 1;
    transform: none;
}

/* Shard texture, clipped to the rounded card (the logo escapes the
 * card bounds, so the card itself can't be overflow:hidden). */
.flash-card__pattern {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    overflow: hidden;
    pointer-events: none;
}
.flash-card__pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--asset-card-pattern), var(--asset-card-pattern);
    background-repeat: no-repeat, no-repeat;
    background-position: right -70px top -30px, left -90px bottom -70px;
    background-size: 240px auto, 210px auto;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

/* Notched art-deco stripes (same shapes as the product cards). */
.flash-card__stripe {
    position: absolute;
    left: 0;
    right: 0;
    height: 5px;
    pointer-events: none;
    z-index: 2;
}
.flash-card__stripe--top { top: 0; }
.flash-card__stripe--bot {
    bottom: 0;
    /* Flip vertically so the notches point up; children are centred
     * so the mirrored copy stays centred too. */
    transform: scale(-1, -1);
}

.flash-card__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.flash-card__close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.flash-card__body {
    position: relative;
    z-index: 2;
    padding: 18px 18px 16px;
    font-family: "GTA Art Deco", sans-serif;
    color: #fff;
}

.flash-card__kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #FA4039;
}
.flash-card__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FA4039;
    box-shadow: 0 0 0 0 rgba(250, 64, 57, 0.55);
    animation: flash-pulse 1.8s ease-out infinite;
    flex-shrink: 0;
}
@keyframes flash-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(250, 64, 57, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(250, 64, 57, 0); }
    100% { box-shadow: 0 0 0 0 rgba(250, 64, 57, 0); }
}

.flash-card__pct {
    font-family: "Reservation Wide", "GTA Art Deco", sans-serif;
    font-size: 38px;
    line-height: 1.05;
    letter-spacing: 0.01em;
    margin: 0 0 6px;
}
.flash-card__pct-off { color: #FA4039; }

.flash-card__sub {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.62);
}

/* Coupon chip — the whole thing is the copy button. */
.flash-card__code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px dashed rgba(250, 64, 57, 0.55);
    border-radius: 8px;
    background: rgba(250, 64, 57, 0.10);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.flash-card__code:hover {
    background: rgba(250, 64, 57, 0.17);
    border-color: rgba(250, 64, 57, 0.85);
}
.flash-card__code:active { transform: scale(0.985); }
.flash-card__code-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.14em;
    line-height: 1;
}
.flash-card__copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #FA4039;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}
.flash-card__copy svg { display: block; }
/* Idle shows the copy icon + "Copy"; .is-copied swaps to check + "Copied". */
.flash-card__copy-done,
.flash-card__code.is-copied .flash-card__copy-idle { display: none; }
.flash-card__code.is-copied .flash-card__copy-done { display: inline-flex; align-items: center; gap: 6px; }
.flash-card__code.is-copied {
    border-style: solid;
    border-color: #FA4039;
    background: rgba(250, 64, 57, 0.22);
}

.flash-card__timer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.flash-card__timer-value {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.07);
    padding: 4px 8px;
    border-radius: 5px;
}

/* Visually-hidden live region announcing "code copied" to SRs. */
.flash-card__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Collapsed pill (after dismiss) ── */
.flash-pill {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: radial-gradient(120% 120% at 30% 25%, #1c2130 0%, #10131c 100%);
    outline: 2px solid rgba(255, 255, 255, 0.08);
    outline-offset: -2px;
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.5),
        0 2px 12px rgba(250, 64, 57, 0.25);
    display: grid;
    place-items: center;
    opacity: 0;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}
.flash-pill.is-in {
    opacity: 1;
    transform: none;
}
.flash-pill:hover {
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.55),
        0 4px 18px rgba(250, 64, 57, 0.45);
}
.flash-pill__logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(250, 64, 57, 0.4));
}
.flash-pill__badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 8px;
    border-radius: 999px;
    background: radial-gradient(ellipse 60% 160% at 50% 50%, #FA4039 0%, #942622 100%);
    color: #fff;
    font-family: "GTA Art Deco", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(250, 64, 57, 0.35);
}

@media (max-width: 760px) {
    .flash-card {
        right: 12px;
        bottom: 12px;
        width: min(300px, calc(100vw - 24px));
    }
    .flash-card__body { padding: 16px 16px 14px; }
    .flash-card__pct { font-size: 33px; }
    .flash-pill { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .flash-card,
    .flash-pill {
        transform: none;
        transition: opacity 0.2s ease;
    }
    .flash-card__dot { animation: none; }
}
