/* Products Mobile Responsive CSS */

@media screen and (max-width: 768px) {
    /* Fix Overflow */
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Container */
    .products-layout .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Products Main */
    .products-main {
        padding: 0 !important;
        width: 100% !important;
    }
    
    /* Products Grid - Force 2 columns */
    .products-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        padding: 6px !important;
    }
    
    .products-grid.view-grid-3,
    .products-grid.view-grid-4 {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Product Card */
    .product-card {
        display: flex !important;
        flex-direction: column !important;
        padding: 6px !important;
        margin: 0 !important;
        border-radius: 8px !important;
        cursor: pointer;
        background: white !important;
        border: 1px solid #f0f0f0 !important;
    }
    
    /* Product Image */
    .product-image-wrapper {
        position: relative;
        width: 100%;
        padding-top: 100%;
        overflow: hidden;
        background: #fff;
        border-radius: 6px;
        margin-bottom: 6px;
        order: 1;
    }
    
    .product-image-wrapper img,
    .product-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    
    /* Product Content - Force order */
    .product-content {
        display: flex !important;
        flex-direction: column !important;
        order: 2;
    }
    
    /* Product Name/Title */
    .product-name,
    .product-title {
        font-size: 11px !important;
        line-height: 1.3 !important;
        margin: 0 0 4px 0 !important;
        padding: 0 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 28px;
        max-height: 28px;
        order: 1;
        color: #333 !important;
        font-weight: 500 !important;
    }
    
    /* Variant/Size Info */
    .product-variant,
    .variant-info,
    .variant-selector {
        font-size: 10px !important;
        color: #666 !important;
        margin: 0 0 4px 0 !important;
        padding: 2px 6px !important;
        order: 2;
        background: #f5f5f5;
        border-radius: 4px;
        display: inline-block;
        width: fit-content;
    }
    
    /* Price Section */
    .product-price,
    .price-box {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #D946A6 !important;
        margin: 0 !important;
        padding: 0 !important;
        order: 3;
        line-height: 1.2 !important;
    }
    
    .product-compare-price,
    .original-price {
        font-size: 10px !important;
        text-decoration: line-through;
        color: #999;
        margin-left: 4px;
    }
    
    /* Free shipping text */
    .shipping-info {
        font-size: 9px !important;
        color: #666 !important;
        margin-top: 2px !important;
    }
    
    /* Badges */
    .discount-badge,
    .product-badge {
        position: absolute !important;
        top: 6px !important;
        right: 6px !important;
        font-size: 10px !important;
        padding: 2px 6px !important;
        border-radius: 3px;
        z-index: 2;
        font-weight: 600;
    }
    
    /* Stock Status */
    .stock-status {
        font-size: 10px !important;
        padding: 2px 6px !important;
        margin-top: 2px;
    }
    
    /* Hide unnecessary elements on mobile */
    .product-meta-info,
    .compatible-section,
    .product-actions,
    .product-description {
        display: none !important;
    }
    
    /* Filter Sidebar - Make it overlay on mobile */
    .filters-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .filters-sidebar.active {
        left: 0;
    }
    
    /* Mobile Filter Toggle */
    .mobile-filter-toggle {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 12px 16px;
        margin-bottom: 8px;
        background: #D946A6;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }
    
    .mobile-filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .mobile-filter-overlay.active {
        display: block;
    }
    
    /* Products Header */
    .products-header {
        padding: 12px 8px !important;
        flex-direction: column;
        gap: 8px;
    }
    
    .results-info {
        font-size: 13px !important;
    }
    
    /* Breadcrumb - Auto hide on mobile */
    .breadcrumb,
    .breadcrumb-section {
        display: none !important;
    }
}

/* Very small phones */
@media screen and (max-width: 380px) {
    .product-name,
    .product-title {
        font-size: 11px !important;
        min-height: 28px;
    }
    
    .product-price {
        font-size: 14px !important;
    }
}
