/* Product Showcase CSS - Exact measurements from Figma Design */
/* Reusable component for product showcases with banner and cards */

/* Product Showcase Section */
.product-showcase {
    padding: 12px 240px 12px 240px;
    background: #F3F3F3;
}

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

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

/* Showcase Content */
.showcase-content {
    display: flex;
    gap: 18px;
    width: 100%;
    padding-bottom: 16px;
    overflow: visible;
}

/* Left Banner */
.showcase-banner {
    width: 318px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    align-self: stretch;
}

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

/* Right Product Cards */
.showcase-products {
    flex: 1;
    display: flex;
    gap: 18px;
    overflow: visible;
}

/* Product Showcase Card */
.product-showcase-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;
}

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

/* Khi hover vào icon VAT, tăng z-index của card */
.product-showcase-card:has(.vat-icon:hover) {
    z-index: 10000;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 202px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.product-image > img:not(.badge-almost-soldout) {
    width: 100%;
    height: 202px;
    object-fit: cover;
    object-position: 50% 50%;
}

/* Product Image Features - Only for product-showcase-grid section */
.product-showcase-grid .product-image > img:not(.badge-almost-soldout) {
    aspect-ratio: 1 / 1.1;
}

.product-showcase-grid .product-image-features {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.product-showcase-grid .feature-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    padding: 6px 4px;
}

.product-showcase-grid .feature-icon-item img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
}

.product-showcase-grid .feature-icon-item span {
    font-family: 'SF Pro', sans-serif;
    font-size: 9px;
    font-weight: 400;
    line-height: 1.3;
    color: #3D3D3D;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-width: 60px;
}

/* Almost Soldout Badge */
.badge-almost-soldout {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 52px;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    z-index: 10;
    display: none; /* Hidden by default */
}

/* Show badge when parent has data-badge="almost-soldout" or has class "show-badge" */
.product-showcase-card[data-badge="almost-soldout"] .badge-almost-soldout,
.product-showcase-card.show-badge .badge-almost-soldout {
    display: block;
}

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

/* Product Details */
.product-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Product Description */
.product-description {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Product Title Container */
.product-title-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Product Title */
.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;
}

/* Product Title Content - contains title text and price */
.product-title-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Product Price Container */
.product-price-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    /* padding-top: 8px; */
    padding-bottom: 8px;
    overflow: visible;
}

.product-price-details {
    display: flex;
    flex-direction: column;
    /* gap: 4px; */
    overflow: visible;
}

/* Product Price */
.product-price {
    display: flex;
    gap: 4px;
    align-items: flex-end;
}

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

.price-unit {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    color: #3D3D3D;
}

/* Product VAT */
.product-vat {
    display: flex;
    gap: 6px;
    align-items: center;
    position: relative;
}

.product-vat span {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: #3D3D3D;
}

.vat-icon-wrapper {
    position: relative;
    display: inline-block;
}

.vat-icon {
    width: 18px;
    height: 18px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: block;
}

.vat-icon:hover {
    opacity: 0.7;
}

/* VAT Tooltip for Product Showcase */
.vat-icon-wrapper .vat-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    background: #3D3D3D;
    color: #FFFFFF;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
    pointer-events: auto;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

.vat-icon-wrapper .vat-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #3D3D3D;
}

.vat-icon:hover + .vat-tooltip,
.vat-icon-wrapper .vat-tooltip:hover {
    opacity: 1;
    visibility: visible;
}

/* Product Old Price (for discount products) */
.product-old-price {
    display: flex;
    gap: 6px;
    align-items: center;
}

.old-price-amount {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.discount-badge {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    color: #DC2626;
}

/* Product Features */
.product-features {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    height: 60px;
}

.feature-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.feature-item img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.feature-item span {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 410;
    line-height: 18px;
    color: #3D3D3D;
    flex: 1;
}

/* Button Container */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

/* View All Link */
.showcase-view-all {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.view-all-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'SF Pro', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    color: #4564ED;
    text-decoration: none;
    transition: all 0.3s ease;
}


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

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

    .showcase-content {
        gap: 16px;
    }

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

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

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

    .showcase-content {
        height: auto;
        flex-direction: column;
    }

    .showcase-banner {
        width: 100%;
        height: 300px;
    }

    .showcase-products {
        flex-wrap: wrap;
        gap: 16px;
    }

    .product-showcase-card {
        flex-basis: calc(50% - 8px);
        height: auto;
    }
}

/* iPad Pro 12.9" */
@media (min-width: 1024px) and (max-width: 1366px) {
    .product-showcase {
        padding: 12px 60px 12px 60px;
    }

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

    .showcase-banner {
        width: 300px;
        flex-shrink: 0;
        height: auto;
        align-self: stretch;
    }

    .showcase-products,
    .product-showcase-grid .showcase-content > div:not(.showcase-banner) {
        flex: 1;
        display: flex !important;
        overflow-x: auto;
        overflow-y: visible;
        gap: 16px;
        flex-wrap: nowrap !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #D1D1D1 transparent;
    }

    .showcase-products::-webkit-scrollbar,
    .product-showcase-grid .showcase-content > div:not(.showcase-banner)::-webkit-scrollbar {
        height: 6px;
    }

    .showcase-products::-webkit-scrollbar-track,
    .product-showcase-grid .showcase-content > div:not(.showcase-banner)::-webkit-scrollbar-track {
        background: transparent;
    }

    .showcase-products::-webkit-scrollbar-thumb,
    .product-showcase-grid .showcase-content > div:not(.showcase-banner)::-webkit-scrollbar-thumb {
        background: #D1D1D1;
        border-radius: 3px;
    }

    .showcase-products::-webkit-scrollbar-thumb:hover,
    .product-showcase-grid .showcase-content > div:not(.showcase-banner)::-webkit-scrollbar-thumb:hover {
        background: #B0B0B0;
    }

    .product-showcase-card {
        flex: 0 0 280px !important;
        width: 280px;
    }

    .product-info {
        padding: 14px;
    }
}

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

    .showcase-content {
        gap: 16px;
    }

    .showcase-banner {
        width: 280px;
    }

    .showcase-products {
        gap: 14px;
    }

    .product-title {
        font-size: 16px;
    }

    .price-amount {
        font-size: 22px;
    }

    .product-info {
        padding: 14px;
    }

    .feature-item span {
        font-size: 11px;
        line-height: 16px;
    }
}

/* iPad Portrait */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
    .product-showcase {
        padding: 12px 40px 12px 40px;
    }

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

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

    .showcase-content {
        flex-direction: column;
        gap: 18px;
    }

    .showcase-banner {
        width: 100%;
        height: 320px;
    }

    .showcase-products {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-showcase-card {
        height: auto;
    }

    .product-title {
        font-size: 16px;
    }

    .price-amount {
        font-size: 22px;
    }
}

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

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

    .showcase-title {
        font-size: 22px;
        line-height: 28px;
    }

    .showcase-banner {
        height: 250px;
    }
}

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

    .showcase-container {
        padding: 16px;
        gap: 16px;
    }

    .showcase-title {
        font-size: 20px;
        line-height: 28px;
    }

    .showcase-banner {
        height: 200px;
    }

    .showcase-products {
        gap: 12px;
    }

    .product-showcase-card {
        flex-basis: 100%;
    }

    .product-title {
        font-size: 16px;
    }

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

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

    .showcase-title {
        font-size: 18px;
        line-height: 24px;
    }

    .showcase-banner {
        height: 180px;
    }

    .btn-buy {
        width: 100%;
    }

    /* Product image features on mobile - maintain desktop style */
    .product-showcase-grid .product-image-features {
        right: 4px;
        gap: 6px;
    }

    .product-showcase-grid .feature-icon-item {
        padding: 4px 3px;
    }

    .product-showcase-grid .feature-icon-item img {
        width: 24px;
        height: 24px;
    }

    .product-showcase-grid .feature-icon-item span {
        font-size: 8px;
        max-width: 50px;
        line-height: 1.2;
    }
}
