/* Custom Styles and Animations */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Product card animations */
.product-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Product image hover effect */
.product-image {
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Button animations */
.btn-primary {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Filter button animations */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
}

.filter-btn.active {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Cart modal animations */
#cart-modal {
    transition: opacity 0.3s ease;
}

#cart-modal.show {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Cart item animations */
.cart-item {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Quantity controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.quantity-btn:active {
    transform: scale(0.95);
}

/* Remove button animation */
.remove-btn {
    transition: all 0.2s ease;
}

.remove-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* Success message animation */
.success-message {
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-image {
        transform: none;
    }
}

/* Custom scrollbar for cart items */
#cart-items::-webkit-scrollbar {
    width: 6px;
}

#cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#cart-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#cart-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Product grid responsive adjustments */
@media (max-width: 640px) {
    #products-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    #products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Header sticky behavior */
header {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Hero section gradient animation */
.hero-gradient {
    background: linear-gradient(-45deg, #3b82f6, #8b5cf6, #3b82f6, #8b5cf6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Product price styling */
.product-price {
    font-weight: 700;
    color: #059669;
}

/* Out of stock styling */
.out-of-stock {
    opacity: 0.6;
    pointer-events: none;
}

.out-of-stock .product-image {
    filter: grayscale(100%);
}

/* Cart empty state */
.cart-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
