/* assets/css/style.css */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Error Banner */
.error-banner {
    background: #ef4444;
    color: white;
    padding: 15px;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 25px 0;
    margin-bottom: 40px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
    text-shadow: 2px 2px 8px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 60px 18px 25px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.search-input:focus {
    outline: none;
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #4f46e5;
    background: rgba(255, 255, 255, 1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    border: none;
    padding: 12px 18px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.cart-info {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.4);
}

.cart-count {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    text-align: center;
}

/* Categories */
.categories {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding: 15px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.category-btn.active {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.3);
}

.category-count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 4px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.product-badge.out-of-stock {
    background: linear-gradient(45deg, #ef4444, #dc2626);
}

.product-info {
    padding: 25px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
    line-height: 1.4;
}

.product-description {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #9333ea;
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 500;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 20px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.add-to-cart {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 15px;
    cursor: pointer;
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.add-to-cart:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.add-to-cart.added {
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.view-details {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 2px solid #4f46e5;
    padding: 12px 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-details:hover {
    background: #4f46e5;
    color: white;
    transform: translateY(-2px);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results & Error State */
.no-results,
.error-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.no-results i,
.error-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-results h3,
.error-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.retry-btn {
    background: white;
    color: #4f46e5;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 0;
    border-radius: 25px;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.3s ease;
    border: none;
    background: none;
    padding: 5px;
    border-radius: 50%;
}

.close:hover {
    color: #ef4444;
}

/* Cart Modal */
#cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    gap: 15px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 15px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #4f46e5;
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background: #f3f4f6;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e5e7eb;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px;
}

.remove-item:hover {
    background: #ef4444;
    color: white;
}

.empty-cart {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 20px;
}

.cart-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.cart-total {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.checkout-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.checkout-notice {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    margin-top: 10px;
    font-style: italic;
}

/* Product Detail Modal */
.product-detail-content {
    display: flex;
    gap: 30px;
    padding: 30px;
}

.product-detail-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-detail-info {
    flex: 1;
}

.product-detail-name {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
}

.product-detail-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #9333ea;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

.product-detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 20px;
}

.product-detail-description {
    color: #6b7280;
    line-height: 1.8;
    margin-bottom: 25px;
}

.product-detail-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 25px;
}

.product-detail-stock.in-stock {
    background: #d1fae5;
    color: #059669;
}

.product-detail-stock.out-of-stock {
    background: #fee2e2;
    color: #ef4444;
}

.product-detail-actions {
    display: flex;
    gap: 15px;
}

.product-detail-actions .add-to-cart {
    flex: 1;
}

.close-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    padding: 12px 24px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e5e7eb;
    color: #4b5563;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    z-index: 2000;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification i {
    font-size: 20px;
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.success i {
    color: #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.error i {
    color: #ef4444;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

.notification.info i {
    color: #3b82f6;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

.notification.warning i {
    color: #f59e0b;
}

.notification-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #6b7280;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px 25px 0 0;
    margin-top: 80px;
    padding: 50px 0 20px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h4 {
    color: #4b5563;
    margin-bottom: 15px;
}

.footer-section p {
    color: #6b7280;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section i {
    color: #9333ea;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    text-align: center;
    color: #6b7280;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #4f46e5;
    color: white;
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }
    
    .search-container {
        width: 100%;
        margin: 0;
    }
    
    .categories {
        gap: 10px;
    }
    
    .category-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .product-detail-content {
        flex-direction: column;
    }
    
    .product-detail-image {
        width: 100%;
        height: auto;
    }
    
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 24px;
    }
    
    .container {
        padding: 10px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        margin-bottom: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Print Styles */
@media print {
    .header,
    .categories,
    .footer,
    .notification,
    .modal {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

.remove-item {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

