/*
 * Sale Banner & Countdown -- a fixed bar above the site's fixed header,
 * admin-controlled from Dashboard > Settings (sale_banner_* Config keys).
 *
 * --sale-banner-h is the single integration point with the rest of the
 * layout: it defaults to 0px everywhere, so when the banner is off
 * nothing here changes existing spacing at all. When it's on, body gets
 * the `has-sale-banner` class (set server-side in base.html), which sets
 * --sale-banner-h to a real height -- the fixed header's `top` and
 * #main-content's margin-top both read that same variable via calc(),
 * so they shift down by exactly the banner's height with no separate
 * JS measurement needed.
 */

:root {
    --sale-banner-h: 0px;
}

body.has-sale-banner {
    --sale-banner-h: 40px;
}

body.has-sale-banner .site-header.fixed-top {
    top: var(--sale-banner-h, 0px);
}

.sk-sale-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060; /* above .site-header's 1050 */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--cta-color, #D90429), #7a0000);
    color: #fff;
    padding: 0 2.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.sk-sale-banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    text-align: center;
}

.sk-sale-banner-icon {
    display: inline-flex;
}

.sk-sale-banner-timer {
    display: flex;
    gap: 0.35rem;
}

.sk-sale-banner-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 30px;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    line-height: 1.05;
}

.sk-sale-banner-unit strong {
    font-size: 0.9rem;
}

.sk-sale-banner-unit small {
    font-size: 0.55rem;
    text-transform: uppercase;
    opacity: 0.85;
}

.sk-sale-banner-cta {
    background: #fff;
    color: var(--cta-color, #D90429);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.9rem;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
}

.sk-sale-banner-cta:hover {
    color: var(--cta-color, #D90429);
    opacity: 0.9;
}

.sk-sale-banner-close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
    padding: 0 0.25rem;
}

.sk-sale-banner-close:hover {
    opacity: 1;
}

@media (max-width: 575px) {
    .sk-sale-banner {
        height: auto;
        min-height: 56px;
        padding: 0.4rem 2.2rem;
    }
    body.has-sale-banner {
        --sale-banner-h: 56px;
    }
    .sk-sale-banner-inner {
        font-size: 0.78rem;
    }
}
