/* Flash Sale Compact Layout - Space-Efficient Modern Design */

.flash-sale-card.fs-compact {
    background: #fff;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
    border: 1px solid #e5e7eb;
}

.flash-sale-card.fs-compact:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Image wrapper with logo overlay - REDUCED SIZE */
.flash-sale-card.fs-compact .fs-img-wrapper {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3.5;
    overflow: visible;
    background: #f9fafb;
}

.flash-sale-card.fs-compact .fs-product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.flash-sale-card.fs-compact:hover .fs-product-img {
    transform: scale(1.05);
}

/* Brand logo overlay - top LEFT corner - FLOAT ABOVE IMAGE */
.fs-brand-logo-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: 53px;
    max-height: 35px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 7px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    object-fit: contain;
    z-index: 20 !important;
}

/* Discount badge - top RIGHT on image - FLOAT ABOVE IMAGE */
.fs-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    line-height: 1.2;
    z-index: 20 !important;
}

/* Card body - compact spacing */
.flash-sale-card.fs-compact .fs-card-body {
    padding: 10px;
    padding-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: visible;
}

/* Brand name - small, uppercase */
.fs-brand-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    margin: 0;
}

/* Product title - 2 lines max */
.fs-product-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

/* Subtitle - SKU / Type */
.fs-subtitle {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
    margin: 0;
}

/* Feature badges row - compact */
.fs-features-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}

.fs-feature-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.fs-feature-badge.fs-badge-ai {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: #fff;
    border-color: #9333ea;
    font-weight: 700;
}

.fs-feature-badge.fs-badge-installment {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border-color: #d97706;
}

/* Price section - compact */
.fs-price-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.fs-price-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 400;
}

.fs-price-main {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

/* Info row - warranty & shipping - SAME LINE */
.fs-info-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;
    align-items: center;
}

.fs-info-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
    white-space: nowrap;
}

.fs-info-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fs-info-icon svg {
    width: 100%;
    height: 100%;
    color: #10b981;
}

/* Online special note */
.fs-online-note {
    font-size: 10px;
    color: #ef4444;
    line-height: 1.3;
    margin: 4px 0;
    font-style: italic;
}

/* View count */
.fs-views-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    margin: 4px 0;
}

.fs-views-count svg {
    flex-shrink: 0;
}

/* Buy button - full width, prominent - ALWAYS VISIBLE - FORCE BLUE WITH WAVE */
.fs-buy-btn,
button.fs-buy-btn,
.flash-sale-card .fs-buy-btn {
    width: calc(100% - 4px) !important;
    background: linear-gradient(90deg, #3b82f6 0%, #1e40af 50%, #3b82f6 100%) !important;
    background-size: 200% 200% !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 10px 2px 0 2px !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.4) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    animation: flashWaveAnimation 2s ease-in-out infinite !important;
}

.fs-buy-btn:hover,
button.fs-buy-btn:hover,
.flash-sale-card .fs-buy-btn:hover {
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 50%, #1e40af 100%) !important;
    background-size: 200% 200% !important;
    box-shadow: 0 4px 8px rgba(30, 64, 175, 0.5) !important;
    transform: translateY(-1px) !important;
}

.fs-buy-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.4) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flash-sale-card.fs-compact .fs-card-body {
        padding: 10px;
        gap: 5px;
    }
    
    .fs-brand-title {
        font-size: 10px;
    }
    
    .fs-product-title {
        font-size: 13px;
        min-height: 2.6em;
    }
    
    .fs-features-row {
        gap: 3px;
        margin: 5px 0;
    }
    
    .fs-feature-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .fs-price-main {
        font-size: 20px;
    }
    
    .fs-price-old {
        font-size: 12px;
    }
    
    .fs-info-item {
        font-size: 10px;
    }
    
    .fs-buy-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .fs-brand-logo-overlay {
        max-width: 40px;
        max-height: 28px;
        top: 6px;
        right: 6px;
    }
    
    .fs-discount-badge {
        font-size: 12px;
        padding: 3px 8px;
        top: 6px;
        left: 6px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .flash-sale-card.fs-compact .fs-card-body {
        padding: 8px;
        gap: 4px;
    }
    
    .fs-product-title {
        font-size: 12px;
    }
    
    .fs-features-row {
        gap: 2px;
        margin: 4px 0;
    }
    
    .fs-feature-badge {
        font-size: 8px;
        padding: 2px 5px;
    }
    
    .fs-price-main {
        font-size: 18px;
    }
    
    .fs-buy-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}
/* =========================================
   FORCE BUTTON VISIBILITY - ปุ่มต้องแสดงเสมอ
   ========================================= */
.flash-sale-card.fs-compact {
    min-height: 480px !important;
    max-height: 520px !important;
    overflow: hidden !important;
}

.flash-sale-card.fs-compact .fs-img-wrapper {
    position: relative !important;
    overflow: visible !important;
}

.flash-sale-card.fs-compact .fs-card-body {
    overflow: hidden !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 260px !important;
}

/* จำกัดความสูงของเนื้อหาเพื่อให้ปุ่มอยู่ในการ์ด */
.flash-sale-card.fs-compact .fs-info-row {
    max-height: none !important;
    overflow: visible !important;
    min-height: 18px !important;
}

.flash-sale-card.fs-compact .fs-online-note {
    max-height: 15px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.flash-sale-card.fs-compact .fs-views-count {
    max-height: 18px !important;
    overflow: hidden !important;
}

.flash-sale-card.fs-compact .fs-buy-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    background: linear-gradient(90deg, #3b82f6 0%, #1e40af 50%, #3b82f6 100%) !important;
    background-size: 200% 200% !important;
    animation: flashWaveAnimation 2s ease-in-out infinite !important;
    color: #fff !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

.flash-sale-card.fs-compact .fs-buy-btn:hover {
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 50%, #1e40af 100%) !important;
    background-size: 200% 200% !important;
}

/* Parent containers - swiper needs overflow hidden on swiper itself */
.flash-sale-section {
    overflow: visible !important;
}

/* CRITICAL: Swiper MUST have overflow:hidden to work properly */
.flash-sale-section .swiper {
    overflow: hidden !important;
}

/* But slides can have visible overflow for badges */
.flash-sale-track,
.flash-sale-slide,
.swiper-slide:has(.flash-sale-card) {
    overflow: visible !important;
}

.swiper-slide:has(.flash-sale-card) {
    min-height: 540px !important;
    max-height: 560px !important;
}

/* =========================================
   WAVE ANIMATION FOR FLASH SALE BUTTONS
   ========================================= */
@keyframes flashWaveAnimation {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

/* =========================================
   FORCE ALL FLASH SALE BUTTONS TO BLUE
   ========================================= */
.fs-buy-btn,
.flash-sale-card .fs-buy-btn,
.flash-sale-section .fs-buy-btn,
.flash-product-card .fsc-buy-btn,
.flash-sale-buy-btn,
.fs-action,
button.fs-buy-btn,
a.fs-buy-btn {
    background: linear-gradient(90deg, #3b82f6 0%, #1e40af 50%, #3b82f6 100%) !important;
    background-size: 200% 200% !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.4) !important;
    animation: flashWaveAnimation 2s ease-in-out infinite !important;
}

/* Orange Button for Flash Sale */
.fs-orange-btn {
    background: linear-gradient(90deg, #ff8c00 0%, #ff6b00 50%, #ff8c00 100%) !important;
    background-size: 200% 200% !important;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4) !important;
    animation: flashWaveAnimation 2s ease-in-out infinite !important;
}

.fs-buy-btn:hover,
.flash-sale-card .fs-buy-btn:hover,
.flash-sale-section .fs-buy-btn:hover,
.flash-product-card .fsc-buy-btn:hover,
.flash-sale-buy-btn:hover,
.fs-action:hover,
button.fs-buy-btn:hover,
a.fs-buy-btn:hover {
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 50%, #1e40af 100%) !important;
    background-size: 200% 200% !important;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.5) !important;
}

/* =========================================
   FORCE BADGES & LOGOS FLOAT ABOVE IMAGE
   ========================================= */
.flash-sale-card .fs-img-wrapper,
.flash-sale-section .fs-img-wrapper {
    overflow: visible !important;
}

.flash-sale-card .fs-brand-logo-overlay,
.flash-sale-section .fs-brand-logo-overlay,
.fs-brand-logo-overlay {
    z-index: 30 !important;
    position: absolute !important;
}

.flash-sale-card .fs-discount-badge,
.flash-sale-section .fs-discount-badge,
.fs-discount-badge {
    z-index: 30 !important;
    position: absolute !important;
}

/* NEW Badge overlay */
.flash-sale-card .advice-badge-new {
    background: #ff3333 !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 5px 9px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 6px rgba(255, 51, 51, 0.4) !important;
    z-index: 25 !important;
    position: absolute !important;
}

.flash-sale-card .promo-ribbon,
.flash-sale-card [class*="badge"],
.flash-sale-section .advice-badge-new,
.flash-sale-section .promo-ribbon {
    z-index: 25 !important;
    position: absolute !important;
}