:root {
    --ba-toast-top: clamp(88px, 14vh, 150px);
    --ba-toast-width: min(520px, calc(100vw - 28px));
}

@media (max-width: 480px) {
    :root {
        --ba-toast-top: clamp(72px, 12vh, 120px);
        --ba-toast-width: calc(100vw - 20px);
    }
}

#wc-notice-countdown-stack {
    position: fixed;
    top: var(--ba-toast-top);
    left: 50%;
    transform: translateX(-50%);
    width: var(--ba-toast-width);
    max-width: 520px;
    box-sizing: content-box;
    max-height: calc(100vh - var(--ba-toast-top) - 20px);
    max-height: calc(100dvh - var(--ba-toast-top) - 20px);
    padding: 0 4px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    isolation: isolate;
}

#wc-notice-countdown-stack > .wc-notice-countdown-toast {
    flex-shrink: 0;
}

#wc-notice-countdown-stack:empty {
    display: none;
}

/* Native classes remain intact. Repeating the class lets this shared skin
   override WooCommerce's two-class variants without requiring a stack parent. */
.wc-notice-countdown-toast.wc-notice-countdown-toast {
    --wc-notice-accent: #64748b;
    --wc-notice-shadow: rgba(100, 116, 139, 0.30);
    box-sizing: border-box;
    position: relative;
    display: block;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1em 3.5em !important;
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.10), 0 4px 6px -4px var(--wc-notice-shadow, rgba(15, 23, 42, 0.08)) !important;
    list-style: none !important;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: start !important;
    overflow-wrap: anywhere;
    z-index: auto;
    pointer-events: auto;
    touch-action: pan-y;
    will-change: transform, opacity;
    animation: wcNoticeCountdownEnter 180ms ease-out both;
}

.wc-notice-countdown-toast.wc-notice-countdown-inline {
    /* A theme may otherwise turn canonical checkout notices into fixed cards. */
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    max-height: none !important;
    margin-block-end: 1em !important;
    overflow: visible !important;
    z-index: auto !important;
    will-change: auto;
}

.wc-notice-countdown-toast.wc-notice--success {
    --wc-notice-accent: #16a34a;
    --wc-notice-shadow: rgba(22, 163, 74, 0.30);
}

.wc-notice-countdown-toast.wc-notice--info {
    --wc-notice-accent: #2563eb;
    --wc-notice-shadow: rgba(37, 99, 235, 0.30);
}

.wc-notice-countdown-toast.wc-notice--warning {
    --wc-notice-accent: #d97706;
    --wc-notice-shadow: rgba(217, 119, 6, 0.30);
}

.wc-notice-countdown-toast.wc-notice--error {
    --wc-notice-accent: #dc2626;
    --wc-notice-shadow: rgba(220, 38, 38, 0.30);
}

.coupon-error-notice.wc-notice--error {
    color: #b91c1c;
}

.wc-notice-countdown-toast > li,
.wc-notice-countdown-toast > .wc-block-components-notice-banner__content > .wc-block-components-notice-banner__list,
.wc-notice-countdown-toast > .wc-block-components-notice-banner__content > .wc-block-components-notice-banner__list > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* The countdown inside the list's last item is positioned against the toast. */
.wc-notice-countdown-toast > li {
    position: static;
}

.wc-notice-countdown-toast > .wc-block-components-notice-banner__content {
    min-width: 0;
    padding: 0 !important;
    white-space: normal;
}

.wc-notice-countdown-toast.wc-block-components-notice-banner > svg {
    display: none;
}

.wc-notice-countdown-toast > :first-child {
    margin-top: 0;
}

.wc-notice-countdown-toast > :last-child {
    margin-bottom: 0;
}

.wc-notice-countdown-toast a:not(.button),
.wc-notice-countdown-toast a:not(.button):hover,
.wc-notice-countdown-toast a:not(.button):focus,
.wc-notice-countdown-toast a:not(.button):active {
    color: var(--wc-notice-accent, #2563eb) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wc-notice-countdown-toast.wc-notice-countdown-toast::before {
    content: 'i' !important;
    position: absolute;
    left: auto;
    right: auto;
    inset-inline-start: 22px !important;
    inset-inline-end: auto !important;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--wc-notice-accent, #2563eb) !important;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.wc-notice-countdown-toast.wc-notice--success::before {
    content: '\2713' !important;
}

.wc-notice-countdown-toast.wc-notice--warning::before,
.wc-notice-countdown-toast.wc-notice--error::before {
    content: '!' !important;
}

.wc-notice-countdown-toast.wc-block-components-notice-banner > .wc-block-components-notice-banner__dismiss {
    /* Keep the native action available to WooCommerce and the countdown. */
    display: none !important;
}

.wc-notice-countdown-toast[hidden],
.wc-notice-countdown-toast.wc-notice-countdown-visually-dismissed {
    display: none !important;
}

.wc-notice-countdown-toast.wc-notice--dragging {
    transition: none;
    cursor: grabbing;
}

.wc-notice-countdown-toast.wc-notice--dismissed {
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.wc-notice-countdown-toast.wc-notice-countdown-inline:is(.wc-notice--dragging, .wc-notice--dismissed) {
    transform: var(--wc-notice-swipe-transform, translateX(0)) !important;
}

.wc-notice-countdown-toast .wc-notice-countdown {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 6px;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-end-start-radius: 7px;
    border-end-end-radius: 7px;
    overflow: hidden;
    transform-origin: left center;
    z-index: 5;
    pointer-events: none;
}

.wc-notice-countdown-toast .wc-notice-countdown__inner {
    display: block;
    height: 100%;
    width: 100%;
    background-color: var(--wc-notice-accent, #2563eb);
    opacity: 0.95;
    transform-origin: right center;
    animation-name: wcNoticeCountdownShrink;
    animation-duration: var(--wc-notice-countdown-duration, 6.5s);
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes wcNoticeCountdownShrink {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes wcNoticeCountdownEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-notice-countdown-toast.wc-notice--fading-out {
    animation: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.wc-notice-countdown-toast.wc-notice-countdown-inline.wc-notice--fading-out {
    transform: translateY(-4px) !important;
}
