@keyframes boltFlash {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.62;
    }
}

/* Flash Sale plan price */
.plan-current-price.flash-price {
    color: #ba1a1a !important;
}

.product-detail-page .plan-discount-badge.flash-discount {
    align-items: center;
    background: #ffdad6 !important;
    border: 1px solid rgba(186, 26, 26, 0.16) !important;
    border-radius: 999px !important;
    color: #ba1a1a !important;
    display: inline-flex;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    min-height: 24px;
    padding: 5px 9px !important;
    white-space: nowrap;
}

.flash-sale-badge-inline {
    align-items: center;
    background: #fff3cd;
    border: 1px solid rgba(255, 159, 28, 0.18);
    border-radius: 999px;
    color: #a15c00;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    gap: 5px;
    line-height: 1;
    min-height: 26px;
    padding: 6px 10px;
    white-space: nowrap;
}

.flash-sale-badge-inline i {
    color: #ff9f1c;
    font-size: 0.75rem;
    line-height: 1;
}

/* Reused Flash Sale countdown visual language from the home page widget */
.product-flash-sale-countdown {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 22px;
}

.product-flash-sale-countdown .flashsale-timer {
    --digit-dur: 500ms;
    --digit-distance: 8px;
    --digit-stagger: 70ms;
    --digit-blur: 2px;
    --digit-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
    --digit-dir-x: 0;
    --digit-dir-y: 1;

    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: inline-flex;
    gap: 12px;
    max-width: 100%;
    min-height: 66px;
    padding: 9px 12px;
    white-space: nowrap;
}

.product-flash-sale-countdown .timer-label {
    color: #5f6670;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    max-width: 124px;
    min-width: 116px;
}

.product-flash-sale-countdown .timer-countdown {
    align-items: center;
    display: flex;
    gap: 7px;
}

.product-flash-sale-countdown .timer-block {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    min-height: 48px;
    min-width: 76px;
    padding: 7px 9px;
    text-align: center;
}

.product-flash-sale-countdown .timer-number {
    align-items: center;
    color: #111315;
    display: inline-flex;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    justify-content: center;
    letter-spacing: 0;
    line-height: 1;
    min-height: 21px;
    min-width: 2ch;
    overflow: visible;
    width: 2ch;
}

.product-flash-sale-countdown .timer-text {
    color: #858c96;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 5px;
    min-height: 12px;
    text-transform: none;
}

.product-flash-sale-countdown .timer-colon {
    color: #111315;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    margin: 0;
}

.product-flash-sale-countdown .t-digit-group {
    align-items: baseline;
    display: inline-flex;
    justify-content: center;
    width: 2ch;
}

.product-flash-sale-countdown .t-digit {
    display: inline-block;
    min-width: 1ch;
    text-align: center;
    transform: translateZ(0);
    width: 1ch;
    will-change: transform, opacity, filter;
}

.product-flash-sale-countdown .t-digit-group.is-animating .t-digit {
    animation: t-digit-pop-in var(--digit-dur) var(--digit-ease) both;
    animation-delay: calc(var(--digit-stagger) * var(--digit-stagger-index, 0));
}

@keyframes t-digit-pop-in {
    0% {
        filter: blur(var(--digit-blur));
        opacity: 0;
        transform: translate(
            calc(var(--digit-distance) * var(--digit-dir-x)),
            calc(var(--digit-distance) * var(--digit-dir-y))
        );
    }

    100% {
        filter: blur(0);
        opacity: 1;
        transform: translate(0, 0);
    }
}

[data-theme="dark"] .product-plan-card.has-flash-sale {
    /* same card surface as regular plans */
}

[data-theme="dark"] .product-flash-sale-countdown .flashsale-timer {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="dark"] .product-flash-sale-countdown .timer-label {
    color: rgba(244, 247, 242, 0.76);
}

[data-theme="dark"] .product-flash-sale-countdown .timer-block {
    background: transparent;
}

[data-theme="dark"] .product-flash-sale-countdown .timer-number,
[data-theme="dark"] .product-flash-sale-countdown .timer-colon {
    color: #f4f7f2;
}

[data-theme="dark"] .product-flash-sale-countdown .timer-text {
    color: rgba(244, 247, 242, 0.58);
}

[data-theme="dark"] .product-detail-page .plan-discount-badge.flash-discount {
    background: rgba(255, 218, 214, 0.12) !important;
    border-color: rgba(255, 180, 171, 0.24) !important;
    color: #ffb4ab !important;
}

[data-theme="dark"] .flash-sale-badge-inline {
    background: rgba(255, 159, 28, 0.14);
    border-color: rgba(255, 159, 28, 0.24);
    color: #ffd392;
}

@media (max-width: 768px) {
    .product-flash-sale-countdown {
        justify-content: stretch;
    }

    .product-flash-sale-countdown .flashsale-timer {
        width: 100%;
    }

    .product-flash-sale-countdown .timer-countdown {
        flex: 1;
        justify-content: center;
    }

    .product-flash-sale-countdown .timer-block {
        align-items: center;
        flex: 1;
        justify-content: center;
        min-width: 0;
        text-align: center;
    }

    .product-flash-sale-countdown .timer-number {
        justify-content: center;
        margin: 0 auto;
        min-width: 0;
        text-align: center;
        width: 100%;
    }

    .product-flash-sale-countdown .t-digit-group {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .product-flash-sale-countdown .flashsale-timer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .product-flash-sale-countdown .timer-label {
        max-width: none;
        min-width: 0;
    }

    .product-flash-sale-countdown .timer-countdown {
        width: 100%;
    }

    .product-flash-sale-countdown .timer-block {
        padding: 7px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-flash-sale-countdown .t-digit {
        animation: none !important;
    }
}
