/* Product Showcase Mobile CSS - Based on Figma Design */
/* Two display modes:
   - product-showcase-scroll: horizontal scroll (first section)
   - product-showcase-grid: 2-column grid (remaining sections)
*/

@media (max-width: 768px) {
    .product-showcase {
        padding: 0 !important;
    }

    .showcase-container {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 16px !important;
        gap: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .showcase-content {
        width: 100% !important;
    }

    .showcase-title {
        font-size: 20px;
        line-height: 28px;
        font-weight: 700;
        text-align: center;
    }

    /* Mobile: Reverse layout - Cards on top, Banner on bottom */
    .showcase-content {
        flex-direction: column-reverse;
        gap: 16px;
    }

    /* Banner takes full width at bottom */
    .showcase-banner {
        width: 100%;
        height: 454px;
        border-radius: 12px;
        box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08),
                    0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                    0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    }

    .showcase-banner img {
        border-radius: 12px;
    }

    /* ===========================================
       SCROLL MODE: First section - horizontal scroll
       =========================================== */
    .product-showcase-scroll .swiper-showcase-products {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: -16px !important;
        margin-right: -16px !important;
        display: block !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .product-showcase-scroll .swiper-showcase-products::-webkit-scrollbar {
        display: none !important;
    }

    .product-showcase-scroll .swiper-showcase-products .swiper-wrapper {
        display: flex !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        padding: 0 16px !important;
        width: auto !important;
    }

    .product-showcase-scroll .swiper-showcase-products .swiper-slide {
        flex: 0 0 auto !important;
        width: 253px !important;
    }

    /* ===========================================
       GRID MODE: Remaining sections - 2 column grid
       Disable Swiper, use pure CSS Grid for full width
       =========================================== */
    .product-showcase-grid .swiper-showcase-products {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: -16px !important;
        margin-right: -16px !important;
        padding: 0 16px !important;
        display: block !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    .product-showcase-grid .swiper-showcase-products .swiper-wrapper {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .product-showcase-grid .swiper-showcase-products .swiper-slide {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Product cards - wider and shorter for grid mode */
    .product-showcase-grid .product-showcase-card {
        flex-basis: auto;
        width: 100%;
        min-height: auto;
        height: auto;
        border-radius: 12px;
        box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08),
                    0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                    0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    }

    /* Product cards for scroll mode - original height */
    .product-showcase-scroll .product-showcase-card {
        flex-basis: auto;
        width: 100%;
        min-height: 421px;
        height: auto;
        border-radius: 12px;
        box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08),
                    0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                    0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    }

    /* Product image aspect ratio - shorter for grid */
    .product-showcase-grid .product-showcase-card .product-image {
        width: 100%;
        height: auto;
    }

    .product-showcase-grid .product-showcase-card .product-image img:not(.badge-almost-soldout) {
        width: 100%;
        aspect-ratio: 1 / 1.2;
        object-fit: cover;
        object-position: 50% 50%;
    }

    /* Product image for scroll mode */
    .product-showcase-scroll .product-showcase-card .product-image {
        width: 100%;
    }

    .product-showcase-scroll .product-showcase-card .product-image img {
        width: 100%;
        aspect-ratio: 1026 / 900;
        object-fit: cover;
    }

    /* Product info padding - compact for grid */
    .product-showcase-grid .product-showcase-card .product-info {
        padding: 6px 8px 8px 8px;
        gap: 6px;
    }

    .product-showcase-grid .product-showcase-card .product-price-container {
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Product info for scroll mode */
    .product-showcase-scroll .product-showcase-card .product-info {
        padding: 8px 16px 16px 16px;
        gap: 10px;
    }

    .product-showcase-scroll .product-showcase-card .product-price-container {
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Hide extra cards for GRID mode only (show first 2) */
    .product-showcase-grid .swiper-showcase-products .swiper-slide:nth-child(n+3) {
        display: none !important;
    }

    /* SCROLL mode shows all cards */
    .product-showcase-scroll .swiper-showcase-products .swiper-slide {
        display: block !important;
    }

    /* Product title - smaller for grid */
    .product-showcase-grid .product-showcase-card .product-title {
        font-size: 14px;
        line-height: 20px;
        font-weight: 700;
    }

    .product-showcase-scroll .product-showcase-card .product-title {
        font-size: 18px;
        line-height: 24px;
        font-weight: 700;
    }

    /* Price - smaller for grid */
    .product-showcase-grid .product-showcase-card .price-amount {
        font-size: 20px;
        line-height: 28px;
        font-weight: 700;
    }

    .product-showcase-scroll .product-showcase-card .price-amount {
        font-size: 24px;
        line-height: 32px;
        font-weight: 700;
    }

    /* Features list - 12px Regular */
    .product-showcase-card .product-features {
        font-size: 12px;
        line-height: 16px;
    }

    /* Buy button - smaller for grid */
    .product-showcase-grid .product-showcase-card .btn-buy {
        font-size: 14px;
        line-height: 20px;
        font-weight: 510;
        padding: 8px 20px;
    }

    .product-showcase-scroll .product-showcase-card .btn-buy {
        font-size: 14px;
        line-height: 20px;
        font-weight: 510;
        padding: 10px 20px;
    }

    /* View all link */
    .showcase-view-all {
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .showcase-title {
        font-size: 20px;
        line-height: 28px;
    }
}
