/************** holiday-2026 sale banner **************/
/* Markup: templates/components/banners/holiday_2026_banner.html
   Behaviour (countdown, slide-in, close): td_static/js/flash_banner/custom.js
   Design: Figma "TD Holiday Banner 2026", V1 (node 2142:3). The 89px desktop artboard is
   scaled to the 70px banner (about 0.786). */

body.flash-sale-banner-open {
    margin-top: 70px;
}
body.flash-sale-banner-open .fixed-top {
    top: 70px;
}

/* Desktop (1366px and up): artwork on both edges, one row.
   The padding keeps the row (and any wrapped translation) clear of the hanging ornaments:
   the left art's end 179px in, the right art's start 249px in from the right edge. It also
   centres the row in the space left of the 70px close square, as in Figma. Below 1366px the
   right art's snow dots (they start 387px in from the right edge) would sit behind the
   countdown labels, so the two-sided art starts there. */
.hol2026-banner {
    position: fixed;
    top: -100%;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 999;
    visibility: hidden;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    padding: 0 270px 0 200px;
    box-sizing: border-box;
    color: #FFF;
    /* Must stay exactly #00142A: the artwork PNGs are opaque on that colour. */
    background:
        url("/static/images/flash_banner/holiday-2026-left.2be2f8342e53.png") left center / auto 100% no-repeat,
        url("/static/images/flash_banner/holiday-2026-right.49bee8aed8a8.png") right 70px center / auto 100% no-repeat,
        #00142A;
    /* System fonts only. Naming a web font here ('Open Sans') made the text switch from bold to
       regular a few seconds after load, when the OptinMonster popup loads Open Sans in weight 400 only. */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: top .7s ease-in-out, visibility .7s ease-in-out;
}

.hol2026-banner .flash-clickable-link {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 9;
}

/* Pill + headline + offer */
.hol2026-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.hol2026-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 100px;
    background: linear-gradient(92deg, #06AAE8 0.6%, #007FD4 50%, #008BE2 74.8%, #37B4E5 99.5%);
    border: 2px solid #72CBFE;
    color: #FFF;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.64px;
    text-transform: uppercase;
    white-space: nowrap;
}
/* The pill is English only: "Holiday" has no entry in the translation sheet, and the translated
   headlines already carry the holiday wording. Weglot sets <html lang> on every translated page. */
html:not([lang^="en"]) .hol2026-pill {
    display: none;
}
/* Translated headline + offer are too long for one row, so they always stack. A column is
   exactly as wide as its longest line, which keeps the countdown next to the text. */
html:not([lang^="en"]) .hol2026-text {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 2px;
}
.hol2026-text {
    flex: 0 1 auto;
    min-width: 0;
    /* A wrapped flex box takes all the width it is offered, which would push the countdown
       away from the text. The cap keeps that gap small; the English row needs about 28ch. */
    max-width: 34ch;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.9px;
    line-height: 1.2;
    text-align: left;
}
.hol2026-headline {
    color: #FFF;
    white-space: nowrap;
}
.hol2026-offer {
    color: #00A9EE;
    white-space: nowrap;
}

/* Countdown: 32px boxes in 42px columns, so the boxes sit 10px apart */
.hol2026-banner .flash-sale-banner-timer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
}
.hol2026-banner .flash-sale-timer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 42px;
    line-height: 1;
    text-align: center;
}
.hol2026-banner .flash-sale-timer-block > span:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border-radius: 4px;
    background: #163E53;
    color: #FFF;
    font-size: 15px;
    font-weight: 600;
}
.hol2026-banner .flash-sale-timer-block .flash-sale-hour-block {
    display: block;
    margin-top: 4px;
    color: #FFF;
    font-size: 9.5px;
    font-weight: 400;
    text-transform: none;
    white-space: nowrap;
}

/* Close button: square on the right edge */
.hol2026-banner .flash-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 70px;
    width: 70px;
    cursor: pointer;
    z-index: 99;
    background: #1DA1F2;
}
.hol2026-banner .flash-close-btn::before,
.hol2026-banner .flash-close-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2.5px;
    height: 26px;
    margin: -13px 0 0 -1px;
    background: #FFF;
    border-radius: 2px;
}
.hol2026-banner .flash-close-btn::before { transform: rotate(45deg); }
.hol2026-banner .flash-close-btn::after  { transform: rotate(-45deg); }

/* Tablet (768-1365px): no Figma frame. The full desktop art would run its ornaments under
   the text here, so only the small left art (128px wide) is shown and long strings wrap. */
@media (max-width: 1365px) {
    .hol2026-banner {
        padding: 0 80px 0 140px;
        background:
            url("/static/images/flash_banner/holiday-2026-mobile-left.cea5e4408bd9.png") left center / auto 100% no-repeat,
            #00142A;
    }
    .hol2026-headline,
    .hol2026-offer {
        white-space: normal;
    }
}

@media (max-width: 1100px) {
    .hol2026-banner { gap: 16px; }
    .hol2026-text { font-size: 18px; }
    .hol2026-pill { height: 30px; padding: 0 12px; font-size: 13px; }
}

/* Headline above offer */
@media (max-width: 1023px) {
    .hol2026-text {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 2px;
        font-size: 16px;
    }
}

/* Mobile (Figma 430x70): art on the left, pill + headline on line one, offer below, then the
   countdown. The text block is only as wide as its text (a grid shrinks to fit; a wrapping
   flex row does not), and the countdown's auto margins centre it in what is left, so the
   space between text and countdown equals the space between countdown and close button. */
@media (max-width: 767px) {
    .hol2026-banner {
        justify-content: flex-start;
        gap: 15px;
        /* 55px close button + the 15px gap, so both sides of the countdown start equal */
        padding: 0 70px 0 84px;
    }
    .hol2026-content {
        flex: 0 1 auto;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        /* Rows are 3px apart at least; with the usual two rows min-height spreads them to
           Figma's 9px, and a third or fourth row (long translations) still fits in 70px. */
        gap: 3px 5px;
        min-height: 45px;
        align-content: space-between;
        min-width: 0;
    }
    .hol2026-pill {
        height: 22px;
        padding: 0 10px;
        font-size: 12px;
        letter-spacing: 0.48px;
    }
    .hol2026-text {
        display: contents;
    }
    .hol2026-headline {
        min-width: 0;
        font-size: 11px;
        letter-spacing: 0.01em;
        line-height: 1.15;
        word-break: keep-all;      /* Korean: break at spaces, not inside words */
        overflow-wrap: anywhere;   /* Japanese: no spaces, so allow a break when it would overflow */
    }
    .hol2026-offer {
        grid-column: 1 / -1;
        min-width: 0;
        font-size: 12px;
        letter-spacing: 0.01em;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
    /* Without the pill the headline takes the whole first row */
    html:not([lang^="en"]) .hol2026-headline { grid-column: 1 / -1; }
    .hol2026-banner .flash-sale-banner-timer { gap: 9px; margin: 0 auto; }
    .hol2026-banner .flash-sale-timer-block { width: 28px; }
    .hol2026-banner .flash-sale-timer-block > span:first-child {
        width: 28px;
        height: 24px;
        font-size: 12px;
    }
    .hol2026-banner .flash-sale-timer-block .flash-sale-hour-block { font-size: 8.5px; margin-top: 3px; }
    .hol2026-banner .flash-close-btn { width: 55px; }
    .hol2026-banner .flash-close-btn::before,
    .hol2026-banner .flash-close-btn::after { height: 18px; margin-top: -9px; width: 2px; }
}

/* Small mobile: art slides 28px off the left edge (ornaments end 46px in), everything tightens */
@media (max-width: 429px) {
    .hol2026-banner {
        gap: 8px;
        /* 44px close button + the 8px gap */
        padding: 0 52px 0 56px;
        background-position: -28px center;
    }
    .hol2026-content { min-height: 42px; }
    .hol2026-pill {
        height: 20px;
        padding: 0 8px;
        font-size: 10px;
        letter-spacing: 0.4px;
    }
    .hol2026-offer { font-size: 11px; }
    .hol2026-banner .flash-sale-banner-timer { gap: 4px; }
    .hol2026-banner .flash-sale-timer-block { width: 24px; }
    .hol2026-banner .flash-sale-timer-block > span:first-child {
        width: 24px;
        height: 22px;
        font-size: 11px;
    }
    .hol2026-banner .flash-sale-timer-block .flash-sale-hour-block { font-size: 8px; }
    .hol2026-banner .flash-close-btn { width: 44px; }
}

/* Narrowest phones: a long translation runs to five lines here (pill, two-line headline,
   two-line offer), so the type and the pill shrink until that fits in 70px. */
@media (max-width: 359px) {
    .hol2026-content { gap: 1px 4px; }
    /* 6px padding so "Flash Sale" still fits beside the pill at 320px */
    .hol2026-pill { height: 18px; padding: 0 6px; }
    .hol2026-headline,
    .hol2026-offer {
        font-size: 10px;
        line-height: 1.1;
    }
}
/************** holiday-2026 sale banner end **************/
