/* ================ Announcement Bar Start Here ================ */
/* Single-line, dismissible offer bar that sits above the header.
   Colours are taken from the theme tokens in main.css so it stays on brand. */

.announcement-bar {
    position: relative;
    z-index: 52;
    background-image: linear-gradient(90deg, hsl(var(--base-two-d-200)) 0%, hsl(var(--base-two-d-100)) 35%, hsl(var(--base-d-100)) 100%);
    color: hsl(var(--white));
    overflow: hidden;
    /* collapsed by default: the script opens it, so a dismissed bar never flashes */
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.announcement-bar.is-open {
    max-height: 120px;
    opacity: 1;
}

/* soft sheen so the bar reads as a designed strip, not a flat error banner */
.announcement-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(120deg, hsl(var(--white)/0) 30%, hsl(var(--white)/0.14) 50%, hsl(var(--white)/0) 70%);
    transform: translateX(-100%);
    animation: announcement-sheen 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes announcement-sheen {
    0%, 60% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.announcement-bar__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 44px;
    padding: 6px 0;
}

.announcement-bar__viewport {
    position: relative;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.announcement-bar__item {
    display: none;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.announcement-bar__item.is-active {
    display: flex;
    animation: announcement-fade 0.4s ease;
}

@keyframes announcement-fade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.announcement-bar__tag {
    flex-shrink: 0;
    background-color: hsl(var(--white)/0.18);
    border: 1px solid hsl(var(--white)/0.25);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

.announcement-bar__icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    opacity: 0.9;
}

.announcement-bar__text {
    /* one line, always - long copy is clipped rather than pushing the bar taller */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* coupon code chip - dashed "tear-off" edge so it reads as a voucher, not a button */
.announcement-bar__code {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px;
    border: 1px dashed hsl(var(--white)/0.55);
    border-radius: 6px;
    background-color: hsl(var(--white)/0.12);
    color: hsl(var(--white));
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.announcement-bar__code:hover,
.announcement-bar__code:focus-visible {
    background-color: hsl(var(--white)/0.22);
    border-color: hsl(var(--white));
}

.announcement-bar__code-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.75;
}

.announcement-bar__code-value {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.announcement-bar__code i {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* copied state: the chip fills in and the icon flips to a tick, in place, so
   the bar never reflows mid-click */
.announcement-bar__code.is-copied {
    background-color: hsl(var(--white));
    border-style: solid;
    border-color: hsl(var(--white));
    color: hsl(var(--base-d-200));
}

.announcement-bar__code.is-copied .announcement-bar__code-label {
    opacity: 1;
}

.announcement-bar__code.is-copied i::before {
    content: "\f00c";
    font-family: "Line Awesome Free";
    font-weight: 900;
}

.announcement-bar__link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: hsl(var(--white));
    font-weight: 600;
    /* no underline here: it would propagate to the arrow, which is a flex item
       and therefore an in-flow block box, not an atomic inline */
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.announcement-bar__link-text {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.announcement-bar__link:hover,
.announcement-bar__link:focus {
    color: hsl(var(--white));
    opacity: 0.82;
}

.announcement-bar__link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.announcement-bar__link:hover i {
    transform: translateX(3px);
}

.announcement-bar__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    background-color: hsl(var(--white));
    color: hsl(var(--base-d-200));
    border-radius: 999px;
    padding: 5px 16px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.announcement-bar__btn:hover,
.announcement-bar__btn:focus {
    color: hsl(var(--base-d-300));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px hsl(var(--black)/0.22);
}

.announcement-bar__dots {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.announcement-bar__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: hsl(var(--white)/0.35);
    transition: background-color 0.3s ease, width 0.3s ease;
}

.announcement-bar__dot.is-active {
    width: 16px;
    border-radius: 999px;
    background-color: hsl(var(--white));
}

.announcement-bar__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background-color: hsl(var(--white)/0.12);
    color: hsl(var(--white));
    font-size: 1rem;
    line-height: 1;
    opacity: 0.85;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.announcement-bar__close:hover,
.announcement-bar__close:focus-visible {
    opacity: 1;
    background-color: hsl(var(--white)/0.25);
}

.announcement-bar :focus-visible {
    outline: 2px solid hsl(var(--white));
    outline-offset: 2px;
}

/* the theme pulls the header out of flow below 1200px, so hand it the bar's
   height back - otherwise the mobile header lands on top of the announcement */
@media screen and (max-width: 1199px) {
    body.has-announcement .header:not(.fixed-header) {
        top: var(--announcement-height, 0px);
    }
}

@media screen and (max-width: 991px) {
    .announcement-bar__inner {
        gap: 10px;
        min-height: 40px;
    }

    .announcement-bar__viewport {
        justify-content: flex-start;
    }

    .announcement-bar__item {
        font-size: 0.8125rem;
        gap: 8px;
    }

    /* on a phone the offer itself has to win the space */
    .announcement-bar__icon,
    .announcement-bar__dots {
        display: none;
    }
}

@media screen and (max-width: 575px) {
    .announcement-bar__tag,
    .announcement-bar__link {
        display: none;
    }

    /* the chip stays - it carries the offer - but drops to just the code */
    .announcement-bar__code-label {
        display: none;
    }

    .announcement-bar__code {
        gap: 5px;
        padding: 2px 8px;
    }

    .announcement-bar__btn {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .announcement-bar,
    .announcement-bar__item.is-active,
    .announcement-bar__link i,
    .announcement-bar__code,
    .announcement-bar__btn {
        transition: none;
        animation: none;
    }

    .announcement-bar::after {
        display: none;
    }
}

/* ================ Announcement Bar End Here ================ */
