/* Top-of-page offer banner: dismissible strip with an optional countdown.
   Always uses the brand colours: --primary-color background, --text-white text. */

.offer-banner {
    --offer-banner-radius: var(--radius-md, 8px);
    --offer-banner-fg: var(--text-white, #ffffff);
    --offer-banner-bg: var(--primary-color);
    /* translucent tints derived from the text colour, so nothing is hardcoded */
    --offer-banner-tint: color-mix(in srgb, var(--offer-banner-fg) 14%, transparent);
    --offer-banner-tint-strong: color-mix(in srgb, var(--offer-banner-fg) 24%, transparent);
    --offer-banner-line: color-mix(in srgb, var(--offer-banner-fg) 22%, transparent);

    position: relative;
    z-index: 20;
    isolation: isolate;
    overflow: hidden;
    inline-size: calc(100% - 2 * var(--padding-100, 1rem));
    max-inline-size: var(--main-width, 100%);
    margin: var(--spacing-sm, 12px) auto;
    border: 1px solid var(--offer-banner-line);
    border-radius: var(--offer-banner-radius);
    background:
        radial-gradient(120% 220% at 0% 0%, var(--offer-banner-tint) 0%, transparent 55%),
        linear-gradient(180deg, transparent 0%, color-mix(in srgb, black 10%, transparent) 100%),
        var(--offer-banner-bg);
    color: var(--offer-banner-fg);
    box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--offer-banner-bg) 70%, transparent);
    font-size: var(--font-size-base, 14px);
    line-height: 1.4;
    text-wrap: balance;
    animation: offer-banner-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes offer-banner-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* soft light sweep across the banner, once, after it appears */
.offer-banner::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: -40%;
    inline-size: 30%;
    z-index: -1;
    background: linear-gradient(100deg, transparent, var(--offer-banner-tint), transparent);
    transform: skewX(-20deg);
    animation: offer-banner-sweep 1.4s 0.5s ease-out both;
    pointer-events: none;
}

[dir="rtl"] .offer-banner::after {
    animation-name: offer-banner-sweep-rtl;
}

@keyframes offer-banner-sweep {
    to { inset-inline-start: 120%; }
}

@keyframes offer-banner-sweep-rtl {
    to { inset-inline-start: 120%; }
}

.offer-banner[hidden] {
    display: none;
}

/* ---- Layout ------------------------------------------------------------ */

.offer-banner__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px var(--spacing-lg, 20px);
    padding-block: 12px;
    padding-inline: var(--spacing-lg, 24px) 52px; /* room for the close button */
}

/* Title + message (+ arrow) form one link; countdown and close sit outside it. */
.offer-banner__cta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px var(--spacing-sm, 12px);
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-sm, 4px);
}

.offer-banner__cta:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.offer-banner__title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* a thin divider between title and message on wide screens */
.offer-banner__title + .offer-banner__message::before {
    content: "";
    display: inline-block;
    inline-size: 1px;
    block-size: 1em;
    margin-inline-end: var(--spacing-sm, 12px);
    vertical-align: -0.15em;
    background: var(--offer-banner-line);
}

.offer-banner__message {
    font-weight: 400;
    opacity: 0.92;
}

.offer-banner__arrow {
    flex: 0 0 auto;
    inline-size: 16px;
    block-size: 16px;
    transition: translate 0.2s ease;
}

[dir="rtl"] .offer-banner__arrow {
    scale: -1 1;
}

a.offer-banner__cta:hover .offer-banner__title,
a.offer-banner__cta:hover .offer-banner__message {
    text-decoration: underline;
    text-underline-offset: 3px;
}

a.offer-banner__cta:hover .offer-banner__arrow {
    translate: 3px 0;
}

[dir="rtl"] a.offer-banner__cta:hover .offer-banner__arrow {
    translate: -3px 0;
}

/* ---- Countdown --------------------------------------------------------- */

.offer-banner__countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--offer-banner-line);
    border-radius: 999px;
    background: var(--offer-banner-tint);
}

.offer-banner__unit {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding-inline: 8px;
    font-size: var(--font-size-xs, 11px);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.95;
}

.offer-banner__unit + .offer-banner__unit {
    border-inline-start: 1px solid var(--offer-banner-line);
}

.offer-banner__unit b {
    min-inline-size: 2ch;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---- Close button ------------------------------------------------------ */

.offer-banner__close {
    position: absolute;
    inset-inline-end: 12px;
    inset-block-start: 50%;
    translate: 0 -50%;
    z-index: 2;
    display: grid;
    place-items: center;
    inline-size: 28px;
    block-size: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, background-color 0.2s ease, scale 0.15s ease;
}

.offer-banner__close:hover {
    opacity: 1;
    background: var(--offer-banner-tint-strong);
    scale: 1.08;
}

.offer-banner__close:active {
    scale: 0.92;
}

.offer-banner__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

/* ---- Variants ---------------------------------------------------------- */
/* Both use the brand colours; they only change the depth. */

/* Solid: the default look above (gradient, glow, shadow). */

/* Light: flatter, no sweep or shadow, for a calmer page. */
.offer-banner--light {
    background: var(--offer-banner-bg);
    box-shadow: none;
}

.offer-banner--light::after {
    display: none;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 600px) {
    .offer-banner__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-block: 14px;
        padding-inline: var(--spacing-md, 16px) 44px;
        text-align: start;
    }

    .offer-banner__cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .offer-banner__title + .offer-banner__message::before {
        display: none;
    }

    .offer-banner__arrow {
        display: none;
    }

    .offer-banner__close {
        inset-block-start: 14px;
        translate: none;
    }
}

/* ---- Motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .offer-banner,
    .offer-banner::after,
    .offer-banner__close,
    .offer-banner__arrow {
        animation: none !important;
        transition: none !important;
    }

    .offer-banner::after {
        display: none;
    }
}