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

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

.promotion-container {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    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%;
}

/* Banner */
.promotion-banner {
    width: 318px;
    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: 18px;
    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;
    height: 202px;
    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;
    height: 202px;
    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;
}

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

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

    .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;
    }
}

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

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

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

    .promotion-banner {
        width: 280px;
        flex-shrink: 0;
        height: auto;
    }

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

    .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 260px !important;
        width: 260px !important;
    }

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

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

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

    .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: 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);
    }

    /* 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: 8px;
    }

    .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;
    }

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

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

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