/**
 * E-Commerce System - Main Stylesheet
 * Optimized for Performance & UX
 */

:root {
    /* Brand Colors */
    --primary-color: #e65a4b;
    --primary-dark: #d14839;
    --primary-light: #f07060;
    --secondary-color: #2c3e50;
    
    /* Status Colors */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --dark-color: #1f2937;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    
    /* Text Colors */
    --text-color: #374151;
    --text-light: #6b7280;
    --text-dark: #1f2937;
    
    /* Border & Background */
    --border-color: #e5e7eb;
    --light-color: #f9fafb;
    --white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* ===========================
   RESET & BASE
   =========================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--text-color);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, select, textarea {
    font-family: inherit;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}


/* ===========================
   home
   =========================== */
   /* Hero Slider */
.hero-slider {
    margin-bottom: 60px;
}

.hero-swiper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.hero-slide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 60px;
    min-height: 500px;
    color: white;
}

.hero-content {
    max-width: 500px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.hero-content h2 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-price {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.hero-price .old-price {
    text-decoration: line-through;
    font-size: 20px;
    opacity: 0.7;
}

.hero-price .current-price {
    font-size: 36px;
    font-weight: 800;
}

.btn-hero {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero-image {
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Swiper Custom Styles */
.swiper-button-prev,
.swiper-button-next {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 20px;
}

.swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* Categories Section */
.categories-section {
    margin-bottom: 60px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all var(--transition-base);
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-radius: 50%;
    margin-bottom: 15px;
    color: var(--primary-color);
    transition: all var(--transition-base);
}

.category-card:hover .category-icon {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.category-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.category-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    text-align: center;
}

.category-count {
    font-size: 13px;
    color: var(--text-light);
}

/* Section Common */
.section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-base);
}

.btn-link:hover {
    transform: translateX(5px);
}

/* Features Section */
.features-section {
    background: var(--gray-50);
    padding: 60px 0;
    margin: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
}

.feature-card svg {
    color: var(--primary-color);
    margin: 0 auto 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Newsletter Section */
.newsletter-section {
    margin: 80px 0;
}

.newsletter-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 60px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    color: white;
}

.newsletter-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.newsletter-content p {
    font-size: 16px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
}

.newsletter-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.newsletter-form button {
    padding: 15px 30px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-slide {
        grid-template-columns: 1fr;
        padding: 40px;
        min-height: 400px;
    }
    
    .hero-content h2 {
        font-size: 32px;
    }
    
    .hero-image {
        display: none;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .newsletter-card {
        flex-direction: column;
        padding: 40px 30px;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }
}
   
/* ===========================
   HEADER
   =========================== */

.header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) 0;
}

.logo h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    text-decoration: none;
    transition: transform var(--transition-fast);
    display: inline-block;
}

.logo a:hover {
    transform: scale(1.05);
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 13px 50px 13px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    transition: all var(--transition-base);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 90, 75, 0.1);
}

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    transition: all var(--transition-base);
}

.search-bar button:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.suggestion-item:hover {
    background: var(--gray-50);
}

.suggestion-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius);
}

.suggestion-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
}

.suggestion-price {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: var(--spacing-md);
}

.btn-icon {
    position: relative;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    transition: all var(--transition-base);
    border-radius: var(--radius);
}

.btn-icon:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.btn-icon .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: white;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    box-shadow: var(--shadow-sm);
}

/* ===========================
   NAVIGATION
   =========================== */

.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--border-color);
}

.nav-categories {
    position: relative;
}

.btn-categories {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 11px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-categories:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.category-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    min-width: 280px;
    padding: var(--spacing-sm) 0;
    z-index: 100;
    max-height: 500px;
    overflow-y: auto;
}

.category-item {
    position: relative;
}

.category-item > a {
    display: block;
    padding: 12px var(--spacing-lg);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.category-item > a:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    padding-left: 24px;
}

.subcategories {
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    min-width: 240px;
    padding: var(--spacing-sm) 0;
    display: none;
    margin-left: 8px;
}

.category-item:hover .subcategories {
    display: block;
}

.subcategories a {
    display: block;
    padding: 10px var(--spacing-lg);
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.subcategories a:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    padding-left: 24px;
}

.nav-links {
    display: flex;
    gap: var(--spacing-xl);
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition-base);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-base);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===========================
   MAIN CONTENT
   =========================== */

.main-content {
    min-height: calc(100vh - 400px);
    padding: var(--spacing-2xl) 0;
}

/* Loading State */
.loading {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--spacing-lg);
}

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

.loading p {
    color: var(--text-light);
    font-weight: 500;
}

/* ===========================
   PRODUCTS SECTION
   =========================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

.section-header h2 span {
    font-size: 18px;
    color: var(--text-light);
    font-weight: 500;
}

/* Filter & Sort */
.filter-sort {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.view-mode {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius);
}

.view-mode button {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.view-mode button.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.filter-sort select {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--white);
}

.filter-sort select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 90, 75, 0.1);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.products-grid.list {
    grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.product-image {
    position: relative;
    display: block;
    padding-top: 100%;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

/* Badges */
.badge-discount,
.badge-featured,
.badge-stock-out {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-md);
    z-index: 1;
}

.badge-discount {
    background: var(--danger-color);
}

.badge-featured {
    top: 52px;
    background: var(--primary-color);
}

.badge-stock-out {
    background: var(--gray-600);
}

/* Product Info */
.product-info {
    padding: var(--spacing-md);
}

.product-brand {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
    min-height: 42px;
}

.product-name a {
    color: var(--text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-base);
}

.product-name a:hover {
    color: var(--primary-color);
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--spacing-md);
}

.stars {
    display: flex;
    gap: 2px;
}

.stars span {
    font-size: 14px;
    color: var(--gray-300);
    transition: color var(--transition-fast);
}

.stars span.filled {
    color: #fbbf24;
}

.rating-count {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

/* Price */
.product-price {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.old-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.current-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
}

/* Add to Cart Button */
.btn-add-cart {
    width: 100%;
    padding: 13px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-add-cart:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add-cart:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

/* List View */
.products-grid.list .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-lg);
}

.products-grid.list .product-image {
    padding-top: 0;
    height: 200px;
}

.products-grid.list .product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ===========================
   PAGINATION & LOAD MORE
   =========================== */

.load-more {
    text-align: center;
    margin-top: var(--spacing-2xl);
}

.btn-load-more {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 16px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-load-more:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-load-more:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-2xl);
    flex-wrap: wrap;
}

.btn-page,
.btn-page-num {
    padding: 10px 16px;
    background: var(--white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-weight: 600;
    transition: all var(--transition-base);
    min-width: 44px;
}

.btn-page:hover:not(:disabled),
.btn-page-num:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(230, 90, 75, 0.05);
}

.btn-page-num.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-page:disabled {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: var(--spacing-xs);
}

/* ===========================
   CART SIDEBAR
   =========================== */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-slow);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.cart-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.btn-close {
    background: var(--gray-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    transition: all var(--transition-base);
}

.btn-close:hover {
    background: var(--gray-200);
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

/* Custom Scrollbar */
.cart-items::-webkit-scrollbar {
    width: 8px;
}

.cart-items::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.empty-cart {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.empty-cart svg {
    margin: 0 auto var(--spacing-lg);
    color: var(--gray-300);
}

.empty-cart p {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.empty-cart small {
    color: var(--text-light);
}

/* Cart Item */
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
}

.item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
}

.item-price {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.item-quantity button {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-color);
    transition: all var(--transition-base);
}

.item-quantity button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.item-quantity button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.item-quantity span {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.item-total {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: all var(--transition-base);
}

.btn-remove:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

.btn-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cart Footer */
.cart-footer {
    border-top: 2px solid var(--border-color);
    padding: var(--spacing-lg);
    background: var(--gray-50);
}

.cart-summary {
    margin-bottom: var(--spacing-lg);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    font-size: 15px;
}

.summary-row span:first-child {
    color: var(--text-light);
}

.summary-row span:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

.summary-row.discount span:last-child {
    color: var(--success-color);
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 2px solid var(--border-color);
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--success-color);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 16px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-checkout:hover {
    background: #059669;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1500;
    backdrop-filter: blur(2px);
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===========================
   TOAST NOTIFICATIONS
   =========================== */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    animation: slideInRight var(--transition-base);
    border-left: 4px solid var(--gray-300);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

.toast-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    font-weight: 500;
}

.toast-content svg {
    flex-shrink: 0;
}

.toast.success .toast-content svg {
    color: var(--success-color);
}

.toast.error .toast-content svg {
    color: var(--danger-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: all var(--transition-base);
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--text-dark);
}

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

/* ===========================
   FOOTER
   =========================== */

.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-2xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
    margin-bottom: var(--spacing-md);
    font-size: 18px;
    font-weight: 700;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-base);
    display: inline-block;
}

.footer-section a:hover {
    color: white;
    transform: translateX(4px);
}

/* Social Links */
.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-4px);
}

/* Payment Icons */
.payment-icons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.payment-icons img {
    height: 32px;
    border-radius: var(--radius-sm);
    background: white;
    padding: 6px;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.footer-bottom p {
    margin-bottom: var(--spacing-xs);
}

.footer-bottom a {
    color: var(--primary-color);
    transition: color var(--transition-base);
}

.footer-bottom a:hover {
    color: var(--primary-light);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .search-bar {
        max-width: 100%;
    }
    
    .nav {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-sort {
        flex-wrap: wrap;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--spacing-md);
    }
    
    .products-grid.list {
        grid-template-columns: 1fr;
    }
    
    .products-grid.list .product-card {
        grid-template-columns: 120px 1fr;
    }
    
    .products-grid.list .product-image {
        height: 120px;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-name {
        font-size: 14px;
        min-height: 38px;
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .btn-add-cart {
        padding: 10px;
        font-size: 13px;
    }
}

/* ===========================
   UTILITIES
   =========================== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

/* Print Styles */
@media print {
    .header,
    .nav,
    .cart-sidebar,
    .footer,
    .toast-container {
        display: none !important;
    }
}