/* ============================================
   FLASH SALE WIDGET
   ============================================ */

/* Main Section */
.flashsale-section {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(220, 38, 38, 0.3);
    margin-top: 25px;
}

/* Header */
.flashsale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.flashsale-header-content {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.flashsale-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flashsale-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoPulse 1.5s ease-in-out infinite;
}

.flashsale-logo i {
    font-size: 1rem;
    color: #fff;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(251, 191, 36, 0.3);
    }
}

.flashsale-title-group {
    display: flex;
    flex-direction: column;
}

.flashsale-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.flashsale-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1px;
}

/* Timer */
.flashsale-timer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.timer-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 38px;
    backdrop-filter: blur(4px);
}

.timer-number {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer-text {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.timer-colon {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 10px;
    animation: colonBlink 1s step-end infinite;
}

@keyframes colonBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* View All Button */
.flashsale-viewall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.flashsale-viewall:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateX(3px);
}

.flashsale-viewall i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.flashsale-viewall:hover i {
    transform: translateX(3px);
}

/* Carousel Wrapper */
.flashsale-carousel-wrapper {
    position: relative;
    padding: 12px 16px;
    background: #f7f8fa;
}

/* Navigation Buttons */
.flashsale-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.flashsale-nav:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.flashsale-nav-prev {
    left: 8px;
}

.flashsale-nav-next {
    right: 8px;
}

.flashsale-nav i {
    font-size: 1rem;
}

/* Carousel */
.flashsale-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px;
}

.flashsale-carousel::-webkit-scrollbar {
    display: none;
}

/* Carousel Item */
.flashsale-item {
    flex: 0 0 calc(25% - 9px);
    min-width: 200px;
    max-width: calc(25% - 9px);
}

/* Product Card override for Flash Sale carousel */
.flashsale-item .product-card {
    height: 100%;
    margin-bottom: 0;
}

/* Price inline for Flash Sale */
.flashsale-item .product-card-price {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* Product Card */
.flashsale-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #f3f4f6;
    transition: all 0.25s ease;
    height: 100%;
}

.flashsale-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.15);
    border-color: #fecaca;
}

/* Card Image */
.flashsale-card-image {
    position: relative;
    width: 100%;
    padding-top: 62.5%;
    /* 16:10 aspect ratio */
    background: #f9fafb;
    overflow: hidden;
    border-radius: 8px;
}

.flashsale-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.flashsale-card:hover .flashsale-card-image img {
    transform: scale(1.05);
}

.flashsale-card-image img.lazy {
    filter: blur(8px);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.flashsale-card-image img.lazy.loaded {
    filter: blur(0);
}

.flashsale-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #d1d5db;
    font-size: 2rem;
}

/* Discount Badge */
.flashsale-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    padding: 4px 8px;
    border-radius: 0 0 0 8px;
    z-index: 2;
}

.badge-percent {
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
}

/* Card Content */
.flashsale-card-content {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.flashsale-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
}

.flashsale-card:hover .flashsale-card-name {
    color: #dc2626;
}

/* Pricing */
.flashsale-card-pricing {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.flashsale-price-new {
    font-size: 0.95rem;
    font-weight: 800;
    color: #dc2626;
}

.flashsale-price-old {
    font-size: 0.7rem;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Stock Progress */
.flashsale-stock {
    margin-top: auto;
}

.flashsale-stock-bar {
    width: 100%;
    height: 14px;
    background: linear-gradient(90deg, #fef2f2, #fee2e2);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

.flashsale-stock-fill {
    height: 100%;
    background: linear-gradient(90deg, #f87171, #dc2626);
    border-radius: 7px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 20px;
    transition: width 0.5s ease;
}

.flashsale-stock-fire {
    font-size: 0.55rem;
    margin-right: 3px;
    animation: fireBounce 0.5s ease infinite alternate;
}

@keyframes fireBounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-1px);
    }
}

.flashsale-stock-text {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    color: #dc2626;
    font-weight: 600;
    margin-top: 2px;
}

/* Meta Info */
.flashsale-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #f3f4f6;
}

.meta-sold {
    font-size: 0.68rem;
    color: #6b7280;
}

.meta-delivery {
    font-size: 0.7rem;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.meta-delivery.instant {
    color: #10b981;
}

.meta-delivery i {
    font-size: 0.6rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .flashsale-item {
        flex: 0 0 calc(25% - 9px);
        min-width: 150px;
        max-width: calc(25% - 9px);
    }
}

@media (max-width: 768px) {
    .flashsale-header {
        padding: 12px 16px;
    }

    .flashsale-header-content {
        gap: 16px;
        width: 100%;
    }

    .flashsale-logo {
        width: 38px;
        height: 38px;
    }

    .flashsale-logo i {
        font-size: 1.1rem;
    }

    .flashsale-title {
        font-size: 1.1rem;
    }

    .timer-block {
        padding: 5px 8px;
        min-width: 40px;
    }

    .timer-number {
        font-size: 1rem;
    }

    .flashsale-carousel-wrapper {
        padding: 16px;
    }

    .flashsale-item {
        flex: 0 0 calc(50% - 8px);
        min-width: 150px;
        max-width: calc(50% - 8px);
    }

    .flashsale-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .flashsale-header {
        flex-direction: column;
        padding: 10px 12px;
        gap: 6px;
    }

    .flashsale-header-content {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }

    .flashsale-brand {
        gap: 8px;
    }

    .flashsale-logo {
        width: 28px;
        height: 28px;
    }

    .flashsale-logo i {
        font-size: 0.85rem;
    }

    .flashsale-title {
        font-size: 0.95rem;
    }

    .flashsale-subtitle {
        font-size: 0.6rem;
    }

    .flashsale-timer {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 6px;
        background: rgba(0, 0, 0, 0.15);
        padding: 6px 10px;
        border-radius: 6px;
    }

    .timer-label {
        font-size: 0.7rem;
        margin-right: 4px;
    }

    .timer-countdown {
        gap: 3px;
    }

    .timer-block {
        padding: 2px 6px;
        min-width: 28px;
        border-radius: 4px;
    }

    .timer-number {
        font-size: 0.8rem;
    }

    .timer-text {
        display: none;
    }

    .timer-colon {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .flashsale-viewall {
        width: 100%;
        justify-content: center;
    }

    .flashsale-carousel-wrapper {
        padding: 10px 12px;
    }

    .flashsale-carousel {
        gap: 10px;
        scroll-padding-left: 12px;
        scroll-padding-right: 12px;
        padding-right: 12px;
    }

    .flashsale-item {
        flex: 0 0 calc(50% - 6px);
        min-width: 140px;
        max-width: calc(50% - 6px);
    }

    .flashsale-card {
        border-radius: 10px;
    }

    .flashsale-card-image {
        border-radius: 6px;
    }

    .flashsale-card-content {
        padding: 8px;
        gap: 3px;
    }

    .flashsale-card-name {
        font-size: 0.75rem;
        min-height: 2em;
    }

    .flashsale-price-new {
        font-size: 0.9rem;
    }

    .flashsale-price-old {
        font-size: 0.65rem;
    }

    .flashsale-stock-bar {
        height: 12px;
        border-radius: 6px;
    }

    .flashsale-stock-fill {
        border-radius: 6px;
    }

    .flashsale-stock-text {
        font-size: 0.6rem;
    }

    .meta-sold {
        font-size: 0.62rem;
    }

    .meta-delivery {
        font-size: 0.62rem;
    }

    .meta-delivery i {
        font-size: 0.55rem;
    }
}

/* ============================================
   DARK MODE
   ============================================ */

[data-theme="dark"] .flashsale-section {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 50%, #450a0a 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .flashsale-carousel-wrapper {
    background: var(--bg-body);
}

[data-theme="dark"] .flashsale-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .flashsale-card:hover {
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .flashsale-card-image {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .flashsale-card-name {
    color: var(--text-primary);
}

[data-theme="dark"] .flashsale-card:hover .flashsale-card-name {
    color: #f87171;
}

[data-theme="dark"] .flashsale-price-new {
    color: #f87171;
}

[data-theme="dark"] .flashsale-price-old {
    color: #6b7280;
}

[data-theme="dark"] .flashsale-stock-bar {
    background: rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .flashsale-stock-text {
    color: #f87171;
}

[data-theme="dark"] .flashsale-meta {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .meta-sold {
    color: var(--text-muted);
}

[data-theme="dark"] .meta-delivery {
    color: var(--text-muted);
}

[data-theme="dark"] .meta-delivery.instant {
    color: #34d399;
}

[data-theme="dark"] .flashsale-nav {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .flashsale-nav:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

[data-theme="dark"] .flashsale-image-placeholder {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ============================================
   AUTOREG HOMEPAGE ADAPTATION
   ============================================ */

.storefront-autoreg-home .autoreg-flash-sale,
.autoreg-flash-sale {
    --flashsale-accent: #84f146;
    --flashsale-accent-soft: rgba(132, 241, 70, 0.18);
    --flashsale-text: #111315;
    --flashsale-muted: #8a8f98;
    --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;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-header,
.autoreg-flash-sale .flashsale-header {
    align-items: center;
    background: transparent !important;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 0 24px;
    padding: 0 !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-header-content,
.autoreg-flash-sale .flashsale-header-content {
    display: block;
    min-width: 0;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-brand,
.autoreg-flash-sale .flashsale-brand {
    align-items: flex-start;
    display: flex;
    gap: 10px;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-logo,
.autoreg-flash-sale .flashsale-logo {
    animation: none !important;
    background: #fff3dd !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    color: #f59e0b;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 46px !important;
    margin-top: 0;
    width: 46px !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-logo i,
.autoreg-flash-sale .flashsale-logo i {
    color: #f59e0b !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-title-group,
.autoreg-flash-sale .flashsale-title-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-title,
.autoreg-flash-sale .flashsale-title {
    color: var(--flashsale-text) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.08 !important;
    margin: 0 !important;
    text-shadow: none !important;
    text-transform: none !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-subtitle,
.autoreg-flash-sale .flashsale-subtitle {
    color: var(--flashsale-muted) !important;
    display: block;
    font-size: 13px !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    max-width: 760px;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-timer,
.autoreg-flash-sale .flashsale-timer {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex;
    gap: 12px;
    min-height: 66px;
    padding: 9px 12px;
    white-space: nowrap;
}

.storefront-autoreg-home .autoreg-flash-sale .timer-label,
.autoreg-flash-sale .timer-label {
    color: #5f6670 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    max-width: 124px;
    min-width: 116px;
}

.storefront-autoreg-home .autoreg-flash-sale .timer-countdown,
.autoreg-flash-sale .timer-countdown {
    gap: 7px;
}

.storefront-autoreg-home .autoreg-flash-sale .timer-block,
.autoreg-flash-sale .timer-block {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 48px;
    min-width: 76px !important;
    padding: 7px 9px !important;
}

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

.storefront-autoreg-home .autoreg-flash-sale .timer-text,
.autoreg-flash-sale .timer-text {
    color: #858c96 !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    margin-top: 5px !important;
    min-height: 12px;
    text-transform: none !important;
}

.storefront-autoreg-home .autoreg-flash-sale .timer-colon,
.autoreg-flash-sale .timer-colon {
    animation: none !important;
    color: #111315 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    margin: 0 !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-carousel-wrapper,
.autoreg-flash-sale .flashsale-carousel-wrapper {
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-carousel,
.autoreg-flash-sale .flashsale-carousel {
    display: grid !important;
    gap: 18px !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible !important;
    padding: 0 !important;
    scroll-behavior: auto !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-item,
.autoreg-flash-sale .flashsale-item {
    flex: none !important;
    max-width: none !important;
    min-width: 0 !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-item.is-hidden,
.autoreg-flash-sale .flashsale-item.is-hidden {
    display: none !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-item.flashsale-item-reveal,
.autoreg-flash-sale .flashsale-item.flashsale-item-reveal {
    animation: flashsaleCardReveal 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--flashsale-reveal-index, 0) * 42ms);
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-nav,
.autoreg-flash-sale .flashsale-nav {
    display: none !important;
}

.storefront-autoreg-home .autoreg-flash-sale .product-card,
.autoreg-flash-sale .product-card {
    min-height: 100%;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-load-more,
.autoreg-flash-sale .flashsale-load-more {
    margin-top: 24px;
}

.storefront-autoreg-home .autoreg-flash-sale .t-digit-group,
.autoreg-flash-sale .t-digit-group {
    align-items: baseline;
    display: inline-flex;
    justify-content: center;
    width: 2ch;
}

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

.storefront-autoreg-home .autoreg-flash-sale .t-digit-group.is-animating .t-digit,
.autoreg-flash-sale .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);
    }
}

.storefront-autoreg-home .autoreg-flash-sale .product-discount-badge,
.autoreg-flash-sale .product-discount-badge {
    align-items: center;
    background: linear-gradient(135deg, #ff5a5a, #e11d1d) !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 18px rgba(225, 29, 29, 0.32) !important;
    color: #fff !important;
    display: inline-flex;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    min-height: 24px;
    padding: 5px 10px !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
}

.storefront-autoreg-home .autoreg-flash-sale .product-card-image .product-discount-badge,
.autoreg-flash-sale .product-card-image .product-discount-badge {
    position: absolute !important;
    top: -10px !important;
    left: -10px !important;
    z-index: 4;
}

@media (max-width: 767px) {
    .storefront-autoreg-home .autoreg-flash-sale .product-card-image .product-discount-badge,
    .autoreg-flash-sale .product-card-image .product-discount-badge {
        top: 8px !important;
        left: 8px !important;
    }
}

.storefront-autoreg-home .autoreg-flash-sale .product-discount-badge::before,
.autoreg-flash-sale .product-discount-badge::before {
    content: none !important;
    display: none !important;
}

@keyframes flashsaleCardReveal {
    from {
        filter: blur(4px);
        opacity: 0;
        transform: translateY(12px);
    }

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

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale,
[data-theme="dark"] .autoreg-flash-sale {
    --flashsale-text: #f4f7f2;
    --flashsale-muted: rgba(244, 247, 242, 0.72);
}

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .flashsale-timer,
[data-theme="dark"] .autoreg-flash-sale .flashsale-timer {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .timer-label,
[data-theme="dark"] .autoreg-flash-sale .timer-label {
    color: rgba(244, 247, 242, 0.76) !important;
}

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .timer-block,
[data-theme="dark"] .autoreg-flash-sale .timer-block {
    background: transparent !important;
}

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .timer-number,
[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .timer-colon,
[data-theme="dark"] .autoreg-flash-sale .timer-number,
[data-theme="dark"] .autoreg-flash-sale .timer-colon {
    color: #f4f7f2 !important;
}

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .timer-text,
[data-theme="dark"] .autoreg-flash-sale .timer-text {
    color: rgba(244, 247, 242, 0.58) !important;
}

@media (max-width: 1199px) {
    .storefront-autoreg-home .autoreg-flash-sale .flashsale-carousel,
    .autoreg-flash-sale .flashsale-carousel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .storefront-autoreg-home .autoreg-flash-sale .flashsale-header,
    .autoreg-flash-sale .flashsale-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .storefront-autoreg-home .autoreg-flash-sale .flashsale-carousel,
    .autoreg-flash-sale .flashsale-carousel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .storefront-autoreg-home .autoreg-flash-sale,
    .autoreg-flash-sale {
        margin-top: 36px !important;
    }

    .storefront-autoreg-home .autoreg-flash-sale .flashsale-brand,
    .autoreg-flash-sale .flashsale-brand {
        gap: 12px;
    }

    .storefront-autoreg-home .autoreg-flash-sale .flashsale-title,
    .autoreg-flash-sale .flashsale-title {
        font-size: 20px !important;
    }

    .storefront-autoreg-home .autoreg-flash-sale .flashsale-subtitle,
    .autoreg-flash-sale .flashsale-subtitle {
        font-size: 13px !important;
    }

    .storefront-autoreg-home .autoreg-flash-sale .flashsale-timer,
    .autoreg-flash-sale .flashsale-timer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .storefront-autoreg-home .autoreg-flash-sale .timer-countdown,
    .autoreg-flash-sale .timer-countdown {
        justify-content: center;
        width: 100%;
    }

    .storefront-autoreg-home .autoreg-flash-sale .timer-block,
    .autoreg-flash-sale .timer-block {
        align-items: center;
        flex: 1;
        justify-content: center;
        min-width: 0 !important;
        text-align: center;
    }

    .storefront-autoreg-home .autoreg-flash-sale .timer-number,
    .autoreg-flash-sale .timer-number {
        justify-content: center;
        margin: 0 auto;
        min-width: 0;
        text-align: center;
        width: 100%;
    }

    .storefront-autoreg-home .autoreg-flash-sale .t-digit-group,
    .autoreg-flash-sale .t-digit-group {
        margin: 0 auto;
    }

    .storefront-autoreg-home .autoreg-flash-sale .flashsale-carousel,
    .autoreg-flash-sale .flashsale-carousel {
        gap: 18px !important;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .storefront-autoreg-home .autoreg-flash-sale .timer-digit,
    .autoreg-flash-sale .timer-digit,
    .storefront-autoreg-home .autoreg-flash-sale .t-digit,
    .autoreg-flash-sale .t-digit,
    .storefront-autoreg-home .autoreg-flash-sale .flashsale-item.flashsale-item-reveal,
    .autoreg-flash-sale .flashsale-item.flashsale-item-reveal {
        animation: none !important;
    }
}

/* ============================================
   FLASH SALE TIMER — DARK CAPSULES (homepage)
   Dark rounded plates, Archivo Black digits,
   two-dot colons, urgent (red seconds) state.
   Scale matches the homepage: plate 44px / digit 20px.
   ============================================ */

.storefront-autoreg-home .autoreg-flash-sale .flashsale-timer,
.autoreg-flash-sale .flashsale-timer {
    align-items: flex-start !important;
    gap: 11px !important;
    min-height: 0 !important;
    padding: 0 !important;
}

/* "ENDS IN" — plain muted label, vertically centred on the plate row */
.storefront-autoreg-home .autoreg-flash-sale .timer-label,
.autoreg-flash-sale .timer-label {
    align-items: center;
    color: #8a8f98 !important;
    display: inline-flex;
    font-size: 10px !important;
    font-weight: 700 !important;
    height: 44px;
    letter-spacing: 0.05em !important;
    max-width: none;
    min-width: 0;
    text-transform: uppercase;
}

.storefront-autoreg-home .autoreg-flash-sale .timer-countdown,
.autoreg-flash-sale .timer-countdown {
    align-items: flex-start !important;
    gap: 7px !important;
}

/* Cell: plate + label below, hugging the plate width */
.storefront-autoreg-home .autoreg-flash-sale .timer-block,
.autoreg-flash-sale .timer-block {
    align-items: center;
    gap: 7px;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
}

/* The number element becomes the dark capsule */
.storefront-autoreg-home .autoreg-flash-sale .timer-number,
.autoreg-flash-sale .timer-number {
    background: #16181d !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 14px rgba(20, 24, 29, 0.16);
    color: #fff !important;
    font-family: 'Archivo Black', Montserrat, sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    height: 44px !important;
    min-height: 44px;
    min-width: 52px !important;
    padding: 0 8px !important;
    transition: color 0.3s;
    width: auto !important;
}

/* Label below the plate */
.storefront-autoreg-home .autoreg-flash-sale .timer-text,
.autoreg-flash-sale .timer-text {
    color: #8a8f98 !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    margin-top: 0 !important;
    transition: color 0.3s;
    text-transform: uppercase !important;
}

/* Colon → two stacked dots, centred against the plate */
.storefront-autoreg-home .autoreg-flash-sale .timer-colon,
.autoreg-flash-sale .timer-colon {
    align-self: flex-start;
    color: transparent !important;
    display: flex;
    flex-direction: column;
    font-size: 0 !important;
    gap: 4px;
    height: 44px !important;
    justify-content: center;
    margin: 0 1px !important;
}

.storefront-autoreg-home .autoreg-flash-sale .timer-colon::before,
.storefront-autoreg-home .autoreg-flash-sale .timer-colon::after,
.autoreg-flash-sale .timer-colon::before,
.autoreg-flash-sale .timer-colon::after {
    background: #c9ccd1;
    border-radius: 50%;
    content: "";
    display: block;
    height: 4px;
    transition: background 0.3s;
    width: 4px;
}

/* Urgent (remaining <= 5h): only seconds, its label and the dots turn red */
.storefront-autoreg-home .autoreg-flash-sale .flashsale-timer.is-urgent .timer-colon::before,
.storefront-autoreg-home .autoreg-flash-sale .flashsale-timer.is-urgent .timer-colon::after,
.autoreg-flash-sale .flashsale-timer.is-urgent .timer-colon::before,
.autoreg-flash-sale .flashsale-timer.is-urgent .timer-colon::after {
    background: #ff3b3b;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-timer.is-urgent #countdownSeconds,
.autoreg-flash-sale .flashsale-timer.is-urgent #countdownSeconds {
    animation: flashsaleSecPulse 1.1s ease-in-out infinite;
    color: #ff5a5a !important;
}

.storefront-autoreg-home .autoreg-flash-sale .flashsale-timer.is-urgent #countdownSecondsLabel,
.autoreg-flash-sale .flashsale-timer.is-urgent #countdownSecondsLabel {
    color: #e11d1d !important;
}

@keyframes flashsaleSecPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Dark theme: keep capsules dark with light digits */
[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .timer-number,
[data-theme="dark"] .autoreg-flash-sale .timer-number {
    background: #0b0d11 !important;
    color: #fff !important;
}

[data-theme="dark"] .storefront-autoreg-home .autoreg-flash-sale .flashsale-timer.is-urgent #countdownSeconds,
[data-theme="dark"] .autoreg-flash-sale .flashsale-timer.is-urgent #countdownSeconds {
    color: #ff5a5a !important;
}

@media (prefers-reduced-motion: reduce) {
    .storefront-autoreg-home .autoreg-flash-sale .flashsale-timer.is-urgent #countdownSeconds,
    .autoreg-flash-sale .flashsale-timer.is-urgent #countdownSeconds {
        animation: none !important;
    }
}
