/* ============================================
   ElectroGlobal - Global Smart Appliance Platform
   Complete Design System & Page Styles
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; line-height: 1.6; color: var(--text-primary);
  background: var(--bg-primary); transition: background 0.2s, color 0.2s;
  min-height: 100vh; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; }

/* === DESIGN TOKENS === */
:root {
  --primary: #2563EB; --primary-hover: #1D4ED8; --primary-light: #DBEAFE; --primary-50: #EFF6FF;
  --accent: #10B981; --accent-hover: #059669; --accent-light: #D1FAE5;
  --promo: #F59E0B; --promo-hover: #D97706; --promo-light: #FEF3C7;
  --danger: #EF4444; --danger-light: #FEE2E2;
  --bg-primary: #F5F7FA; --bg-secondary: #FFFFFF; --bg-tertiary: #F0F2F5;
  --text-primary: #0F172A; --text-secondary: #475569; --text-tertiary: #94A3B8;
  --border: #E2E8F0; --border-light: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
  --radius-sm: 4px; --radius: 6px; --radius-md: 8px; --radius-lg: 12px;
  --header-h: 64px; --subnav-h: 44px; --sidebar-w: 240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ai-gradient: linear-gradient(135deg, #2563EB, #7C3AED);
}
[data-theme="dark"] {
  --bg-primary: #0A0A0F; --bg-secondary: #141418; --bg-tertiary: #1A1A20;
  --text-primary: #F1F5F9; --text-secondary: #94A3B8; --text-tertiary: #64748B;
  --border: #1E1E24; --border-light: #16161C;
  --primary-light: #1E3A5F; --accent-light: #064E3B; --promo-light: #451A03;
  --danger-light: #450A0A; --primary-50: #0F1B2D;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
}

/* === UTILITIES === */
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grid { display: grid; }
.text-sm { font-size: 12px; } .text-base { font-size: 14px; } .text-lg { font-size: 16px; }
.text-xl { font-size: 20px; } .text-2xl { font-size: 24px; } .text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; } .text-5xl { font-size: 48px; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-primary-c { color: var(--primary); } .text-accent-c { color: var(--accent); }
.text-promo-c { color: var(--promo); } .text-danger-c { color: var(--danger); }
.text-muted { color: var(--text-secondary); } .text-faint { color: var(--text-tertiary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); font-weight: 500; font-size: 14px; transition: all 0.15s var(--ease); white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-promo { background: var(--promo); color: #fff; }
.btn-promo:hover { background: var(--promo-hover); }
.btn-outline { border: 1px solid var(--border); background: var(--bg-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-tertiary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius); }
.btn-ai { background: var(--ai-gradient); color: #fff; }
.btn-ai:hover { box-shadow: 0 4px 15px rgba(37,99,235,0.4); }

/* === BADGES & TAGS === */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-promo { background: var(--promo-light); color: var(--promo); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px; background: var(--bg-tertiary); color: var(--text-secondary); }

/* === CARDS === */
.card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all 0.2s var(--ease); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 16px; }
.card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg-tertiary); }

/* === FORM ELEMENTS === */
.input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-secondary); transition: border-color 0.15s; outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.checkbox { width: 18px; height: 18px; accent-color: var(--primary); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* === HEADER === */
.header { position: sticky; top: 0; z-index: 100; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.header-top { background: var(--bg-tertiary); padding: 6px 0; font-size: 12px; color: var(--text-secondary); }
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-top-links { display: flex; gap: 16px; }
.header-top-links a:hover { color: var(--primary); }
.header-main { padding: 12px 0; }
.header-inner { display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.logo em { font-style: normal; color: var(--accent); }
.header-search { flex: 1; display: flex; align-items: center; gap: 0; max-width: 600px; border: 2px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.15s; }
.header-search:focus-within { border-color: var(--primary); }
.header-search svg { margin-left: 12px; color: var(--text-tertiary); flex-shrink: 0; }
.header-search input { flex: 1; border: none; padding: 10px 12px; background: transparent; outline: none; font-size: 14px; }
.search-btn { padding: 10px 20px; background: var(--primary); color: #fff; font-weight: 500; border: none; cursor: pointer; transition: background 0.15s; }
.search-btn:hover { background: var(--primary-hover); }
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.header-action-btn { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); transition: background 0.15s; }
.header-action-btn:hover { background: var(--bg-tertiary); }
.action-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.theme-toggle { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.theme-toggle:hover { background: var(--bg-tertiary); }

/* === NAV === */
.header-nav { border-top: 1px solid var(--border); }
.header-nav .container { display: flex; align-items: center; gap: 0; overflow-x: auto; scrollbar-width: none; }
.header-nav .container::-webkit-scrollbar { display: none; }
.nav-link { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; transition: color 0.15s; border-bottom: 2px solid transparent; }
.nav-link:hover, .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-link-hot { position: relative; }
.nav-link-hot::after { content: 'HOT'; position: absolute; top: 4px; right: 2px; font-size: 8px; padding: 1px 4px; background: var(--danger); color: #fff; border-radius: 3px; font-weight: 700; }

/* === SUBNAV === */
.subnav { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 0; }
.subnav .container { display: flex; align-items: center; gap: 24px; padding-top: 8px; padding-bottom: 8px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-tertiary); }

/* === MAIN CONTENT === */
.main { min-height: calc(100vh - var(--header-h) - 80px); padding: 24px 0; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === HERO SECTION === */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 32px; background: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%); min-height: 400px; display: flex; align-items: center; }
.hero-content { position: relative; z-index: 2; padding: 48px; max-width: 600px; color: #fff; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: rgba(255,255,255,0.15); border-radius: 100px; font-size: 12px; font-weight: 600; margin-bottom: 16px; backdrop-filter: blur(4px); }
.hero-title { font-size: 42px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero-desc { font-size: 16px; opacity: 0.85; margin-bottom: 28px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15); }
.hero-stat-value { font-size: 28px; font-weight: 700; }
.hero-stat-label { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.hero-bg { position: absolute; inset: 0; opacity: 0.15; }
.hero-bg svg { width: 100%; height: 100%; }

/* === SECTION === */
.section { margin-bottom: 40px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 700; }
.section-more { font-size: 13px; color: var(--primary); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.section-more:hover { text-decoration: underline; }

/* === PRODUCT GRID === */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all 0.2s var(--ease); cursor: pointer; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product-card-img { position: relative; aspect-ratio: 1; background: var(--bg-tertiary); overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease); }
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }
.product-card-fav { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.product-card:hover .product-card-fav { opacity: 1; }
.product-card-body { padding: 12px; }
.product-card-brand { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.product-card-name { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { display: flex; align-items: baseline; gap: 8px; }
.product-card-price .current { font-size: 18px; font-weight: 700; color: var(--danger); }
.product-card-price .original { font-size: 12px; color: var(--text-tertiary); text-decoration: line-through; }
.product-card-price .discount { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 1px 6px; border-radius: 3px; }
.product-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--text-tertiary); }
.product-card-rating { display: flex; align-items: center; gap: 2px; }
.stars { color: var(--promo); font-size: 12px; }

/* === CATEGORY CARDS === */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all 0.2s var(--ease); cursor: pointer; text-align: center; }
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-img-wrap { width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; }
.category-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease); }
.category-card:hover .category-img-wrap img { transform: scale(1.08); }
.category-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--primary-50); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.category-name { font-size: 13px; font-weight: 500; }
.category-count { font-size: 11px; color: var(--text-tertiary); }

/* === FLASH SALE === */
.flash-sale-bar { display: flex; align-items: center; gap: 16px; padding: 16px 24px; background: linear-gradient(135deg, #DC2626, #EF4444); border-radius: var(--radius-lg); color: #fff; margin-bottom: 20px; }
.flash-sale-timer { display: flex; gap: 4px; align-items: center; }
.flash-timer-block { background: rgba(0,0,0,0.3); padding: 4px 8px; border-radius: var(--radius-sm); font-weight: 700; font-size: 18px; min-width: 36px; text-align: center; }
.flash-timer-sep { font-weight: 700; }
.flash-progress { height: 6px; background: rgba(255,255,255,0.3); border-radius: 3px; overflow: hidden; flex: 1; max-width: 120px; }
.flash-progress-bar { height: 100%; background: #fff; border-radius: 3px; transition: width 0.3s; }

/* === BRAND SECTION === */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.brand-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all 0.2s var(--ease); cursor: pointer; }
.brand-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.brand-logo { width: 48px; height: 48px; border-radius: var(--radius); background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--primary); flex-shrink: 0; }
.brand-info { flex: 1; min-width: 0; }
.brand-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.brand-desc { font-size: 11px; color: var(--text-tertiary); }

/* === AI SECTION === */
.ai-section { background: var(--ai-gradient); border-radius: var(--radius-lg); padding: 40px; color: #fff; position: relative; overflow: hidden; }
.ai-section::before { content: ''; position: absolute; top: -50%; right: -20%; width: 400px; height: 400px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.ai-section-title { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.ai-section-desc { font-size: 15px; opacity: 0.9; margin-bottom: 24px; max-width: 500px; }
.ai-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ai-feature-card { background: rgba(255,255,255,0.12); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-md); padding: 20px; transition: all 0.2s; cursor: pointer; }
.ai-feature-card:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.ai-feature-icon { font-size: 28px; margin-bottom: 10px; }
.ai-feature-name { font-weight: 600; margin-bottom: 4px; }
.ai-feature-desc { font-size: 12px; opacity: 0.8; }

/* === PRODUCT DETAIL === */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.pd-gallery { position: sticky; top: calc(var(--header-h) + 24px); }
.pd-main-img { width: 100%; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-tertiary); margin-bottom: 12px; }
.pd-main-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 8px; }
.pd-thumb { width: 64px; height: 64px; border-radius: var(--radius); border: 2px solid var(--border); overflow: hidden; cursor: pointer; transition: border-color 0.15s; }
.pd-thumb.active, .pd-thumb:hover { border-color: var(--primary); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { padding-top: 8px; }
.pd-brand { font-size: 13px; color: var(--primary); font-weight: 500; margin-bottom: 8px; }
.pd-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.pd-rating { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 13px; color: var(--text-secondary); }
.pd-price-box { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 20px; }
.pd-price { font-size: 32px; font-weight: 800; color: var(--danger); }
.pd-price-orig { font-size: 16px; color: var(--text-tertiary); text-decoration: line-through; margin-left: 12px; }
.pd-price-discount { display: inline-block; background: var(--danger-light); color: var(--danger); padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; margin-left: 8px; }
.pd-section { margin-bottom: 20px; }
.pd-section-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.pd-options { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-option { padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.pd-option:hover, .pd-option.active { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.pd-qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; width: fit-content; }
.pd-qty button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-tertiary); transition: background 0.15s; }
.pd-qty button:hover { background: var(--border); }
.pd-qty input { width: 50px; height: 36px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--bg-secondary); outline: none; }
.pd-actions { display: flex; gap: 12px; margin-top: 24px; }
.pd-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.pd-feature { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--bg-tertiary); border-radius: var(--radius); font-size: 12px; color: var(--text-secondary); }
.pd-feature svg { flex-shrink: 0; color: var(--accent); }

/* === CART === */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: flex; gap: 16px; padding: 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); }
.cart-item-img { width: 100px; height: 100px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; background: var(--bg-tertiary); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; margin-bottom: 4px; }
.cart-item-spec { font-size: 12px; color: var(--text-tertiary); margin-bottom: 8px; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item-price { font-size: 16px; font-weight: 700; color: var(--danger); }
.cart-summary { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; position: sticky; top: calc(var(--header-h) + 24px); }
.cart-summary-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.cart-summary-total { display: flex; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px; font-size: 18px; font-weight: 700; }
.cart-summary-total .total-price { color: var(--danger); }

/* === SIDEBAR LAYOUT (Dashboard/Merchant/Admin) === */
.dashboard-layout { display: flex; min-height: calc(100vh - var(--header-h)); }
.sidebar { width: var(--sidebar-w); background: var(--bg-secondary); border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; flex-shrink: 0; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title { padding: 0 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: 8px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 13px; color: var(--text-secondary); transition: all 0.15s; cursor: pointer; }
.sidebar-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.sidebar-link.active { background: var(--primary-50); color: var(--primary); font-weight: 500; border-right: 3px solid var(--primary); }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-link-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 100px; font-weight: 600; }
.dashboard-content { flex: 1; padding: 24px; overflow-y: auto; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.dashboard-title { font-size: 24px; font-weight: 700; }

/* === STAT CARDS === */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-card-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.green { background: var(--accent-light); color: var(--accent); }
.stat-card-icon.amber { background: var(--promo-light); color: var(--promo); }
.stat-card-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-card-change { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 2px; }
.stat-card-change.up { color: var(--accent); }
.stat-card-change.down { color: var(--danger); }
.stat-card-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-card-label { font-size: 13px; color: var(--text-secondary); }

/* === CHART PLACEHOLDER === */
.chart-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; }
.chart-card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.chart-placeholder { height: 280px; background: var(--bg-tertiary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 0 20px; width: 100%; }
.chart-bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; transition: height 0.5s var(--ease); min-width: 20px; opacity: 0.8; }
.chart-bar:hover { opacity: 1; }
.chart-line { width: 100%; height: 100%; }

/* === TABLE === */
.table-wrapper { overflow-x: auto; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); background: var(--bg-tertiary); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.table tr:hover td { background: var(--bg-tertiary); }
.table tr:last-child td { border-bottom: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.green { background: var(--accent); }
.status-dot.amber { background: var(--promo); }
.status-dot.red { background: var(--danger); }
.status-dot.blue { background: var(--primary); }

/* === AUTH PAGES === */
.auth-container { max-width: 440px; margin: 40px auto; padding: 0 24px; }
.auth-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; }
.auth-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-divider { display: flex; align-items: center; gap: 16px; margin: 20px 0; color: var(--text-tertiary); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-social { display: flex; gap: 12px; }
.auth-social-btn { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; transition: all 0.15s; }
.auth-social-btn:hover { background: var(--bg-tertiary); border-color: var(--primary); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); font-weight: 500; }

/* === RECYCLING / AI ESTIMATE === */
.recycle-hero { background: linear-gradient(135deg, #065F46, #10B981); border-radius: var(--radius-lg); padding: 48px; color: #fff; margin-bottom: 32px; position: relative; overflow: hidden; }
.recycle-hero::after { content: ''; position: absolute; top: -30%; right: -10%; width: 300px; height: 300px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.recycle-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.recycle-step { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; text-align: center; position: relative; }
.recycle-step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 12px; }
.recycle-step-title { font-weight: 600; margin-bottom: 6px; }
.recycle-step-desc { font-size: 12px; color: var(--text-secondary); }
.estimate-form { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; max-width: 600px; margin: 0 auto; }
.estimate-result { background: var(--accent-light); border: 1px solid var(--accent); border-radius: var(--radius-md); padding: 24px; text-align: center; margin-top: 20px; }
.estimate-price { font-size: 36px; font-weight: 800; color: var(--accent); }

/* === ENTERPRISE === */
.enterprise-hero { background: linear-gradient(135deg, #1E3A5F, #2563EB); border-radius: var(--radius-lg); padding: 48px; color: #fff; margin-bottom: 32px; }
.enterprise-benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }
.enterprise-benefit { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }
.enterprise-benefit-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 12px; }
.enterprise-benefit-title { font-weight: 600; margin-bottom: 6px; }
.enterprise-benefit-desc { font-size: 13px; color: var(--text-secondary); }

/* === FOOTER === */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 40px; margin-bottom: 32px; }
.footer-brand { }
.footer-brand-name { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.footer-brand-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 36px; height: 36px; border-radius: var(--radius); background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-col-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); transition: color 0.15s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-tertiary); }
.footer-payments { display: flex; gap: 8px; }
.footer-payment { padding: 4px 10px; background: var(--bg-tertiary); border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; }

/* === AI CHAT WIDGET === */
.ai-chat-btn { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--ai-gradient); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37,99,235,0.4); z-index: 200; transition: transform 0.2s; cursor: pointer; }
.ai-chat-btn:hover { transform: scale(1.08); }
.ai-chat-panel { position: fixed; bottom: 90px; right: 24px; width: 380px; height: 520px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); z-index: 200; display: none; flex-direction: column; overflow: hidden; }
.ai-chat-panel.open { display: flex; animation: fadeIn 0.2s var(--ease); }
.ai-chat-header { padding: 16px; background: var(--ai-gradient); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.ai-chat-header-title { font-weight: 600; }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.ai-chat-msg.bot { background: var(--bg-tertiary); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-chat-msg.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-chat-input { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.ai-chat-input input { flex: 1; border: 1px solid var(--border); border-radius: 100px; padding: 8px 16px; outline: none; background: var(--bg-tertiary); }
.ai-chat-input input:focus { border-color: var(--primary); }
.ai-chat-input button { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }

/* === TABS === */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* === PAGINATION === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); font-size: 13px; transition: all 0.15s; }
.page-btn:hover { background: var(--bg-tertiary); }
.page-btn.active { background: var(--primary); color: #fff; }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* === TOAST === */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s var(--ease); }
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* === MODAL === */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 250; display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg-secondary); border-radius: var(--radius-lg); width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-xl); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.modal-close:hover { background: var(--bg-tertiary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* === SEARCH PAGE === */
.search-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.search-filters { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; height: fit-content; position: sticky; top: calc(var(--header-h) + 24px); }
.filter-group { margin-bottom: 20px; }
.filter-group-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.filter-option:hover { color: var(--text-primary); }
.search-results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search-results-count { font-size: 14px; color: var(--text-secondary); }
.search-sort { display: flex; gap: 8px; }
.sort-btn { padding: 6px 12px; border-radius: var(--radius); font-size: 12px; border: 1px solid var(--border); background: var(--bg-secondary); }
.sort-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* === COMMUNITY === */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.community-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.community-card-img { aspect-ratio: 16/9; background: var(--bg-tertiary); }
.community-card-body { padding: 16px; }
.community-card-title { font-weight: 600; margin-bottom: 6px; }
.community-card-excerpt { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.community-card-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-tertiary); }

/* === MEMBERSHIP === */
.membership-tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.membership-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; text-align: center; position: relative; overflow: hidden; }
.membership-card.featured { border-color: var(--primary); }
.membership-card.featured::before { content: 'POPULAR'; position: absolute; top: 12px; right: -28px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 32px; transform: rotate(45deg); }
.membership-tier-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.membership-price { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.membership-period { font-size: 12px; color: var(--text-tertiary); margin-bottom: 20px; }
.membership-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; text-align: left; }
.membership-feature { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.membership-feature svg { color: var(--accent); flex-shrink: 0; }

/* === RESPONSIVE === */
@media (max-width: 1280px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .hero-title { font-size: 32px; }
  .product-detail { grid-template-columns: 1fr; }
  .pd-gallery { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .search-layout { grid-template-columns: 1fr; }
  .search-filters { position: static; }
  .sidebar { width: 200px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .header-search { display: none; }
  .header-nav { display: none; }
  .hero { min-height: 300px; }
  .hero-content { padding: 24px; }
  .hero-title { font-size: 26px; }
  .hero-stats { gap: 16px; }
  .hero-stat-value { font-size: 22px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; padding: 12px; gap: 4px; }
  .sidebar-section { display: flex; gap: 4px; margin: 0; }
  .sidebar-section-title { display: none; }
  .sidebar-link { white-space: nowrap; padding: 8px 12px; border-radius: var(--radius); border-right: none !important; }
  .sidebar-link.active { border-right: none !important; background: var(--primary); color: #fff; }
  .stat-grid { grid-template-columns: 1fr; }
  .ai-features { grid-template-columns: 1fr 1fr; }
  .ai-chat-panel { width: calc(100% - 32px); right: 16px; bottom: 80px; }
  .pd-features { grid-template-columns: 1fr; }
  .enterprise-benefits { grid-template-columns: 1fr; }
  .membership-tiers { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-card-body { padding: 8px; }
  .product-card-name { font-size: 12px; }
  .product-card-price .current { font-size: 15px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-grid { grid-template-columns: 1fr; }
  .ai-features { grid-template-columns: 1fr; }
  .recycle-steps { grid-template-columns: 1fr; }
}
