/* Enhanced Product Display Styles */

/* Product Card Enhancements */
.product-card {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(169, 154, 227, 0.05) 0%, rgba(151, 71, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.product-card:hover::before {
    opacity: 1;
}

/* Product Filter Buttons */
.product-filter-btn {
    backdrop-filter: blur(10px);
    border-width: 2px;
    font-family: 'Comme', sans-serif;
    position: relative;
    overflow: hidden;
}

.product-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(169, 154, 227, 0.3), transparent);
    transition: left 0.5s;
}

.product-filter-btn:hover::before {
    left: 100%;
}

/* Enhanced Grid Layout */
.product-container .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

@media (max-width: 640px) {
    .product-container .grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .product-container .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-container .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .product-container .grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Product Image Hover Effects */
.product-card img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover img {
    transform: scale(1.1) rotate(2deg);
}

/* Quick Action Buttons Animation */
.product-card .absolute.top-3.right-3 {
    transform: translateX(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .absolute.top-3.right-3 {
    transform: translateX(0);
    opacity: 1;
}

.product-card .absolute.top-3.right-3 button {
    transform: scale(0.8);
    transition: transform 0.2s ease;
}

.product-card:hover .absolute.top-3.right-3 button {
    transform: scale(1);
}

.product-card .absolute.top-3.right-3 button:hover {
    transform: scale(1.1);
}

/* Enhanced Add to Cart Button */
.product-card button[type="submit"] {
    position: relative;
    overflow: hidden;
}

.product-card button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.product-card button[type="submit"]:hover::before {
    left: 100%;
}

/* Load More Button Enhancement */
#load-more-products {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

#load-more-products::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#load-more-products:hover::before {
    left: 100%;
}

/* Rating Stars Animation */
.product-card .fa-star {
    transition: all 0.2s ease;
}

.product-card:hover .fa-star {
    transform: scale(1.1);
    filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.5));
}

/* Badge Animations */
.product-card .absolute.top-0.left-0 {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.product-card:hover .absolute.top-0.left-0 {
    transform: scale(1);
}

/* Price Badge Enhancement */
.product-card .absolute.top-3.left-3 {
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(169, 154, 227, 0.3);
    transition: all 0.3s ease;
}

.product-card:hover .absolute.top-3.left-3 {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(169, 154, 227, 0.4);
}

/* Add to Cart Button States */
.add-to-cart-form button:disabled {
    background: linear-gradient(to right, #9ca3af, #9ca3af) !important;
    cursor: not-allowed;
    transform: none !important;
}

.add-to-cart-form button:disabled:hover {
    transform: none !important;
    scale: 1 !important;
    box-shadow: none !important;
}

/* Loading State */
.add-to-cart-form button:disabled .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Stagger Animation for Grid Items */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.35s; }
.product-card:nth-child(7) { animation-delay: 0.4s; }
.product-card:nth-child(8) { animation-delay: 0.45s; }
.product-card:nth-child(9) { animation-delay: 0.5s; }
.product-card:nth-child(10) { animation-delay: 0.55s; }
.product-card:nth-child(11) { animation-delay: 0.6s; }
.product-card:nth-child(12) { animation-delay: 0.65s; }

/* Performance Optimizations */
.product-card {
    will-change: transform, box-shadow;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Dark Mode Considerations */
@media (prefers-color-scheme: dark) {
    .product-card {
        background: rgba(26, 32, 44, 0.9);
        border: 1px solid rgba(169, 154, 227, 0.2);
    }
    
    .product-filter-btn {
        backdrop-filter: blur(20px);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #a99ae3;
    }
    
    .product-card:hover {
        border-color: #9747ff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card *,
    .product-filter-btn,
    #load-more-products {
        animation: none !important;
        transition: none !important;
    }
    
    .product-card:hover img {
        transform: none !important;
    }
}

/* Loading States */
.product-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #a99ae3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}