/* Black Friday 2026 strip and Premium-card treatment. sale.js adds
   html.sale-on and the markup only while the sale runs; without it,
   nothing here applies. */
:root { --sale-h: 48px; }

html.sale-on body { padding-top: var(--sale-h); }
html.sale-on .nav { top: var(--sale-h); }
html.sale-on .app-banner { top: var(--sale-h); }
html.sale-on body.banner-active { padding-top: calc(62px + var(--sale-h)); }
html.sale-on body.banner-active .nav { top: calc(62px + var(--sale-h)); }

.sale-strip {
    position: fixed; top: 0; left: 0; right: 0; z-index: 250;
    height: var(--sale-h);
    display: flex; align-items: center; justify-content: center;
    padding: 0 44px;
    overflow: hidden;
    color: #F7F1E3;
    background:
        radial-gradient(90% 260% at 8% 0%, rgba(217, 154, 43, 0.30) 0%, transparent 46%),
        radial-gradient(90% 260% at 92% 100%, rgba(150, 142, 255, 0.32) 0%, transparent 50%),
        linear-gradient(100deg, #15132B 0%, #26235E 36%, #3D3A85 62%, #1A1836 100%);
    border-bottom: 1px solid rgba(245, 198, 107, 0.38);
    box-shadow: 0 6px 24px rgba(21, 19, 43, 0.22);
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
}

/* A slow gold sheen sweeping across the band */
.sale-strip::before {
    content: ''; position: absolute; top: -10%; bottom: -10%; left: 0; width: 36%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 222, 160, 0.20) 50%, transparent 100%);
    transform: translateX(-120%) skewX(-18deg);
    animation: sale-sheen 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes sale-sheen {
    0% { transform: translateX(-120%) skewX(-18deg); }
    55%, 100% { transform: translateX(320%) skewX(-18deg); }
}

.sale-spark {
    position: absolute; z-index: 0; pointer-events: none;
    color: #F5C66B; font-size: 10px; line-height: 1;
    opacity: 0; animation: sale-twinkle 3.4s ease-in-out infinite;
}
.sale-spark:nth-child(1) { left: 5%;  top: 16%; }
.sale-spark:nth-child(2) { left: 21%; top: 62%; font-size: 7px;  animation-delay: 0.9s; }
.sale-spark:nth-child(3) { left: 50%; top: 10%; font-size: 8px;  animation-delay: 1.7s; }
.sale-spark:nth-child(4) { left: 76%; top: 60%; font-size: 9px;  animation-delay: 0.4s; }
.sale-spark:nth-child(5) { left: 94%; top: 18%; font-size: 7px;  animation-delay: 2.3s; }
@keyframes sale-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
    50% { opacity: 0.95; transform: scale(1) rotate(45deg); }
}

.sale-link {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 16px;
    height: 100%; min-width: 0;
    color: inherit; text-decoration: none; white-space: nowrap;
}
.sale-link:focus-visible { outline: 2px solid #F0B94F; outline-offset: -6px; border-radius: 10px; }

.sale-tag {
    padding: 4px 10px; border-radius: 100px;
    font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    color: #1B1915;
    background: linear-gradient(135deg, #FBE3A6 0%, #F0B94F 48%, #D99A2B 100%);
    animation: sale-glow 2.6s ease-in-out infinite;
}
@keyframes sale-glow {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.55), 0 0 8px rgba(240, 185, 79, 0.30); }
    50% { box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.55), 0 0 20px rgba(240, 185, 79, 0.75); }
}

.sale-copy { display: inline-flex; align-items: baseline; gap: 8px; }
.sale-product { font-size: 0.92rem; font-weight: 600; color: #F7F1E3; }
.sale-off {
    font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 500;
    font-size: 1.24rem; line-height: 1;
    background: linear-gradient(90deg, #FBE3A6 0%, #F0B94F 25%, #FFF4D6 50%, #F0B94F 75%, #FBE3A6 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    animation: sale-shimmer 3.2s linear infinite;
    /* Italic glyphs overhang their box and background-clip: text paints only
       inside it, which cut off the last f. Pad the box out to cover the
       overhang, and pull the margins back so the layout doesn't move. */
    padding: 0.12em 0.18em 0.14em 0.06em;
    margin: -0.12em -0.18em -0.14em -0.06em;
}
@keyframes sale-shimmer { to { background-position: -200% 0; } }

.sale-price { display: inline-flex; align-items: baseline; gap: 6px; font-size: 0.86rem; }
.sale-was {
    color: rgba(247, 241, 227, 0.5);
    text-decoration-color: rgba(240, 185, 79, 0.9); text-decoration-thickness: 1.5px;
}
.sale-now { font-weight: 600; color: #FFFFFF; }

.sale-ends {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.74rem; letter-spacing: 0.02em; color: rgba(247, 241, 227, 0.7);
}
.sale-clock { display: inline-flex; gap: 4px; font-variant-numeric: tabular-nums; }
.sale-unit {
    display: inline-flex; align-items: baseline; gap: 1px;
    padding: 3px 6px; border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
}
.sale-num { font-size: 0.84rem; font-weight: 600; color: #FFFFFF; }
.sale-lbl { font-size: 0.62rem; color: rgba(247, 241, 227, 0.6); }

.sale-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 100px;
    background: #F7F1E3; color: #26234A;
    font-size: 0.8rem; font-weight: 600;
    transition: box-shadow 0.2s ease;
}
.sale-arrow { display: inline-block; transition: transform 0.2s ease; }
.sale-link:hover .sale-cta { box-shadow: 0 0 18px rgba(247, 241, 227, 0.4); }
.sale-link:hover .sale-arrow { transform: translateX(3px); }

.sale-close {
    position: absolute; right: 8px; top: 50%; z-index: 2;
    transform: translateY(-50%);
    width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: transparent; color: rgba(247, 241, 227, 0.6);
    font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.sale-close:hover, .sale-close:focus-visible { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }

@media (max-width: 980px) {
    .sale-price, .sale-ends-label { display: none; }
}
@media (max-width: 720px) {
    :root { --sale-h: 44px; }
    .sale-strip { padding: 0 38px 0 12px; }
    .sale-link { gap: 10px; }
    .sale-product-more, .sale-cta { display: none; }
}
@media (max-width: 420px) {
    .sale-strip { padding: 0 34px 0 8px; }
    .sale-link { gap: 7px; }
    .sale-tag { padding: 3px 7px; font-size: 0.58rem; letter-spacing: 0.1em; }
    .sale-product { font-size: 0.82rem; }
    .sale-off { font-size: 1.06rem; }
    .sale-clock { gap: 3px; }
    .sale-unit { padding: 2px 4px; }
    .sale-num { font-size: 0.76rem; }
}
/* Pro Max widths (430-440) too: with seconds, the clock runs under the close button */
@media (max-width: 480px) {
    .sale-strip:not(.sale-final) .sale-unit-s { display: none; }
}
@media (max-width: 350px) {
    .sale-strip:not(.sale-final) .sale-unit-m,
    .sale-final .sale-unit-s { display: none; }
}
/* Cyber Monday, the last day: hours, minutes, seconds instead of days */
.sale-final .sale-unit-d { display: none; }

/* Homepage Premium card */
.premium-card.sale-card {
    position: relative;
    border-color: rgba(217, 154, 43, 0.6);
    box-shadow: 0 0 0 1px rgba(217, 154, 43, 0.22), 0 18px 50px rgba(185, 122, 24, 0.14);
}
.sale-ribbon {
    position: absolute; top: 0; left: 50%;
    transform: translate(-50%, -50%);
    padding: 7px 16px; border-radius: 100px; white-space: nowrap;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    color: #F7F1E3;
    background: linear-gradient(100deg, #15132B 0%, #3D3A85 60%, #26235E 100%);
    border: 1px solid rgba(245, 198, 107, 0.55);
    box-shadow: 0 6px 20px rgba(21, 19, 43, 0.25);
}
.sale-ribbon-spark { color: #F0B94F; }
.sale-chip {
    flex: none; white-space: nowrap;
    margin-left: 4px; padding: 3px 8px; border-radius: 100px;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: #1B1915;
    background: linear-gradient(135deg, #FBE3A6 0%, #F0B94F 48%, #D99A2B 100%);
}
.sale-inline { display: block; margin-top: 6px; font-size: 0.95rem; color: var(--ink-secondary); }
.sale-inline-was { color: var(--ink-tertiary); }
.sale-inline-now { color: var(--amber-text); font-weight: 600; }
@media (max-width: 420px) {
    .sale-ribbon { font-size: 0.62rem; letter-spacing: 0.05em; padding: 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .sale-strip::before, .sale-spark { display: none; }
    .sale-tag, .sale-off { animation: none; }
    .sale-arrow, .sale-cta { transition: none; }
}
