@charset "UTF-8";

/**
 * Modern Product Card - E-commerce Optimized
 * 
 * Purpose: Professional product card component with responsive images,
 *          discount badges, custom tooltips, price display, and action buttons
 * 
 * Dependencies: variables.css, reset.css, utilities.css
 * 
 * Features:
 * - Fully responsive (mobile-first 375px)
 * - Lazy loading images with placeholder
 * - Custom tooltip for long titles
 * - Discount badge with animation
 * - Stock status indicators (In Stock, Pre Order, On Request, Out of Stock)
 * - Smooth hover effects
 * - AJAX-ready buttons with loading states
 * - Error handling for images
 * - SEO-friendly markup
 * 
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   PRODUCT CARD CONTAINER
   ============================================================ */

.single-product {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 380px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    will-change: transform, box-shadow;
}

.single-product:hover {
    transform: none; /* No transform on hover */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ============================================================
   PRODUCT GRID - Responsive Layout
   ============================================================ */

.nx-product-col {
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.nx-product-col .single-product {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Increase card size for better visibility */
.single-product {
    max-width: 100%;
    min-width: 240px; /* Wider minimum card width */
    min-height: 380px; /* Increased minimum card height */
}

/* Grid Spacing - Reduced Gaps */
.row.g-sm-3.g-2 {
    --bs-gutter-x: 0.5rem; /* Reduced from 1rem */
    --bs-gutter-y: 1rem; /* Reduced from 1.5rem */
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 0.5rem; /* Prevent overlap with sort by */
}

/* List View - Add margin to prevent overlap with sort by */
.row.g-sm-3.g-2.nx-list-view {
    margin-top: 1rem;
}

.row.g-sm-3.g-2 .nx-product-col {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Mobile / Small: 2 products per row, wider cards (reduced padding) */
@media (max-width: 575px) {
    .row.g-sm-3.g-2 .nx-product-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 0.25rem;
    }
    
    .row.g-sm-3.g-2 .nx-product-col .single-product {
        min-width: 0;
        max-width: 100%;
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    
    .row.g-sm-3.g-2 .nx-product-col .product-link {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    
    /* Mobile grid: fixed height image area so title/price/actions are not clipped */
    .row.g-sm-3.g-2 .nx-product-col .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 150px;
        min-height: 150px;
        max-height: 150px;
        flex-shrink: 0;
        overflow: hidden;
        border-radius: 12px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    }
    .row.g-sm-3.g-2 .nx-product-col .product-image-wrapper .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
    }
    .row.g-sm-3.g-2 .nx-product-col .product-title-wrapper {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        padding: 0.4rem 0 0;
        flex-shrink: 0;
    }
    .row.g-sm-3.g-2 .nx-product-col .product-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.35;
        color: #1d1d1f;
        min-height: 0;
        max-height: none;
    }
    .row.g-sm-3.g-2 .nx-product-col .discount-price,
    .row.g-sm-3.g-2 .nx-product-col .new-price,
    .row.g-sm-3.g-2 .nx-product-col .product-price,
    .row.g-sm-3.g-2 .nx-product-col .old-price {
        font-size: 14px;
        visibility: visible;
        opacity: 1;
        display: block;
    }
    .row.g-sm-3.g-2 .nx-product-col .product-actions {
        display: flex;
        visibility: visible;
        opacity: 1;
        flex-shrink: 0;
        padding: 0.4rem 0 0;
    }
    
    /* Single Product: Auto List View on Small Devices */
    .row.g-sm-3.g-2 .nx-product-col:only-child,
    .row.g-sm-3.g-2.nx-grid-1 .nx-product-col {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .single-product,
    .row.g-sm-3.g-2.nx-grid-1 .single-product {
        flex-direction: row;
        min-height: auto;
        max-height: none;
        padding: 1rem;
        gap: 1rem;
        height: auto;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .single-product .product-link,
    .row.g-sm-3.g-2.nx-grid-1 .single-product .product-link {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: 1rem;
        align-items: center;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .product-image-wrapper,
    .row.g-sm-3.g-2.nx-grid-1 .product-image-wrapper {
        position: relative;
        flex: 0 0 180px;
        max-width: 180px;
        min-width: 180px;
        width: 180px;
        height: 180px;
        min-height: 180px;
        max-height: 180px;
        border-radius: 10px;
        overflow: hidden;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .product-image,
    .row.g-sm-3.g-2.nx-grid-1 .product-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .product-title-wrapper,
    .row.g-sm-3.g-2.nx-grid-1 .product-title-wrapper {
        flex: 1;
        padding: 0;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
        min-width: 0;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .product-title,
    .row.g-sm-3.g-2.nx-grid-1 .product-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 2.8em;
        margin-bottom: 0.25rem;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .new-price,
    .row.g-sm-3.g-2 .nx-product-col:only-child .product-price,
    .row.g-sm-3.g-2.nx-grid-1 .new-price,
    .row.g-sm-3.g-2.nx-grid-1 .product-price {
        font-size: 18px;
        font-weight: 700;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .old-price,
    .row.g-sm-3.g-2.nx-grid-1 .old-price {
        font-size: 13px;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .product-actions,
    .row.g-sm-3.g-2.nx-grid-1 .product-actions {
        flex-direction: row;
        padding: 0;
        margin: 0;
        align-items: center;
        gap: 0.75rem;
        flex: 0 0 auto;
        margin-top: 0.5rem;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .custom-buy-now-btn,
    .row.g-sm-3.g-2.nx-grid-1 .custom-buy-now-btn {
        flex: 1;
        min-height: 44px;
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .row.g-sm-3.g-2 .nx-product-col:only-child .custom-add-to-cart-btn,
    .row.g-sm-3.g-2.nx-grid-1 .custom-add-to-cart-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
    
    /* Mobile: List View - Stack vertically on small screens */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view,
    .row.g-sm-3.g-2.nx-list-view .single-product.shadow-lg.nx-product-list-view {
        flex-direction: column; /* Stack on mobile */
        min-height: auto;
        max-height: none;
        padding: 0.75rem;
        gap: 0.75rem;
        height: auto;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-link {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-image-wrapper {
        position: relative;
        flex: 0 0 auto;
        max-width: 100%;
        min-width: 100%;
        width: 100%;
        height: 175px;
        min-height: 175px;
        max-height: 175px;
        border-radius: 10px;
        overflow: hidden;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-title-wrapper {
        padding: 0.5rem 0;
        width: 100%;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-title {
        font-size: 15px;
        font-weight: 600;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        max-height: 4.2em;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .new-price,
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-price {
        font-size: 18px;
        font-weight: 700;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .old-price {
        font-size: 13px;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-actions {
        width: 100%;
        padding: 0.5rem 0 0;
        margin-top: auto;
        gap: 0.5rem;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .custom-buy-now-btn {
        flex: 1;
        min-height: 44px;
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .custom-add-to-cart-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
}

/* Small screens: 2 products per row - Larger Cards */
@media (min-width: 576px) and (max-width: 767px) {
    .row.g-sm-3.g-2 .nx-product-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 0.6rem;
    }
    
    .single-product {
        min-width: 200px; /* Wider minimum */
    }
    
    .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 70px;
        min-height: 190px;
        max-height: 190px;
        border-radius: 12px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .single-product {
        min-height: 370px;
    }
    
    /* Tablet: List View - Horizontal layout */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view,
    .row.g-sm-3.g-2.nx-list-view .single-product.shadow-lg.nx-product-list-view {
        flex-direction: row;
        min-height: 240px;
        max-height: 300px;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-image-wrapper {
        position: relative;
        flex: 0 0 220px;
        max-width: 220px;
        min-width: 220px;
        width: 100%;
        height: 100%;
        max-height: 170px;
        min-height: 170px;
        border-radius: 12px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-title {
        font-size: 17px;
    }
}

/* Tablet: 2 products per row - Wider Cards for visibility */
@media (min-width: 768px) and (max-width: 991px) {
    .row.g-sm-3.g-2 .nx-product-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 0.75rem;
    }
    
    .single-product {
        min-width: 240px;
    }
    
    .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 200px;
        min-height: 200px;
        max-height: 200px;
        border-radius: 12px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .single-product {
        min-height: 400px;
    }
}

/* Desktop: Wider cards - 4 per row by default for better visibility */
@media (min-width: 992px) {
    /* Default: 4 products per row - Wider cards */
    .row.g-sm-3.g-2.nx-grid-6 .nx-product-col,
    .row.g-sm-3.g-2:not([class*="nx-grid"]) .nx-product-col {
        flex: 0 0 25%;
        max-width: 25%;
        padding: 0 0.6rem;
    }
    
    .row.g-sm-3.g-2.nx-grid-6 .product-image-wrapper,
    .row.g-sm-3.g-2:not([class*="nx-grid"]) .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 200px;
        min-height: 200px;
        max-height: 200px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .row.g-sm-3.g-2.nx-grid-6 .product-image,
    .row.g-sm-3.g-2:not([class*="nx-grid"]) .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 5 products: 4 per row (same as default) */
    .row.g-sm-3.g-2.nx-grid-5 .nx-product-col {
        flex: 0 0 25%;
        max-width: 25%;
        padding: 0 0.6rem;
    }
    
    .row.g-sm-3.g-2.nx-grid-5 .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 200px;
        min-height: 200px;
        max-height: 200px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .row.g-sm-3.g-2.nx-grid-5 .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 4 products: 4 per row */
    .row.g-sm-3.g-2.nx-grid-4 .nx-product-col {
        flex: 0 0 25%;
        max-width: 25%;
        padding: 0 0.6rem;
    }
    
    .row.g-sm-3.g-2.nx-grid-4 .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 200px;
        min-height: 200px;
        max-height: 200px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .row.g-sm-3.g-2.nx-grid-4 .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 3 products: 3 per row */
    .row.g-sm-3.g-2.nx-grid-3 .nx-product-col {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        padding: 0 0.75rem;
    }
    
    .row.g-sm-3.g-2.nx-grid-3 .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 260px;
        min-height: 260px;
        max-height: 260px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .row.g-sm-3.g-2.nx-grid-3 .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 2 products: 2 per row */
    .row.g-sm-3.g-2.nx-grid-2 .nx-product-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 1rem;
    }
    
    .row.g-sm-3.g-2.nx-grid-2 .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 320px;
        min-height: 320px;
        max-height: 320px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .row.g-sm-3.g-2.nx-grid-2 .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .row.g-sm-3.g-2.nx-grid-2 .single-product,
    .row.g-sm-3.g-2.nx-grid-3 .single-product {
        min-height: 400px;
    }
    
    .single-product {
        min-width: 260px;
    }
    
    /* 1 product: List View (Horizontal Layout) - Full Width */
    .row.g-sm-3.g-2.nx-grid-1.nx-list-view .nx-product-col {
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 1rem;
    }
    
    /* List View Product Card - Horizontal Layout */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view,
    .row.g-sm-3.g-2.nx-list-view .single-product.shadow-lg.nx-product-list-view {
        flex-direction: row; /* Horizontal layout */
        min-height: 280px;
        max-height: 350px;
        padding: 1.5rem;
        gap: 1.5rem;
        align-items: center;
        height: auto; /* Override height: 100% */
    }
    
    /* List View: Product link - flex row container */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-link {
        display: flex;
        flex-direction: row;
        flex: 1;
        gap: 1.5rem;
        align-items: center;
        text-decoration: none;
        color: inherit;
        min-width: 0;
    }
    
    /* List View: Image on Left - Inside link */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-image-wrapper {
        position: relative;
        flex: 0 0 260px;
        max-width: 360px;
        min-width: 360px;
        width: 100%;
        height: 100%;
        max-height: 260px;
        min-height: 260px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding-top: 0; /* Remove aspect ratio padding */
        margin: 0;
        flex-shrink: 0;
    }
    
    /* List View: Content on Right - Inside link */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-title-wrapper {
        flex: 1;
        padding: 0;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.75rem;
        min-width: 0;
    }
    
    /* List View: Title - Full width, allow more lines */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-title {
        font-size: 18px;
        font-weight: 600;
        line-height: 1.4;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        max-height: 4.2em;
        min-height: auto;
    }
    
    /* List View: Price - Larger */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .new-price,
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-price {
        font-size: 20px;
        font-weight: 700;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .old-price {
        font-size: 14px;
    }
    
    /* List View: Actions - Horizontal layout, positioned at right side */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-actions {
        flex-direction: row;
        padding: 0;
        margin: 0;
        align-items: center;
        gap: 1rem;
        flex: 0 0 auto;
    }
    
    /* List View: Buttons - Larger */
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .custom-buy-now-btn {
        min-height: 48px;
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .custom-add-to-cart-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .single-product {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

/* Large Desktop: Even larger cards */
@media (min-width: 1200px) {
    .row.g-sm-3.g-2 .nx-product-col {
        padding: 0 1rem; /* More padding on large screens */
    }
    
    .single-product {
        min-width: 220px; /* Even larger on big screens */
    }
}

/* ============================================================
   PRODUCT IMAGE WRAPPER - Responsive & Optimized (Auto Height/Width)
   ============================================================ */

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    display: block;
    z-index: 1;
    isolation: isolate;
    /* min-height: 280px;
    max-height: 480px; */
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Wave Overlay Effect on Hover */
.product-image-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.single-product:hover .product-image-wrapper::before {
    opacity: 1;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 25%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        transparent 100%
    );
    animation: wave-sweep 1.5s ease-in-out;
    transform: skewX(-20deg);
}

/* Wave Pattern Animation - Removed vertical lines */
.product-image-wrapper::after {
    display: none;
}

/* Product Image - Fully Responsive (Full Width for Grid Views) - Matching Banner Style */
.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* List View: Keep auto width for horizontal layout */
.row.g-sm-3.g-2.nx-list-view .single-product.nx-product-list-view .product-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
}

.single-product:hover .product-image {
    transform: none; /* No scale on hover */
}

/* Image Loading State */
.product-image[data-src]:not(.lazyloaded) {
    opacity: 0.6;
    filter: blur(4px);
}

.product-image.lazyloaded {
    opacity: 1;
    filter: blur(0);
}

/* Image Error Fallback */
.product-image[src*="placeholder"] {
    object-fit: contain;
    opacity: 0.5;
}

/* ============================================================
   DISCOUNT BADGE - Modern & Animated (Theme Primary Color)
   ============================================================ */

.discount {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: var(--bs-primary, #0d6efd);
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd) 0%, var(--bs-primary-hover, #0b5ed7) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
    white-space: nowrap;
}

.discount span {
    font-size: 10px;
    font-weight: 700;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    }
}

/* ============================================================
   STOCK STATUS RIBBONS
   ============================================================ */

.container__wrapper4 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    z-index: 998;
    pointer-events: none;
}

.container__ribbon4 {
    position: absolute;
    left: -84px;
    top: 32px;
    width: 206px;
    height: 19px;
    transform: rotate(-45deg);
    background-color: #6c757d;
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    padding-left: 82px;
    display: flex;
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Stock Status Colors */
.container__wrapper4[style*="background-color: #5dff03"] .container__ribbon4 {
    background-color: #28a745;
    color: #ffffff;
}

.container__wrapper4[style*="background-color: #FFD600"] .container__ribbon4 {
    background-color: #ffc107;
    color: #212529;
}

/* ============================================================
   PRODUCT LINK - SEO & GTM Data
   ============================================================ */

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 1;
}

.product-link:focus {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   PRODUCT TITLE WRAPPER - With Custom Tooltip
   ============================================================ */

.product-title-wrapper {
    position: relative;
    padding: 14px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 70px;
    background: #ffffff;
}

/* Product Title - Truncated with Tooltip (Fixed Mobile Visibility) */
.product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: #1d1d1f;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    transition: color 0.2s ease;
    cursor: pointer;
    position: relative;
    min-height: 2.8em;
    max-height: 2.8em;
}

.product-title:hover {
    color: var(--bs-primary, #0d6efd);
}

/* Custom Tooltip Container - White Background with Theme Color */
.product-title[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #ffffff;
    color: var(--bs-primary, #0d6efd);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltip-fade-in 0.2s ease-out forwards;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(13, 110, 253, 0.2);
    max-width: 280px;
    white-space: normal;
    text-align: center;
    line-height: 1.5;
    border: 1px solid var(--bs-primary, #0d6efd);
}

.product-title[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 6px solid transparent;
    border-top-color: var(--bs-primary, #0d6efd);
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    animation: tooltip-fade-in 0.2s ease-out forwards;
}

@keyframes tooltip-fade-in {
    to {
        opacity: 1;
    }
}

/* Wave Animation Keyframes */
@keyframes wave-sweep {
    0% {
        transform: translateX(-100%) skewX(-20deg);
    }
    100% {
        transform: translateX(200%) skewX(-20deg);
    }
}

@keyframes wave-flow {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px);
        opacity: 0.8;
    }
}

/* ============================================================
   PRICE DISPLAY - Discount & Regular
   ============================================================ */

/* Discount Price (with old price) */
.discount-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.new-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--bs-primary, #0d6efd);
    line-height: 1;
}

.old-price {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    text-decoration: line-through;
    opacity: 0.7;
    line-height: 1;
}

/* Regular Price (no discount) */
.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--bs-primary, #0d6efd);
    line-height: 1;
    margin-top: 4px;
}

/* ============================================================
   PRODUCT ACTIONS - Buttons with Loading States
   ============================================================ */

.product-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
    margin-top: auto;
}

/* Buy Now Button - No Line Break, Theme Color */
.custom-buy-now-btn {
    flex: 1;
    background: var(--bs-primary, #0d6efd);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    min-height: 40px;
    white-space: nowrap; /* Prevent text wrapping */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-buy-now-btn:hover:not(:disabled) {
    background: var(--bs-primary-hover, #0b5ed7);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    filter: brightness(1.05);
}

.custom-buy-now-btn:active:not(:disabled) {
    transform: translateY(0);
}

.custom-buy-now-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-buy-now-btn i {
    font-size: 14px;
}

/* Add to Cart Button */
.custom-add-to-cart-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background: #f5f5f7;
    color: var(--bs-primary, #0d6efd);
    border: none;
    border-radius: 8px;
    padding: 0;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.custom-add-to-cart-btn:hover:not(:disabled) {
    background: var(--bs-primary, #0d6efd);
    color: #ffffff;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.custom-add-to-cart-btn:active:not(:disabled) {
    transform: translateY(0) scale(1);
}

.custom-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-add-to-cart-btn i {
    font-size: 18px;
}

/* Button Loading State */
.custom-buy-now-btn.loading,
.custom-add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.custom-buy-now-btn.loading::after,
.custom-add-to-cart-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Success State */
.custom-buy-now-btn.success,
.custom-add-to-cart-btn.success {
    background: #28a745;
    color: #ffffff;
}

.custom-add-to-cart-btn.success i::before {
    content: "\f00c"; /* Checkmark icon */
}

/* ============================================================
   RESPONSIVE - MOBILE (375px base)
   ============================================================ */

/* Mobile optimizations - 2 products per row */
@media (max-width: 575px) {
    .single-product {
        border-radius: 10px;
    }

    .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 180px;
        min-height: 180px;
        max-height: 180px;
        border-radius: 10px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .single-product {
        min-height: 360px;
    }

    .product-title {
        font-size: 13px;
        min-height: 2.6em;
        max-height: 2.6em;
        line-height: 1.4;
        font-weight: 600;
    }
    
    .product-title-wrapper {
        padding: 12px 10px;
        min-height: 70px;
    }
    
    .custom-buy-now-btn {
        font-size: 11px;
        padding: 9px 12px;
        min-height: 38px;
    }
    
    .custom-add-to-cart-btn {
        width: 36px;
        height: 36px;
    }

    .new-price,
    .product-price {
        font-size: 16px;
    }
    
    .old-price {
        font-size: 12px;
    }

    .discount {
        font-size: 9px;
        padding: 4px 8px;
        top: 6px;
        right: 6px;
    }

    .product-actions {
        gap: 6px;
        padding: 0 10px 10px;
    }
}

/* ============================================================
   RESPONSIVE - TABLET (768px+)
   ============================================================ */

@media (min-width: 768px) {
    .single-product:hover {
        transform: none; /* No transform on hover */
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    }

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

    .new-price,
    .product-price {
        font-size: 17px;
    }

    .old-price {
        font-size: 13px;
    }

    .discount {
        font-size: 11px;
        padding: 7px 12px;
    }
}

/* ============================================================
   RESPONSIVE - DESKTOP (1024px+)
   ============================================================ */

@media (min-width: 1024px) {
    .single-product {
        border-radius: 18px;
    }
    
    .single-product:hover {
        transform: none; /* No transform on hover */
    }

    .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 300px;
        min-height: 300px;
        max-height: 300px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        display: block;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0;
    }
    
    .single-product {
        min-height: 385px;
    }
    
    .row.g-sm-3.g-2.nx-grid-4 .single-product,
    .row.g-sm-3.g-2.nx-grid-5 .single-product,
    .row.g-sm-3.g-2.nx-grid-6 .single-product {
        min-height: 320px;
    }

    .product-title {
        font-size: 14px;
        min-height: 3em;
        max-height: 3em;
    }

    .new-price,
    .product-price {
        font-size: 18px;
    }

    .custom-buy-now-btn {
        font-size: 13px;
        padding: 12px 16px;
    }

    .custom-add-to-cart-btn {
        width: 44px;
        height: 44px;
    }

    .custom-add-to-cart-btn i {
        font-size: 20px;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Focus States */
.custom-buy-now-btn:focus,
.custom-add-to-cart-btn:focus,
.product-link:focus {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .single-product,
    .product-image,
    .discount,
    .custom-buy-now-btn,
    .custom-add-to-cart-btn {
        transition: none;
        animation: none;
    }

    .single-product:hover {
        transform: none;
    }

    .single-product:hover .product-image {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .single-product {
        border: 2px solid #000000;
    }

    .product-title {
        font-weight: 700;
    }
}

/* ============================================================
   ERROR HANDLING
   ============================================================ */

/* Image Error State */
.product-image-wrapper:has(.product-image[src*="placeholder"]) {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Empty State */
.product-actions:empty {
    display: none;
}

/* ============================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================ */

/* GPU Acceleration */
.single-product,
.product-image,
.discount {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Will Change Hints */
.single-product:hover .product-image {
    will-change: transform;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .single-product {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .product-actions,
    .discount,
    .container__wrapper4 {
        display: none;
    }
}
