/* Product Promotion Section - Grid 2x2 on Mobile, Scroll on Tablet/Desktop */

/* Desktop & Large Screens */
.product-promotion {
    /* padding: 12px 240px 12px 240px; */
    padding: 12px 24px 12px;
    background: #F3F3F3;
}

.promotion-container {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 1440px;
    margin: 0 auto;
}

.promotion-title {
    font-family: 'SF Pro', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 40px;
    color: #3D3D3D;
    text-align: center;
    margin: 0;
}

.promotion-content {
    display: flex;
    gap: 18px;
    width: 100%;
    /* padding: 8px 0 16px 0; */
    padding: 0px 0 0px 0;
    overflow: visible;
}

/* Banner */
.promotion-banner {
    width: 318px;
    min-height: 421px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    align-self: stretch;
    background: #F5F5F5;
}

.promotion-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Products Grid - Display all 4 items evenly across width */
.promotion-products {
    flex: 1;
    display: flex;
    gap: 16px;
    overflow: visible;
}

/* Promotion Product Card - Separate from Showcase Card */
.promotion-products-card {
    flex: 1;
    min-width: 0;
    background: #FFFFFF;
    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);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.promotion-products-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 8px 8px -8px rgba(0, 0, 0, 0.12),
                0px 8px 24px 12px rgba(16, 24, 40, 0.04),
                0px 4px 40px -4px rgba(16, 24, 40, 0.06);
    z-index: 10;
}

/* Promotion Card Image - Override showcase styles */
.promotion-products-card .product-image {
    width: 100%;
    min-height: unset !important;
    max-height: 244px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.promotion-products-card .product-image > img:not(.badge-almost-soldout) {
    width: 100%;
    min-height: unset !important;
    max-height: 244px;
    object-fit: cover;
    object-position: 50% 50%;
    aspect-ratio: 1 / 1.1;
}

/* Product Image Features - Desktop & Tablet: Icon 20x20px, Font 9px */
.promotion-products-card .product-image-features {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.promotion-products-card .feature-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 8px;
    padding: 6px 4px;
    gap: 2px;
}

.promotion-products-card .feature-icon-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.promotion-products-card .feature-icon-item span {
    font-family: 'SF Pro', sans-serif;
    font-size: 9px;
    font-weight: 400;
    line-height: 1.2;
    color: #3D3D3D;
    text-align: center;
    max-width: 50px;
    word-break: break-word;
}

/* Almost Soldout Badge for Promotion Cards - Desktop & Tablet: 52x52px */
.promotion-products-card .badge-almost-soldout {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 52px;
    height: 52px;
    object-fit: contain;
    z-index: 10;
    display: block; /* Always show when element exists */
}

/* Promotion Card Info */
.promotion-products-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 16px;
    justify-content: space-between;
    overflow: visible;
}

.promotion-products-card .product-title {
    font-family: 'SF Pro', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    color: #3D3D3D;
    margin: 0;
    padding: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.promotion-products-card .price-amount {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    color: #4564ED;
}

/* .promotion-products-card .btn-buy {
    background: #4564ED;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 410;
    line-height: 20px;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    display: block;
    text-decoration: none;
} */

/* .promotion-products-card .btn-buy:hover {
    background: #3550d8;
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px 0px rgba(69, 100, 237, 0.3);
} */

.promotion-products .promotion-products-card {
    flex: 1;
    min-width: 0;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

/* iPad mini (768-900px): Same layout as showcase - Banner left, cards scroll right */
@media (min-width: 768px) and (max-width: 900px) {
    .product-promotion {
        /* padding: 24px 0 12px 0; */
        padding: 24px 16px 12px;
    }

    .promotion-container {
        /* background: transparent; */
        /* border-radius: 0; */
        /* padding: 0; */
        padding: 16px;
        gap: 20px;
    }

    .promotion-title {
        font-size: 22px;
        line-height: 30px;
        padding: 0 20px;
    }

    .promotion-content {
        display: flex !important;
        flex-direction: row !important;
        gap: 16px;
        /* padding: 0 0 0 20px; */
    }

    .promotion-banner {
        /* width: 260px; */
        flex-shrink: 0;
        align-self: stretch;
    }

    /* Products scroll horizontal - Same as showcase */
    .promotion-products {
        flex: 1;
        display: flex !important;
        grid-template-columns: none !important;
        /* overflow-x: auto;
        overflow-y: visible; */
        gap: 16px;
        flex-wrap: nowrap !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        
    }

    .promotion-products::-webkit-scrollbar {
        height: 6px;
    }

    .promotion-products::-webkit-scrollbar-track {
        background: transparent;
    }

    .promotion-products::-webkit-scrollbar-thumb {
        background: #D1D1D1;
        border-radius: 3px;
    }

    .promotion-products::-webkit-scrollbar-thumb:hover {
        background: #B0B0B0;
    }

    .promotion-products .promotion-products-card {
        flex: 0 0 240px !important;
        width: 240px !important;
    }

    .promotion-products-card .product-title {
        font-size: 15px;
    }

    .promotion-products-card .price-amount {
        font-size: 20px;
    }

    .promotion-products-card .product-info {
        padding: 12px;
    }

    /* Product Image Features - Tablet: Icon 20x20px */
    .promotion-products-card .product-image-features {
        right: 6px;
    }
}

@media (min-width: 768px) and (max-width: 1440px) {

    .promotion-products {
        overflow: hidden;
    }
}

/* iPad Landscape (11" and 10.9") */
@media (min-width: 835px) and (max-width: 1194px) {
    .product-promotion {
        /* padding: 12px 50px 12px0px 50px; */
        padding: 12px 24px 12px;
    }
}

/* iPad Pro & Tablet (901-1366px): Horizontal Scroll with Banner */
@media (min-width: 901px) and (max-width: 1440px) {
    .product-promotion {
        /* padding: 12px 60px 12px 60px; */
        padding: 12px 24px 12px;
    }

    .promotion-container {
        /* padding: 20px; */
        padding: 24px;
        gap: 20px;
    }

    .promotion-content {
        display: flex !important;
        flex-direction: row !important;
        gap: 18px;
    }

    .promotion-banner {
        /* width: 280px; */
        flex-shrink: 0;
        align-self: stretch;
    }

    /* Swiper for horizontal scroll */
    .swiper-promotion-products {
        flex: 1;
        display: flex !important;
        /* overflow-x: auto;
        overflow-y: visible; */
        gap: 16px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #D1D1D1 transparent;
    }

    .swiper-promotion-products::-webkit-scrollbar {
        height: 6px;
    }

    .swiper-promotion-products::-webkit-scrollbar-track {
        background: transparent;
    }

    .swiper-promotion-products::-webkit-scrollbar-thumb {
        background: #D1D1D1;
        border-radius: 3px;
    }

    .swiper-promotion-products::-webkit-scrollbar-thumb:hover {
        background: #B0B0B0;
    }

    .swiper-showcase-products .swiper-slide {
        /* flex: 0 0 260px !important;
        width: 260px !important; */
    }

    .promotion-products .promotion-products-card {
        /* flex: 0 0 260px !important;
        width: 260px !important; */
    }

    /* Product Image Features - Tablet: Icon 20x20px */
    .promotion-products-card .product-image-features {
        right: 6px;
    }
}

/* iPad Pro 12.9" and Medium Desktop */
@media (min-width: 1024px) and (max-width: 1440px) {
    .product-promotion {
        /* padding: 12px 60px 12px 60px; */
        padding: 12px 24px 12px;
    }

    .promotion-products-card {
        flex: 0 0 280px !important;
        width: 280px;
    }
}

/* Responsive Design */
@media (max-width: 1680px) {
    .product-promotion {
        /* padding: 12px 120px 12px 120px; */
        padding: 12px 24px 12px;
    }
}

@media (max-width: 1440px) {
    .product-promotion {
        /* padding: 12px 40px 12px 40px; */
        padding: 12px 16px 12px;
    }

    .promotion-content {
        gap: 16px;
    }

    .promotion-products {
        gap: 16px;
    }
}

@media (max-width: 1200px) {
    .product-promotion {
        /* padding: 12px 60px 12px 60px; */
    }

    .promotion-title {
        font-size: 24px;
        line-height: 32px;
    }
}

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

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

/* Mobile (≤767px): Grid 2x2 */
@media (max-width: 767px) {
    .product-promotion {
        /* padding: 0; */
        padding: 0px 16px;
    }

    .promotion-container {
        background: transparent;
        border-radius: 0;
        padding: 16px 0;
        gap: 16px;
        overflow: visible;
    }

    .promotion-title {
        font-size: 20px;
        line-height: 28px;
        padding: 0 16px;
    }

    .promotion-content {
        flex-direction: column;
        gap: 16px;
        /* padding: 0 16px; */
    }

    .promotion-banner {
        width: 100%;
        height: auto;
        /* height: 454px; */
        /* max-height: 454px; */
        max-height: unset;
        min-height: unset;
        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);
    }

    .promotion-banner img {
        position: relative;
        height: auto;
    }

    /* Grid 2x2 - Show only 4 items */
    .promotion-products {
        /* display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        overflow: visible; */
    }

    /* Show only first 4 items */
    .promotion-products .promotion-products-card:nth-child(-n+4) {
        display: block;
    }

    .promotion-products .promotion-products-card:nth-child(n+5) {
        display: none;
    }

    /* Adjust card styling for grid */
    .promotion-products .promotion-products-card {
        /* width: 100%; */
        /* height: auto; */
    }

    .promotion-products .promotion-products-card .product-image {
        min-height: unset !important;
        height: auto !important;
        max-height: 148px !important;
        overflow: hidden;
    }

    .promotion-products .promotion-products-card .product-image img:not(.badge-almost-soldout) {
        min-height: unset !important;
        height: auto !important;
        max-height: 148px;
        object-fit: cover;
    }

    /* Badge Almost Soldout - Mobile: 48x48px */
    .promotion-products .promotion-products-card .badge-almost-soldout {
        width: 48px;
        height: 48px;
    }

    /* Product Image Features - Mobile: Icon 16x16px, Font 9px */
    .promotion-products-card .product-image-features {
        right: 4px;
        gap: 0px;
    }

    .promotion-products-card .product-price-container {
        padding: 0;
    }

    .promotion-products-card .feature-icon-item {
        padding: 4px 3px;
        gap: 2px;
    }

    .promotion-products-card .feature-icon-item img {
        width: 16px;
        height: 16px;
    }

    .promotion-products-card .feature-icon-item span {
        font-size: 9px;
        max-width: 45px;
    }

    .promotion-products .promotion-products-card .product-info {
        padding: 0px 8px 8px 8px;
        gap: 6px;
    }

    .promotion-products .promotion-products-card .product-title {
        font-size: 14px;
        line-height: 20px;
        margin-top: 5px;
    }

    .promotion-products .promotion-products-card .price-amount {
        font-size: 20px;
        line-height: 1.15;
    }

    /* .promotion-products .promotion-products-card .btn-buy {
        font-size: 14px;
        font-weight: medium;
        padding: 8px 20px;
    } */

    .product-promotion .swiper-promotion-products {
        /* overflow: hidden; */
        /* margin: 0 -16px 0; */
        margin: 0;
    }

    .product-promotion .swiper-wrapper {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        overflow: visible;
    }

    .product-promotion .swiper-slide {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto;
    }

    .product-promotion .swiper-slide:first-child {
        /* margin-left: 16px; */
    }

    .product-promotion .swiper-slide:last-child {
        /* margin-right: 16px; */
    }
}

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