/**
 * Khung FLASH SALE trong trang chi tiết sản phẩm (nằm dưới gallery).
 * Module: inc/flash-sale — xem flash-sale.php để biết cách lắp sang site khác.
 */
.tsl-flash {
    margin-top: 14px;
    --flash-ink: #0b2545;
    --flash-pink: #f9dcdc
}

/* Ảnh mặc định cho sản phẩm không chạy flash sale — cùng vị trí với khung sale. */
.tsl-flash-default {
    margin: 14px 0 0
}

.tsl-flash-default img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px
}

.tsl-flash.is-ended,
.tsl-flash[hidden] {
    display: none
}

.tsl-flash__banner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 9px;
    padding: 12px 14px 14px;
    aspect-ratio: 800 / 259;
    min-height: 168px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #f2c3c3;
    background: var(--flash-pink)
}

.tsl-flash__art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none
}

.tsl-flash__head,
.tsl-flash__quota {
    position: relative;
    z-index: 1
}

.tsl-flash__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.tsl-flash__title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--flash-ink);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1
}

.tsl-flash__title span {
    padding: 3px 7px;
    border-radius: 6px;
    background: #d1202a;
    color: #fff;
    font-size: 12px;
    letter-spacing: 0
}

.tsl-flash__note {
    margin: 0;
    color: #5b2130;
    font-size: 13px;
    font-weight: 600
}

.tsl-flash__clock {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto
}

.tsl-flash__unit {
    display: flex;
    align-items: center;
    gap: 4px
}

.tsl-flash__unit b {
    min-width: 36px;
    padding: 5px 6px;
    border-radius: 8px;
    background: var(--flash-ink);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    font-variant-numeric: tabular-nums
}

.tsl-flash__unit i {
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    color: #5b2130
}

.tsl-flash__quota {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    box-shadow: inset 0 0 0 1px rgba(190, 90, 90, .16)
}

.tsl-flash__quota-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--flash-kept, 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, #ffd75e, #ffab1f);
    transition: width .45s ease
}

.tsl-flash__quota-text {
    position: relative;
    color: #6b2b10;
    font-size: 12.5px;
    font-weight: 700
}

.tsl-flash__cta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px 10px 8px;
    border-radius: 14px;
    background: linear-gradient(90deg, #ff9b21, #f4511c);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(244, 81, 28, .22)
}

.tsl-flash__cta:hover {
    color: #fff;
    filter: saturate(1.1) brightness(1.03);
    text-decoration: none
}

.tsl-flash__cta:focus-visible {
    outline: 3px solid #0969e8;
    outline-offset: 2px
}

.tsl-flash__cta-icon {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: #e02b2b;
    font-size: 15px;
    font-weight: 800
}

.tsl-flash__cta-text {
    flex: 1 1 auto;
    min-width: 0
}

.tsl-flash__cta-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    color: #f4511c;
    font-size: 17px;
    font-weight: 800;
    line-height: 1
}

@media (max-width: 782px) {
    .tsl-flash__banner {
        aspect-ratio: auto;
        min-height: 0;
        padding: 0 0 12px
    }

    .tsl-flash__art {
        position: relative;
        width: 100%;
        height: auto;
        object-fit: contain;
        margin-bottom: 10px
    }

    .tsl-flash__head,
    .tsl-flash__quota {
        padding: 0 12px
    }

    .tsl-flash__clock {
        margin-left: 0
    }

    .tsl-flash__unit b {
        min-width: 31px;
        font-size: 15px
    }

    .tsl-flash__cta {
        font-size: 14.5px
    }
}
