/* ══════════════════════════════════════════════════════════
   World Compass – Design System
   ══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --primary:     #1B2A41;
  --primary-d:   #0f1d2e;
  --accent:      #FF6B2B;
  --accent-d:    #e55b1f;
  --blue:        #5469d4;
  --success:     #10b981;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --info:        #06b6d4;
  --bg:          #f0f2f5;
  --bg-2:        #f8fafc;
  --bg-card:     #ffffff;
  --text:        #1a202c;
  --text-2:      #4a5568;
  --text-3:      #718096;
  --border:      #e2e8f0;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --transition:  .2s ease;
  --font:        'Inter', system-ui, sans-serif;
  --header-h:    76px;
  --topbar-h:    36px;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; }

/* ── Utility ───────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }
.flex   { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-3); font-size: .875rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top:.5rem; } .mt-2 { margin-top:1rem; } .mt-3 { margin-top:1.5rem; }
.mb-1 { margin-bottom:.5rem; } .mb-2 { margin-bottom:1rem; } .mb-3 { margin-bottom:1.5rem; }
.hidden { display: none !important; }

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  background: var(--primary-d);
  color: #a0aec0;
  font-size: .78rem;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-img { height: 56px; width: auto; object-fit: contain; border-radius: 8px; display: block; }
.footer-logo-img { height: 72px; width: auto; object-fit: contain; border-radius: 10px; margin-bottom: .75rem; display: block; }
@media (max-width: 680px) { .logo-img { height: 44px; } }

/* Search */
.search-form { flex: 1; max-width: 600px; }
.search-wrap {
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.search-input {
  flex: 1;
  padding: .65rem 1.25rem;
  border: none;
  font-size: .95rem;
  background: #fff;
  outline: none;
}
.search-btn {
  padding: 0 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  border: none;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--accent-d); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex-shrink: 0; }
.hdr-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .3rem;
  padding: .5rem .8rem;
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
}
.hdr-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.hdr-icon { font-size: 1.3rem; line-height: 1; }
/* Cart link — distinct style */
.cart-link {
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: .45rem 1rem;
  font-weight: 600;
}
.cart-link:hover { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
/* Admin link — navy color, before cart */
.admin-link {
  background: #334155;
  color: #e2e8f0 !important;
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.1);
}
.admin-link:hover { background: #475569; color: #fff !important; }
/* Seller link */
.seller-link {
  background: #065f46;
  color: #d1fae5 !important;
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.1);
}
.seller-link:hover { background: #047857; color: #fff !important; }
/* Flash nav link */
.flash-nav-link {
  color: #dc2626 !important;
  font-weight: 700;
  background: rgba(220,38,38,.12);
  border-radius: var(--radius-sm);
  padding: .35rem .9rem;
}
/* Flash product card badges & countdown */
.badge-flash {
  background: #dc2626 !important;
  color: #fff !important;
  font-weight: 800;
  font-size: .68rem;
  letter-spacing: .3px;
}
.product-card--flash { border: 2px solid #dc2626 !important; }
.flash-countdown {
  font-size: .73rem;
  color: #dc2626;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .3rem;
  margin: .25rem 0;
}
.flash-countdown::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: #dc2626;
  border-radius: 50%;
  animation: flash-blink 1s infinite;
}
@keyframes flash-blink { 0%,100%{opacity:1} 50%{opacity:.2} }
/* Admin table */
.a-table { width:100%;border-collapse:collapse }
.a-table th { background:#f8fafc;padding:.65rem 1rem;text-align:left;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--text-2);border-bottom:1px solid var(--border) }
.a-table td { padding:.7rem 1rem;border-bottom:1px solid var(--border);font-size:.87rem;vertical-align:middle }
.a-table tr:last-child td { border-bottom:none }
.a-table tr:hover td { background:#fafafa }
/* Cart badge — inside cart-link, right side */
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: .2rem;
  padding: 0 4px;
  line-height: 1;
}
.mob-menu-btn { display: none; background: none; color: #fff; font-size: 1.5rem; padding: .5rem; }

/* ── Category Nav ──────────────────────────────────────── */
.cat-nav {
  background: var(--primary-d);
  border-bottom: 1px solid rgba(255,255,255,.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: .25rem;
  white-space: nowrap;
}
.cat-nav-link {
  color: #94a3b8;
  padding: .6rem .9rem;
  font-size: .82rem;
  border-radius: 4px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.cat-nav-link:hover, .cat-nav-link.active { color: #fff; background: rgba(255,255,255,.08); }

/* ── Main ──────────────────────────────────────────────── */
.site-main { flex: 1; }

/* ── Alerts / Flash ────────────────────────────────────── */
.flash-container { max-width: 1280px; margin: .75rem auto 0; padding: 0 1.25rem; }
.alert {
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: .75rem;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform:none; } }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info    { background: #e0f2fe; color: #0c4a6e; border-left: 4px solid var(--info); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .3px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,107,43,.4); }
.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover { background: var(--primary-d); }
.btn-outline   { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success   { background: var(--success); color: #fff; }
.btn-sm { padding: .45rem 1rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2.25rem; font-size: 1rem; }
.btn-full { width: 100%; border-radius: var(--radius-sm); }
.btn-cart {
  background: var(--primary);
  color: #fff;
  width: 100%;
  padding: .6rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  margin-top: .75rem;
  transition: all var(--transition);
}
.btn-cart:hover { background: var(--accent); transform: translateY(-1px); }
.btn-add-cart.loading { opacity: .6; pointer-events: none; }
.btn-add-cart.added { background: var(--success); }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-body { padding: 1.5rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; }

/* ── Product Card ──────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.product-img-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .4s ease;
  overflow: hidden;
}
.product-card:hover .product-img-placeholder { transform: scale(1.04); }
.product-img-placeholder svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,.15)); opacity: .85; }
.product-icon { font-size: 3.5rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.product-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.product-cat { font-size: .72rem; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .5px; }
.product-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-top: .1rem;
}
.product-name:hover { color: var(--accent); }
.product-desc { font-size: .78rem; color: var(--text-3); line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-rating { display: flex; align-items: center; gap: .4rem; font-size: .78rem; }
.stars { color: var(--warning); letter-spacing: 1px; }
.rating-count { color: var(--text-3); }
.product-price { display: flex; align-items: baseline; gap: .6rem; margin-top: .25rem; }
.price-current { font-size: 1.05rem; font-weight: 800; color: var(--accent); }
.price-old { font-size: .8rem; color: var(--text-3); text-decoration: line-through; }
.out-of-stock { font-size: .75rem; color: var(--danger); font-weight: 600; }

/* Badges */
.badge {
  position: absolute;
  top: .6rem;
  font-size: .68rem;
  font-weight: 700;
  padding: .25rem .55rem;
  border-radius: 4px;
  line-height: 1;
}
.badge-sale { left: .6rem; background: var(--danger); color: #fff; }
.badge-hot  { right: .6rem; background: var(--accent); color: #fff; }
.badge-new  { background: var(--success); color: #fff; }

/* ── Product Grid ──────────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 1.25rem; }
.products-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }

/* ── Page Hero ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #263550 50%, #1a3a5c 100%);
  color: #fff;
  padding: 5rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content:'';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero-tag { display: inline-block; background: rgba(255,107,43,.15); color: var(--accent); border: 1px solid rgba(255,107,43,.3); padding: .35rem .9rem; border-radius: 50px; font-size: .8rem; font-weight: 600; margin-bottom: 1.25rem; letter-spacing: .5px; }
.hero h1 { font-size: clamp(1.9rem,5vw,3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: .75rem; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.05rem; color: #94a3b8; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Section ───────────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  position: relative;
  padding-left: 1rem;
}
.section-title::before {
  content:'';
  position: absolute;
  left: 0; top: .15rem; bottom: .15rem;
  width: 4px;
  background: var(--accent);
  border-radius: 4px;
}
.section-link { font-size: .88rem; color: var(--accent); font-weight: 600; }
.section-link:hover { text-decoration: underline; }

/* ── Category Cards ────────────────────────────────────── */
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 1rem; }
.cat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
  display: block;
  text-decoration: none;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-img {
  width: 100%;
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  position: relative;
}
.cat-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.45) 100%);
}
.cat-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  padding: .65rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ── Stats Banner ──────────────────────────────────────── */
.stats-banner {
  background: var(--primary);
  color: #fff;
  padding: 2.5rem 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); text-align: center; gap: 1rem; }
.stat-number { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.stat-label  { font-size: .82rem; color: #94a3b8; margin-top: .25rem; }

/* ── Page Layout ───────────────────────────────────────── */
.page-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.75rem; }
.sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-h) + 4.5rem);
}
.sidebar-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: .5rem; }
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section h4 { font-size: .82rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .75rem; }
.filter-list li { margin-bottom: .4rem; }
.filter-list a { font-size: .88rem; color: var(--text-2); padding: .3rem .5rem; border-radius: 4px; display: block; transition: all var(--transition); }
.filter-list a:hover, .filter-list a.active { background: #fff0e8; color: var(--accent); font-weight: 600; }
.price-range { display: flex; gap: .5rem; }
.price-range input { flex: 1; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb {
  background: var(--bg-card);
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-3);
}
.breadcrumb-inner { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 .4rem; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── Product Detail ────────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.product-gallery {
  background: linear-gradient(135deg, var(--primary) 0%, #263550 100%);
  border-radius: var(--radius);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
}
.product-detail-info h1 { font-size: 1.65rem; font-weight: 800; line-height: 1.3; margin-bottom: .75rem; }
.detail-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.detail-price { font-size: 2rem; font-weight: 800; color: var(--accent); }
.detail-old-price { font-size: 1rem; color: var(--text-3); text-decoration: line-through; }
.detail-stock-ok  { color: var(--success); font-size: .88rem; font-weight: 600; }
.detail-stock-no  { color: var(--danger);  font-size: .88rem; font-weight: 600; }
.qty-input { display: flex; align-items: center; gap: 0; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.qty-input button { width: 40px; height: 40px; background: var(--bg); border: none; font-size: 1.2rem; font-weight: 700; transition: all var(--transition); }
.qty-input button:hover { background: var(--border); }
.qty-input input { width: 56px; height: 40px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font-size: .95rem; font-weight: 600; outline: none; }
.detail-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.tabs { margin-top: 3rem; }
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn { padding: .75rem 1.5rem; background: none; border: none; font-size: .9rem; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all var(--transition); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Reviews ───────────────────────────────────────────── */
.review-item { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.review-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.review-name { font-weight: 600; font-size: .9rem; }
.review-date { font-size: .78rem; color: var(--text-3); }
.review-text { font-size: .88rem; color: var(--text-2); }

/* ── Cart ──────────────────────────────────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-items { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cart-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 1.25rem; padding: 1.25rem; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item:last-child { border-bottom: none; }
.cart-img { width: 80px; height: 80px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.cart-item-name { font-weight: 600; font-size: .92rem; margin-bottom: .25rem; }
.cart-item-price { color: var(--accent); font-weight: 700; }
.cart-item-actions { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.cart-remove { color: var(--danger); font-size: .8rem; cursor: pointer; background: none; border: none; font-family: inherit; }
.cart-remove:hover { text-decoration: underline; }
.cart-summary { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; position: sticky; top: calc(var(--header-h) + 4.5rem); }
.cart-summary-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.summary-row { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .9rem; color: var(--text-2); }
.summary-row.total { font-size: 1.1rem; font-weight: 800; color: var(--text); border-top: 2px solid var(--border); margin-top: .75rem; padding-top: .75rem; }
.summary-row .free { color: var(--success); font-weight: 600; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(84,105,212,.12); }
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: .78rem; color: var(--text-3); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; cursor: pointer; }
.form-check input { width: 16px; height: 16px; cursor: pointer; }

/* ── Auth Page ─────────────────────────────────────────── */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 3rem 1.25rem; }
.auth-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; padding: 2.5rem; }
.auth-logo { text-align: center; font-size: 2rem; font-weight: 800; margin-bottom: .25rem; }
.auth-subtitle { text-align: center; color: var(--text-3); font-size: .88rem; margin-bottom: 2rem; }
.auth-divider { text-align: center; position: relative; margin: 1.25rem 0; color: var(--text-3); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content:''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-footer { text-align: center; font-size: .88rem; color: var(--text-3); margin-top: 1.25rem; }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ── Table ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.table th { background: var(--primary); color: #fff; padding: .9rem 1rem; text-align: left; font-weight: 600; font-size: .8rem; letter-spacing: .3px; }
table.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: #f8fafc; }

/* ── Status Badges ─────────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .7rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.status-pending    { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-shipped    { background: #e0e7ff; color: #3730a3; }
.status-delivered  { background: #d1fae5; color: #065f46; }
.status-cancelled  { background: #fee2e2; color: #991b1b; }

/* ── Pagination ────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2.5rem; }
.page-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; }

/* ── Empty State ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 5rem 1.25rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-title { font-size: 1.35rem; font-weight: 700; margin-bottom: .5rem; }
.empty-text  { color: var(--text-3); margin-bottom: 1.5rem; }

/* ── Profile ───────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.75rem; }
.profile-sidebar { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; height: fit-content; }
.profile-avatar { background: linear-gradient(135deg,var(--primary),var(--blue)); padding: 2rem 1.5rem; text-align: center; color: #fff; }
.avatar-circle { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto .75rem; border: 3px solid rgba(255,255,255,.3); }
.avatar-name { font-weight: 700; font-size: 1rem; }
.avatar-email { font-size: .78rem; color: #94a3b8; }
.profile-nav { padding: .75rem 0; }
.profile-nav a { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem; font-size: .9rem; color: var(--text-2); transition: all var(--transition); }
.profile-nav a:hover, .profile-nav a.active { background: #fff0e8; color: var(--accent); font-weight: 600; }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: #fff;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(120px);
  opacity: 0;
  transition: all .35s cubic-bezier(.68,-.55,.27,1.55);
  max-width: 340px;
  border-left: 4px solid var(--accent);
}
.toast.show { transform: none; opacity: 1; }

/* ── Back to top ───────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: all var(--transition);
  z-index: 9998;
}
.back-to-top.visible { opacity: 1; pointer-events: all; }
.back-to-top:hover { background: var(--accent); }

/* ── Footer ────────────────────────────────────────────── */
.site-footer { background: var(--primary); color: #94a3b8; margin-top: auto; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; max-width: 1280px; margin: 0 auto; padding: 3.5rem 1.25rem; }
.footer-logo { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: .75rem; }
.footer-tagline { font-size: .85rem; margin-bottom: 1.25rem; }
.footer-social { display: flex; gap: .6rem; flex-wrap: wrap; }
.social-btn { background: rgba(255,255,255,.08); color: #cbd5e1; padding: .4rem .9rem; border-radius: 6px; font-size: .78rem; transition: all var(--transition); }
.social-btn:hover { background: var(--accent); color: #fff; }
.footer-title { font-size: .88rem; font-weight: 700; color: #fff; margin-bottom: 1.1rem; text-transform: uppercase; letter-spacing: .8px; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { font-size: .85rem; color: #94a3b8; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-contact li { font-size: .85rem; margin-bottom: .6rem; display: flex; gap: .4rem; }
.payment-icons { font-size: .82rem; color: #64748b; margin-top: 1rem; padding: .75rem; background: rgba(255,255,255,.04); border-radius: var(--radius-sm); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 1.25rem; max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; font-size: .78rem; color: #64748b; }

/* ── Checkout ──────────────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.checkout-section { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.75rem; margin-bottom: 1.25rem; }
.checkout-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.order-summary { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; position: sticky; top: calc(var(--header-h) + 4rem); }
.order-item { display: flex; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.order-item:last-of-type { border-bottom: none; }
.order-item-img { width: 52px; height: 52px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.order-item-name { font-size: .85rem; font-weight: 600; flex: 1; }
.order-item-price { font-size: .9rem; font-weight: 700; color: var(--accent); }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.pay-opt { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: .75rem; font-size: .88rem; font-weight: 500; }
.pay-opt:hover { border-color: var(--blue); }
.pay-opt input[type=radio] { accent-color: var(--accent); }
.pay-opt.selected { border-color: var(--accent); background: #fff8f5; }

/* ── Page header ───────────────────────────────────────── */
.page-hdr { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 1.5rem 0; margin-bottom: 2rem; }
.page-hdr-inner { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.page-hdr h1 { font-size: 1.45rem; font-weight: 800; }
.page-hdr p { color: var(--text-3); font-size: .9rem; margin-top: .25rem; }

/* ── Promo Banner ──────────────────────────────────────── */
.promo-banner {
  background: linear-gradient(135deg, var(--accent), #ff8c55);
  color: #fff;
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.promo-text h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: .25rem; }
.promo-text p { font-size: .88rem; opacity: .9; }

/* ── Mobile nav panel ──────────────────────────────────────── */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--primary);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  position: relative;
  z-index: 997;
}
.mobile-nav.open { display: flex; }
.mobile-search-form { display:flex; border-radius:50px; overflow:hidden; margin-bottom:1rem; box-shadow:0 2px 8px rgba(0,0,0,.2); }
.mobile-search-input { flex:1; padding:.65rem 1.25rem; border:none; font-size:.95rem; outline:none; }
.mobile-search-btn { padding:0 1.25rem; background:var(--accent); color:#fff; border:none; cursor:pointer; font-size:1.1rem; }
.mobile-nav-link { display:flex; align-items:center; gap:.75rem; color:#cbd5e1; padding:.85rem 1rem; border-radius:var(--radius-sm); font-size:.93rem; font-weight:500; border-bottom:1px solid rgba(255,255,255,.06); transition:all var(--transition); }
.mobile-nav-link:last-child { border-bottom:none; }
.mobile-nav-link:hover { background:rgba(255,255,255,.1); color:#fff; }
.mobile-nav-link.mob-accent { color:var(--accent); font-weight:700; }
.mobile-nav-link.mob-seller { color:#6ee7b7; }
.mobile-nav-link.mob-admin  { color:#93c5fd; }
.mobile-nav-divider { height:1px; background:rgba(255,255,255,.12); margin:.5rem 0; }
.mob-cart-quick { display:none; align-items:center; gap:.3rem; padding:.45rem .8rem; color:#fff; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.15); border-radius:var(--radius-sm); font-size:.82rem; font-weight:600; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .products-grid-4 { grid-template-columns: repeat(3,1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .page-layout, .profile-layout, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .cart-summary { position: static; }
  .order-summary { position: static; }
  .products-grid-4 { grid-template-columns: repeat(2,1fr); }
  .promo-banner { flex-direction: column; text-align: center; }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 680px) {
  /* Header : masquer desktop, afficher mobile */
  .search-form { display: none; }
  .header-actions { display: none; }
  .mob-cart-quick { display: flex; }
  .mob-menu-btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255,255,255,.1);
    border-radius: 8px;
    padding: .5rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    color: #fff;
  }
  .header-inner { gap: .5rem; }
  .logo-text { font-size: 1.2rem; }

  /* Topbar */
  .topbar { font-size: .7rem; flex-direction: column; height: auto; padding: .4rem 1rem; gap: .15rem; text-align: center; }

  /* Layouts */
  .grid-2 { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }

  /* Products */
  .products-grid { grid-template-columns: repeat(2,1fr); gap: .75rem; }
  .cat-cards { grid-template-columns: repeat(3,1fr); }

  /* Hero */
  .hero { padding: 2.5rem 1.25rem; }
  .hero h1 { font-size: 1.7rem; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr; }
  .payment-options { grid-template-columns: 1fr; }

  /* Cart */
  .cart-layout { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 68px 1fr; gap: .75rem; }

  /* Product detail */
  .detail-actions { flex-direction: column; }

  /* Table */
  .table.table { font-size: .78rem; }
}
@media (max-width: 480px) {
  html { font-size: 14px; }
  .products-grid { grid-template-columns: repeat(2,1fr); gap: .6rem; }
  .cat-cards { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: .75rem; }
  .stat-number { font-size: 1.8rem; }
  .auth-card { padding: 1.5rem 1.25rem; }
  .checkout-section { padding: 1.25rem 1rem; }
  .section { padding: 2rem 0; }
  .section-title { font-size: 1.2rem; }
  .page-hdr h1 { font-size: 1.2rem; }
  .tab-nav { overflow-x: auto; scrollbar-width: none; }
  .tab-btn { padding: .65rem 1rem; font-size: .82rem; white-space: nowrap; }
  .product-detail-info h1 { font-size: 1.35rem; }
  .detail-price { font-size: 1.6rem; }
  .hero h1 { font-size: 1.45rem; }
  .hero { padding: 2rem 1rem; }
}
@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
  .cat-cards { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
