/* ===== BASE STYLES ===== */
body {
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease-in-out;
    background-color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

body[data-theme="dark"] {
    background-color: #0f172a !important;
    color: #e2e8f0;
}

/* ===== DARK MODE STYLES ===== */
body[data-theme="dark"] .text-slate-800 { color: #f1f5f9 !important; }
body[data-theme="dark"] .text-slate-900 { color: #ffffff !important; }
body[data-theme="dark"] .text-slate-600 { color: #cbd5e1 !important; }
body[data-theme="dark"] .text-slate-500 { color: #94a3b8 !important; }
body[data-theme="dark"] .text-slate-400 { color: #64748b !important; }
body[data-theme="dark"] .text-gray-700 { color: #e2e8f0 !important; }
body[data-theme="dark"] .bg-white { background-color: #1e293b !important; }
body[data-theme="dark"] .bg-gray-200 { background-color: #374151 !important; }
body[data-theme="dark"] .border { border-color: #475569 !important; }
body[data-theme="dark"] .border-t { border-color: #475569 !important; }
body[data-theme="dark"] .hover\:bg-slate-100:hover { background-color: #374151 !important; }
body[data-theme="dark"] .hover\:text-slate-800:hover { color: #f1f5f9 !important; }

/* Dark mode navbar */
body[data-theme="dark"] header {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
}

body[data-theme="dark"] #mobile-menu {
    background: linear-gradient(to bottom, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95)) !important;
}

/* ===== PRODUCT CARDS ===== */
.product-card {
    transition: all 0.3s ease-in-out;
}

.product-card:hover {
    transform: translateY(-4px);
}

body[data-theme="dark"] .product-card {
    background-color: #1e293b;
}

body[data-theme="dark"] .product-card h3 {
    color: #f1f5f9 !important;
}

body[data-theme="dark"] .product-card .text-gray-800 {
    color: #f1f5f9 !important;
}

/* ===== BADGES ===== */
.promo-badge {
    background-color: #38bdf8;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.sold-out-badge {
    background-color: #f43f5e;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.preorder-badge {
    background-color: #f97316;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== CART BADGE ===== */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ===== BANNER SLIDER ===== */
.banner-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    aspect-ratio: 16/9;
    max-height: 400px;
}

.banner-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.banner-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.banner-dot.active {
    background-color: #ffffff;
}

/* ===== CATEGORY SLIDER ===== */
.category-slider {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.category-slider::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Category slider cards */
.category-slider .product-card {
    min-width: 160px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .category-slider .product-card {
        min-width: 140px;
    }
}

/* ===== MODALS ===== */
.modal {
    overflow-y: auto;
}

.modal > div {
    max-height: 90vh;
    overflow-y: auto;
}

body[data-theme="dark"] #cart-modal .bg-white,
body[data-theme="dark"] #search-modal .bg-white {
    background-color: #1e293b !important;
    color: #e2e8f0;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
    background-color: #374151 !important;
    color: #f1f5f9 !important;
    border-color: #4b5563 !important;
}

body[data-theme="dark"] select option {
    background-color: #374151 !important;
    color: #f1f5f9 !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: #9ca3af !important;
}

/* Dark mode button styles */
body[data-theme="dark"] .bg-gray-200 {
    background-color: #4b5563 !important;
    color: #f1f5f9 !important;
}

body[data-theme="dark"] .hover\:bg-gray-300:hover {
    background-color: #6b7280 !important;
}

body[data-theme="dark"] .text-gray-700 {
    color: #f1f5f9 !important;
}

/* Quantity buttons in product detail */
body[data-theme="dark"] button.bg-gray-200 {
    background-color: #4b5563 !important;
    color: #f1f5f9 !important;
    border: 1px solid #6b7280 !important;
}

body[data-theme="dark"] button.bg-gray-200:hover {
    background-color: #6b7280 !important;
}

/* ===== MOBILE MENU ===== */
body[data-theme="dark"] #full-nav.bg-white {
    background-color: #1e293b !important;
}

/* ===== SOCIAL ICONS ===== */
.social-icon {
    color: #64748b;
    transition: color 0.3s;
}

.social-icon:hover {
    color: #3b82f6;
}

body[data-theme="dark"] .social-icon {
    color: #94a3b8;
}

body[data-theme="dark"] .social-icon:hover {
    color: #60a5fa;
}

/* ===== UTILITY CLASSES ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #3b82f6;
}

.breadcrumb .current {
    color: #1e293b;
    font-weight: 600;
}

body[data-theme="dark"] .breadcrumb .current {
    color: #f1f5f9;
}

body[data-theme="dark"] .breadcrumb a {
    color: #94a3b8;
}

body[data-theme="dark"] .breadcrumb a:hover {
    color: #60a5fa;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #categories-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    #products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-buttons button {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (min-width: 768px) {
    #categories-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    #products-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    #categories-container {
        grid-template-columns: repeat(5, 1fr);
    }
    
    #products-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== LOADING STATES ===== */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* ===== TRANSITIONS ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}



/* Category page sort dropdown */
body[data-theme="dark"] #sort-select {
    background-color: #374151 !important;
    color: #f1f5f9 !important;
    border-color: #4b5563 !important;
}

body[data-theme="dark"] #sort-select option {
    background-color: #374151 !important;
    color: #f1f5f9 !important;
}

/* Product page quantity control buttons */
body[data-theme="dark"] #decrease-qty,
body[data-theme="dark"] #increase-qty {
    background-color: #4b5563 !important;
    color: #f1f5f9 !important;
    border: 1px solid #6b7280 !important;
}

body[data-theme="dark"] #decrease-qty:hover,
body[data-theme="dark"] #increase-qty:hover {
    background-color: #6b7280 !important;
}

/* ===== ERROR STATES ===== */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

/* ===== PRODUCT PAGE SPECIFIC ===== */
.gallery-thumb {
    cursor: pointer;
    transition: opacity 0.3s;
}

.gallery-thumb:hover {
    opacity: 0.7;
}

.gallery-thumb.active {
    border: 2px solid #3b82f6;
}

/* Modal styles for product page */
.modal {
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    overflow-y: auto;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.open .modal-content {
    transform: scale(1);
}

/* Modal dark mode */
body[data-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Responsive modal */
@media (max-width: 640px) {
    .modal .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 85vh;
    }
}

/* ===== PRODUCT DETAIL STYLES ===== */
.product-gallery {
    position: relative;
}

.product-gallery img {
    transition: transform 0.3s ease;
}

.product-gallery:hover img {
    transform: scale(1.05);
}

.product-specs {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
}

/* ===== BUTTON STYLES ===== */
.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Quantity control buttons */
.qty-btn {
    background-color: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
    transition: all 0.3s;
}

.qty-btn:hover {
    background-color: #d1d5db;
}

body[data-theme="dark"] .qty-btn {
    background-color: #4b5563 !important;
    color: #f1f5f9 !important;
    border-color: #6b7280 !important;
}

body[data-theme="dark"] .qty-btn:hover {
    background-color: #6b7280 !important;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}