/**
 * Desktop Product Grid Fix
 * Ensures products display in proper multi-column grid on desktop
 * This file overrides any JavaScript-applied single-column styles
 */

/* ===============================================
   DESKTOP PRODUCT GRID LAYOUT
   =============================================== */

/* Desktop - 4 columns (992px and up) */
@media (min-width: 992px) {
    
    /* Override any JavaScript-applied single column styles */
    .main-content .product-item,
    .woocommerce .product-item,
    .woocommerce .product-default,
    .woocommerce .products .product,
    .woocommerce .products li,
    .products .product-item,
    .row .product-item {
        flex: 0 0 25% !important;
        max-width: 25% !important;
        width: 25% !important;
        margin-bottom: 2rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Ensure the row container has proper flexbox */
    .main-content .row,
    .products.row,
    .woocommerce .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    /* Reset any problematic width/flex styles from JavaScript */
    .product-item[style*="width: 100%"] {
        width: 25% !important;
    }
    
    .product-item[style*="flex: 0 0 100%"] {
        flex: 0 0 25% !important;
    }
    
    .product-item[style*="max-width: 100%"] {
        max-width: 25% !important;
    }
}

/* Large desktop - 4 columns (1400px and up) */
@media (min-width: 1400px) {
    
    .main-content .product-item,
    .woocommerce .product-item,
    .woocommerce .product-default,
    .woocommerce .products .product,
    .woocommerce .products li,
    .products .product-item,
    .row .product-item {
        flex: 0 0 25% !important;
        max-width: 25% !important;
        width: 25% !important;
    }
    
    /* Reset any problematic width/flex styles from JavaScript for 4 columns */
    .product-item[style*="width: 100%"] {
        width: 25% !important;
    }
    
    .product-item[style*="flex: 0 0 100%"] {
        flex: 0 0 25% !important;
    }
    
    .product-item[style*="max-width: 100%"] {
        max-width: 25% !important;
    }
}

/* ===============================================
   PRODUCT CARD STYLING
   =============================================== */

@media (min-width: 992px) {
    
    /* Ensure product cards have proper styling */
    .product-default {
        border: 1px solid #eee !important;
        border-radius: 8px !important;
        padding: 1rem !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        transition: all 0.3s ease !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .product-default:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
        border-color: #667eea !important;
    }
    
    /* Product image */
    .product-default figure {
        margin-bottom: 1rem !important;
        text-align: center !important;
    }
    
    .product-default figure img {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: contain !important;
        border-radius: 4px !important;
    }
    
    /* Product details */
    .product-details {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }
    
    .product-title {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
        font-weight: 600 !important;
    }
    
    .product-title a {
        color: #333 !important;
        text-decoration: none !important;
    }
    
    .product-title a:hover {
        color: #667eea !important;
    }
    
    /* Price */
    .price-box {
        margin: 0.75rem 0 !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
    }
    
    /* Action buttons */
    .product-action {
        margin-top: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
    }
} 