/* Flash Sale Carousel Animation - JS Controlled */
/* Animation is handled by JavaScript for better drag/scroll support */

/* ===== CRITICAL: ENABLE SWIPER MOUSE DRAG ===== */
/* Force pointer events for ALL Swiper elements */
/* FIXED: Changed touch-action from pan-y to manipulation for horizontal swipe */
.swiper,
.swiper-wrapper,
.swiper-slide,
.flash-sale-carousel-container .swiper,
.flash-sale-carousel-container .swiper-wrapper,
.flash-sale-carousel-container .swiper-slide,
section[class*="flash-sale"] .swiper,
section[class*="flash-sale"] .swiper-wrapper,
section[class*="flash-sale"] .swiper-slide {
    pointer-events: auto !important;
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: manipulation !important;
    -webkit-touch-callout: none !important;
}

/* When actively dragging */
.swiper-wrapper.swiper-wrapper-dragging,
.swiper.swiper-dragging {
    cursor: grabbing !important;
}

/* Ensure cards inside slides are also interactive */
.swiper-slide .flash-sale-card,
.swiper-slide > * {
    pointer-events: auto !important;
}

/* Force flex layout for products */
.flash-sale-section.fs-modern .flash-sale-products {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 1rem !important;
    width: max-content !important;
    max-width: none !important;
    /* NO CSS animation - JS controls this */
    transition: transform 0.1s ease-out !important;
    /* Enable drag cursor */
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
}

/* When dragging */
.flash-sale-section.fs-modern .flash-sale-products.is-dragging {
    cursor: grabbing !important;
    transition: none !important;
}

/* Wrapper */
.flash-sale-section.fs-modern .flash-sale-products-wrapper {
    overflow: hidden !important;
    width: 100% !important;
    position: relative !important;
    padding-bottom: 20px !important;
}

/* Force section - allow badge overflow but contain carousel */
.flash-sale-section.fs-modern {
    overflow: visible !important;
    position: relative !important;
}

/* CRITICAL: Swiper container MUST be overflow:hidden */
.flash-sale-section.fs-modern .flash-sale-carousel-container {
    overflow: hidden !important;
    position: relative !important;
}

.flash-sale-section.fs-modern .swiper {
    overflow: hidden !important;
}

/* ===== SWIPER SLIDE SIZES - Let Swiper handle it ===== */
.flash-sale-section .swiper-slide {
    height: 520px !important;
    min-height: 520px !important;
}

.flash-sale-section .swiper-slide .flash-sale-card {
    height: 100% !important;
    min-height: 500px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 1rem !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    overflow: visible !important;
}

/* Card inner elements */
.flash-sale-section .flash-sale-card .fs-image-wrapper {
    flex: 0 0 auto !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
}

.flash-sale-section .flash-sale-card .fs-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.flash-sale-section .flash-sale-card .fs-info {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0.5rem 0 !important;
}

.flash-sale-section .flash-sale-card .fs-title {
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
    height: auto !important;
    max-height: 2.6rem !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

/* Remove fixed card sizes - let Swiper handle responsive sizing */

/* Override any grid settings */
.flash-sale-section.fs-modern .flash-sale-products {
    grid-template-columns: unset !important;
    grid-auto-flow: unset !important;
    display: flex !important;
}

/* Wrapper must be relative for absolute positioned buttons */
.flash-sale-products-wrapper,
.fs-products-wrapper,
[class*="products-wrapper"] {
    position: relative !important;
}

/* ===== NAVIGATION ARROWS ===== */
.flash-sale-nav-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #e5e7eb !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    opacity: 0.9 !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent !important;
}

.flash-sale-nav-btn:hover {
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-50%) scale(1.1) !important;
    opacity: 1 !important;
}

.flash-sale-nav-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.flash-sale-nav-btn.prev {
    left: 10px !important;
}

.flash-sale-nav-btn.next {
    right: 10px !important;
}

.flash-sale-nav-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: #374151 !important;
}

.flash-sale-nav-btn:hover svg {
    fill: #0ea5e9 !important;
}

/* Mobile - smaller buttons */
@media (max-width: 768px) {
    .flash-sale-nav-btn {
        width: 40px !important;
        height: 40px !important;
    }
    .flash-sale-nav-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    .flash-sale-nav-btn.prev {
        left: 5px !important;
    }
    .flash-sale-nav-btn.next {
        right: 5px !important;
    }
}