/* Optimized Product Display - 4 Column Grid for 12 Products */
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    padding: 20px 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: visible;
    transition: transform 0.2s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 420px;
    width: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    display: block;
    position: relative;
    z-index: 1;
}

.product-image.lazy {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-info {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(5px) !important;
    padding: 15px !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
}

.product-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.price {
    font-size: 20px;
    font-weight: bold;
    color: #e91e63;
    margin: 10px 0;
}

.description {
    color: #666;
    font-size: 13px;
    margin: 8px 0;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.pagination {
    margin: 40px 0;
}

.btn {
    background: #e91e63;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block !important;
    margin: 2px;
    transition: background 0.2s;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 20;
}

.product-info .btn {
    margin-top: 8px;
}

.cart-form {
    margin-top: 5px;
    display: inline !important;
    visibility: visible !important;
}

.product-actions {
    display: flex !important;
    gap: 5px;
    margin-top: 10px;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 20;
    position: relative;
}

.btn:hover {
    background: #c2185b;
}

.btn.active {
    background: #ad1457;
}

/* Enhanced Responsive Design for Products - 11+ Device Types */

/* 1. Large Desktop & 4K Monitors (2560px+) */
@media (min-width: 2560px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 24px !important;
    }
    .product-card { height: 520px; }
    .product-image { height: 350px; }
}

/* 2. Standard Desktop (1920px-2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 22px !important;
    }
    .product-card { height: 480px; }
    .product-image { height: 320px; }
}

/* 3. Large Laptop/Desktop (1440px-1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
    }
    .product-card { height: 450px; }
    .product-image { height: 300px; }
}

/* 4. Standard Laptop (1200px-1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px !important;
    }
    .product-card { height: 420px; }
    .product-image { height: 280px; }
}

/* 5. Small Laptop (1024px-1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }
    .product-card { height: 400px; }
    .product-image { height: 260px; }
}

/* 6. Large Tablet Landscape (768px-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px !important;
    }
    .product-card { height: 380px; }
    .product-image { height: 240px; }
    .product-info { padding: 12px; }
}

/* 7. Standard Tablet Portrait (600px-767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .product-card { height: 360px; }
    .product-image { height: 220px; }
    .product-info { padding: 10px; }
    .product-info h3 { font-size: 14px; height: 35px; }
}

/* 8. Large Mobile/Small Tablet (480px-599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .product-card { height: 340px; }
    .product-image { height: 200px; }
    .product-info { padding: 8px; }
    .product-info h3 { font-size: 13px; height: 32px; }
    .btn { padding: 6px 12px; font-size: 12px; }
}

/* 9. Standard Mobile (375px-479px) */
@media (min-width: 375px) and (max-width: 479px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .product-card { height: 320px; display: flex; flex-direction: row; }
    .product-image { height: 150px; width: 150px; flex-shrink: 0; }
    .product-info { padding: 8px; flex: 1; }
    .product-info h3 { font-size: 12px; height: 30px; }
    .btn { padding: 4px 8px; font-size: 11px; }
}

/* 10. Small Mobile (320px-374px) */
@media (min-width: 320px) and (max-width: 374px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    .product-card { height: 300px; display: flex; flex-direction: row; }
    .product-image { height: 130px; width: 130px; flex-shrink: 0; }
    .product-info { padding: 6px; flex: 1; }
    .product-info h3 { font-size: 11px; height: 28px; }
    .btn { padding: 3px 6px; font-size: 10px; }
}

/* 11. Extra Small Mobile (<320px) */
@media (max-width: 319px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }
    .product-card { height: 280px; display: flex; flex-direction: column; }
    .product-image { height: 120px; width: 100%; }
    .product-info { padding: 4px; }
    .product-info h3 { font-size: 10px; height: 25px; }
    .btn { padding: 2px 4px; font-size: 9px; }
}

/* Touch-Friendly Enhancements */
@media (max-width: 1023px) {
    .product-card {
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
}