/* CoreSpaceX Premium Gadgets - Main Stylesheet
 * Modern E-Commerce Design System
 */

/* ========================================
   CSS Variables / Design Tokens
   ======================================== */
:root {
    /* Primary Colors */
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --primary-50: #fff7ed;
    --primary-100: #ffedd5;
    --primary-200: #fed7aa;
    
    /* Neutral Colors */
    --background: #ffffff;
    --foreground: #0f172a;
    --muted: #64748b;
    --muted-foreground: #94a3b8;
    --border: #e2e8f0;
    --input: #f1f5f9;
    --card: #ffffff;
    --card-foreground: #0f172a;
    
    /* Status Colors */
    --success: #22c55e;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px (0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

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

ul, ol {
    list-style: none;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }
}

/* ========================================
   Layout Components
   ======================================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-lg {
    max-width: 1400px;
}

.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--muted);
    font-size: 1.125rem;
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
    .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { 
        grid-template-columns: 1fr; 
    }
}

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* ========================================
   Header & Navigation
   ======================================== */
.top-bar {
    background: var(--foreground);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-bar a:hover {
    color: var(--primary);
}

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

.header-main {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--input);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.search-box button {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.header-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: var(--foreground);
    transition: var(--transition);
}

.header-action-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.header-action-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Navigation */
.category-nav {
    background: var(--foreground);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.category-nav-list {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    min-width: max-content;
    padding: 0 1rem;
}

.category-nav-link {
    display: block;
    padding: 0.875rem 1.25rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.category-nav-link:hover,
.category-nav-link.active {
    color: white;
    border-bottom-color: var(--primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    padding: 0.5rem;
    color: var(--foreground);
}

@media (max-width: 968px) {
    .search-box {
        order: 3;
        max-width: none;
        flex-basis: 100%;
        margin-top: 0.5rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .category-nav-list {
        justify-content: flex-start;
    }
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-50) 0%, white 50%, var(--primary-100) 100%);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-200) 0%, transparent 70%);
    opacity: 0.5;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-text h1 span {
    color: var(--primary);
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    animation: float 3s ease-in-out infinite;
}

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

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        order: -1;
    }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
    line-height: 1.5;
}

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

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

.btn-secondary {
    background: var(--foreground);
    color: white;
    border-color: var(--foreground);
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    background: var(--input);
    color: var(--foreground);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

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

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-body {
    padding: 1.25rem;
}

.card-img {
    aspect-ratio: 1;
    object-fit: cover;
    width: 100%;
    background: var(--input);
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--input);
}

.card-img-wrapper img {
    aspect-ratio: 1;
    object-fit: cover;
    width: 100%;
    transition: transform 0.3s ease;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* Product Card */
.product-card {
    position: relative;
}

.product-card .card-img-wrapper {
    position: relative;
}

.product-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    z-index: 10;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.badge-new {
    background: var(--success);
    color: white;
}

.badge-trending {
    background: var(--primary);
    color: white;
}

.badge-outofstock {
    background: var(--muted);
    color: white;
}

.product-card .product-info {
    padding: 1rem;
}

.product-brand {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.stars {
    display: flex;
    color: #fbbf24;
    font-size: 0.875rem;
}

.rating-count {
    font-size: 0.8125rem;
    color: var(--muted);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
}

.price-original {
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: line-through;
}

.price-savings {
    font-size: 0.8125rem;
    color: var(--success);
    font-weight: 500;
}

.product-card-actions {
    display: flex;
    gap: 0.5rem;
}

.product-card-actions .btn {
    flex: 1;
}

.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

/* Category Card */
.category-card {
    text-align: center;
    padding: 2rem 1rem;
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--primary-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    transition: var(--transition);
}

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

.category-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-card p {
    font-size: 0.8125rem;
    color: var(--muted);
}

/* ========================================
   Features Section
   ======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.feature-item:hover {
    background: var(--primary-50);
    transform: translateY(-4px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.feature-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--muted);
}

@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Promo Banner
   ======================================== */
.promo-banner {
    background: linear-gradient(135deg, var(--foreground) 0%, #1e293b 100%);
    color: white;
    padding: 3rem 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.promo-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.3;
}

.promo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.promo-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.promo-text p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.promo-image {
    display: flex;
    justify-content: center;
}

.promo-image img {
    max-width: 300px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

@media (max-width: 768px) {
    .promo-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .promo-image {
        order: -1;
    }
}

/* ========================================
   Reviews/Testimonials
   ======================================== */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.review-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.review-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.review-stars {
    color: #fbbf24;
    margin-bottom: 0.75rem;
}

.review-text {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1rem;
    font-style: italic;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.review-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.review-date {
    font-size: 0.8125rem;
    color: var(--muted);
}

@media (max-width: 768px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--foreground);
    color: rgba(255,255,255,0.8);
    padding: 4rem 0 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo {
    color: white;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-column h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-contact .icon {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-bottom {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
}

.payment-methods {
    display: flex;
    gap: 0.75rem;
}

.payment-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.form-help {
    color: var(--muted);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 2.75rem;
}

.input-group .input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-check label {
    font-size: 0.9rem;
    cursor: pointer;
}

/* Switch/Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 26px;
    transition: var(--transition);
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

/* ========================================
   Tables
   ======================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--input);
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--primary-50);
}

.table img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* ========================================
   Badges/Status
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: capitalize;
}

.status-pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-confirmed,
.status-processing {
    background: var(--info-bg);
    color: var(--info);
}

.status-shipped {
    background: #dbeafe;
    color: #2563eb;
}

.status-delivered,
.status-paid {
    background: var(--success-bg);
    color: var(--success);
}

.status-cancelled,
.status-failed,
.status-refunded {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-notified {
    background: #ede9fe;
    color: #7c3aed;
}

.status-resolved {
    background: #d1fae5;
    color: #059669;
}

/* ========================================
   Modal/Dialog
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--input);
    color: var(--foreground);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* ========================================
   Cart Sidebar
   ======================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

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

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-count {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: var(--transition);
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cart-item-remove {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-left: auto;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.cart-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--input);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cart-savings {
    color: var(--success);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ========================================
   Admin Layout
   ======================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--foreground);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-sidebar-header .logo {
    font-size: 1.25rem;
}

.admin-nav {
    padding: 1rem 0;
}

.admin-nav-section {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.admin-nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-nav-link.active {
    background: var(--primary);
    color: white;
}

.admin-nav-link .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    background: #f8fafc;
    min-height: 100vh;
}

.admin-topbar {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-page-header {
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid var(--border);
}

.admin-page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-page-header p {
    color: var(--muted);
    margin: 0.25rem 0 0;
}

.admin-content {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-icon.revenue { background: #fef3c7; color: #d97706; }
.stat-card-icon.orders { background: #dbeafe; color: #2563eb; }
.stat-card-icon.products { background: #dcfce7; color: #16a34a; }
.stat-card-icon.customers { background: #fce7f3; color: #db2777; }
.stat-card-icon.notifications { background: #f3e8ff; color: #9333ea; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

.stat-label {
    font-size: 0.875rem;
    color: var(--muted);
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Alerts/Notifications
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: var(--success-bg);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

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

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

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

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

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37,211,102,0.4);
}
