/* ==========================================================================
   ShopSahel — Système de design principal
   Police: Plus Jakarta Sans + Fraunces
   ========================================================================== */

/* ── Variables ────────────────────────────────────────────── */
:root {
  /* Couleurs primaires */
  --color-primary: #1a7a4a;
  --color-primary-light: #22a060;
  --color-primary-dark: #145c38;
  --color-primary-bg: #e8f5ee;
  --color-accent: #f59e0b;
  --color-star: #f59e0b;
  --color-danger: #ef4444;
  --color-success: #22c55e;
  --color-info: #3b82f6;

  /* Neutres (mode clair) */
  --bg-base: #f8f7f4;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f1f0ed;
  --bg-hover: #efefed;

  --text-primary: #111110;
  --text-secondary: #4b4b47;
  --text-muted: #8a8a84;
  --text-placeholder: #b0b0aa;

  --border-color: #e5e4e0;
  --border-focus: var(--color-primary);

  /* Ombres */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);

  /* Layout */
  --header-h: 64px;
  --catnav-h: 44px;
  --bottom-nav-h: 64px;
  --container: 1280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-out: cubic-bezier(0,0,.2,1);
  --transition: 200ms var(--ease);
}

[data-theme="dark"] {
  --bg-base: #0f0f0e;
  --bg-surface: #1a1a18;
  --bg-elevated: #222220;
  --bg-muted: #2a2a28;
  --bg-hover: #333330;
  --text-primary: #f0f0ec;
  --text-secondary: #c4c4bc;
  --text-muted: #7a7a72;
  --text-placeholder: #555550;
  --border-color: #2e2e2c;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.6);
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-h);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typography ───────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
.font-display { font-family: 'Fraunces', Georgia, serif; }
.text-muted { color: var(--text-muted); font-size: .875rem; }

/* ── Container ────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width:768px) { .container { padding: 0 24px; } }
@media (min-width:1024px) { .container { padding: 0 40px; } }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-full);
  font-size: .875rem; font-weight: 600; line-height: 1;
  transition: all var(--transition); white-space: nowrap;
  border: 2px solid transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--color-primary); color: #fff;
  box-shadow: 0 4px 14px rgba(26,122,74,.35);
}
.btn-primary:hover { background: var(--color-primary-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,122,74,.4); }
.btn-outline { border-color: var(--border-color); color: var(--text-primary); background: var(--bg-surface); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-bg); }
.btn-ghost { color: var(--text-secondary); padding: 10px 16px; }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text-primary); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.w-full { width: 100%; }
.btn-order {
  background: var(--color-primary); color: #fff;
  padding: 8px 14px; border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 600;
  box-shadow: 0 3px 10px rgba(26,122,74,.3);
  flex-shrink: 0;
}
.btn-order:hover { background: var(--color-primary-light); transform: translateY(-1px); }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--container); margin: 0 auto;
  padding: 0 16px; height: var(--header-h);
}
@media (min-width:768px) { .header-inner { padding: 0 24px; gap: 20px; } }
@media (min-width:1024px) { .header-inner { padding: 0 40px; gap: 24px; } }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon { width: 36px; height: 36px; }
.logo-text { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.logo-text strong { color: var(--color-primary); }

/* Header Search */
.header-search {
  flex: 1; display: none;
  align-items: center; gap: 0;
  background: var(--bg-muted); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full); overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 600px;
}
@media (min-width: 680px) { .header-search { display: flex; } }
.header-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,122,74,.15);
  background: var(--bg-surface);
}
.search-cat-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 42px; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); white-space: nowrap; flex-shrink: 0;
}
.search-cat-btn:hover { color: var(--color-primary); }
.search-divider { width: 1px; height: 24px; background: var(--border-color); flex-shrink: 0; }
.header-search input {
  flex: 1; height: 42px; padding: 0 16px;
  background: transparent; border: none; outline: none;
  font-size: .9rem; color: var(--text-primary);
}
.header-search input::placeholder { color: var(--text-placeholder); }
.search-submit {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 42px; color: var(--color-primary); flex-shrink: 0;
}
.search-submit:hover { color: var(--color-primary-dark); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-icon-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-md);
  color: var(--text-secondary); transition: all var(--transition);
}
.header-icon-btn:hover { background: var(--bg-muted); color: var(--color-primary); }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--color-danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
}

/* Avatar / User menu */
.header-user-menu { position: relative; }
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--color-primary-bg); display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid var(--border-color);
  transition: border-color var(--transition);
}
.avatar-btn:hover { border-color: var(--color-primary); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { font-size: .85rem; font-weight: 700; color: var(--color-primary); }
.avatar-md { width: 44px; height: 44px; border-radius: 50%; background: var(--color-primary-bg); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; color: var(--color-primary); flex-shrink: 0; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  min-width: 220px; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 180ms var(--ease-out); z-index: 200;
}
.header-user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-color);
}
.dropdown-header strong { font-size: .9rem; }
.role-badge { font-size: .7rem; padding: 2px 8px; border-radius: var(--radius-full); font-weight: 600; background: var(--color-primary-bg); color: var(--color-primary); text-transform: capitalize; }
.role-badge.admin { background: #fef3c7; color: #92400e; }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  font-size: .875rem; color: var(--text-secondary); width: 100%; text-align: left;
  transition: background var(--transition), color var(--transition);
}
.user-dropdown a:hover { background: var(--bg-hover); color: var(--text-primary); }
.logout-link { color: var(--color-danger) !important; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* Cat nav */
.cat-nav { border-top: 1px solid var(--border-color); background: var(--bg-surface); }
.cat-nav-inner {
  display: flex; align-items: center; gap: 0;
  max-width: var(--container); margin: 0 auto; padding: 0 16px;
  overflow-x: auto; scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
@media (min-width:1024px) { .cat-nav-inner { padding: 0 40px; } }
.cat-nav-item {
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  height: var(--catnav-h); font-size: .82rem; font-weight: 600;
  color: var(--text-secondary); white-space: nowrap; flex-shrink: 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.cat-nav-item:hover, .cat-nav-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* Burger */
.burger {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 8px; border-radius: var(--radius-md);
  flex-shrink: 0;
}
@media (min-width: 900px) { .burger { display: none; } }
.burger span { display: block; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition); }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width:900px) { .header-actions .btn { display: inline-flex; } }

/* Mobile drawer */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150;
  opacity: 0; visibility: hidden; transition: all 250ms var(--ease-out);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }
.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 85vw);
  background: var(--bg-surface); z-index: 200; padding: 0;
  transform: translateX(-100%); transition: transform 300ms var(--ease);
  overflow-y: auto; display: flex; flex-direction: column;
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-color);
}
.drawer-close { padding: 8px; color: var(--text-muted); }
.drawer-auth { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.drawer-user { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.drawer-user strong { display: block; font-size: .9rem; }
.drawer-nav { display: flex; flex-direction: column; padding: 12px 0; }
.drawer-nav a {
  padding: 13px 24px; font-size: .9rem; color: var(--text-secondary);
  transition: all var(--transition); border-left: 3px solid transparent;
}
.drawer-nav a:hover { background: var(--bg-muted); color: var(--text-primary); border-left-color: var(--color-primary); }

/* Flash messages */
.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin: 8px 16px; border-radius: var(--radius-md);
  font-size: .875rem; font-weight: 500; animation: slideDown .3s var(--ease);
}
.flash button { background: none; border: none; cursor: pointer; font-size: 1.2rem; opacity: .6; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
@keyframes slideDown { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }

/* ── Bottom nav ───────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h); background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; z-index: 90;
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
@media (min-width: 900px) { .bottom-nav { display: none; } }
body { padding-bottom: var(--bottom-nav-h); }
@media (min-width: 900px) { body { padding-bottom: 0; } }
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; position: relative; color: var(--text-muted);
  font-size: .65rem; font-weight: 600; padding: 8px 4px;
  transition: color var(--transition);
}
.bnav-item.active, .bnav-item:hover { color: var(--color-primary); }
.bnav-item.active svg { stroke: var(--color-primary); }
.bnav-item .badge-dot { top: 2px; right: 20%; }

/* ── Main content ─────────────────────────────────────────── */
.main { min-height: calc(100vh - var(--header-h) - var(--catnav-h)); }

/* ── Hero / Banner ────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0e5a34 100%);
  position: relative; overflow: hidden;
}
.hero-banner::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.04'%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-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; min-height: 220px;
  position: relative; z-index: 1; gap: 24px;
}
@media (min-width:768px) { .hero-inner { min-height: 280px; padding: 0 40px; } }
.hero-content { flex: 1; color: #fff; }
.hero-eyebrow { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .8; margin-bottom: 8px; }
.hero-title { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero-title em { font-family: 'Fraunces', serif; font-style: italic; opacity: .95; }
.hero-subtitle { font-size: .95rem; opacity: .85; margin-bottom: 24px; max-width: 400px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-image { flex-shrink: 0; display: none; }
@media (min-width:640px) { .hero-image { display: block; width: 280px; } }
.hero-image img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-lg); opacity: .9; }

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 32px 0; }
@media (min-width:768px) { .section { padding: 48px 0; } }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.section-title { font-size: 1.25rem; font-weight: 700; }
.section-link { font-size: .85rem; font-weight: 600; color: var(--color-primary); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* ── Category pills ───────────────────────────────────────── */
.category-pills { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 20px; background: var(--bg-surface); border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color); flex-shrink: 0; min-width: 88px;
  font-size: .78rem; font-weight: 600; color: var(--text-secondary);
  transition: all var(--transition); text-align: center;
}
.cat-pill:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-bg); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cat-pill.active { border-color: var(--color-primary); background: var(--color-primary-bg); color: var(--color-primary); }
.cat-pill-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg-muted); display: flex; align-items: center; justify-content: center; }
.cat-pill:hover .cat-pill-icon, .cat-pill.active .cat-pill-icon { background: rgba(26,122,74,.15); }

/* ── Product grid ─────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width:640px) { .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width:900px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width:1200px) { .products-grid { grid-template-columns: repeat(5, 1fr); } }

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
  background: var(--bg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border-color); overflow: hidden;
  transition: all var(--transition); position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(26,122,74,.2); }
.card-img-wrap { display: block; position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-muted); }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.product-card:hover .card-img { transform: scale(1.04); }
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: var(--radius-full); font-size: .68rem; font-weight: 700; letter-spacing: .03em; }
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-featured { background: #fef3c7; color: #92400e; }
.badge-sponsored { background: #f3e8ff; color: #6b21a8; }
.badge-pro { background: var(--color-primary); color: #fff; }
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .fav-btn { background: rgba(0,0,0,.6); }
.fav-btn:hover, .fav-btn.active { color: #ef4444; background: rgba(255,255,255,.95); }
.fav-btn.active svg { fill: #ef4444; }
.card-body { padding: 12px; }
.card-shop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.shop-name { font-size: .75rem; font-weight: 600; color: var(--color-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.card-location { display: flex; align-items: center; gap: 3px; font-size: .7rem; color: var(--text-muted); flex-shrink: 0; }
.card-title { font-size: .875rem; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.card-title a { color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--color-primary); }
.card-rating { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.stars { display: flex; gap: 2px; }
.rating-count { font-size: .72rem; color: var(--text-muted); }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-price { font-size: .95rem; font-weight: 800; color: var(--color-primary); }
.price-neg { font-size: .68rem; color: var(--text-muted); }

/* ── Shop cards ───────────────────────────────────────────── */
.shops-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width:640px) { .shops-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width:900px) { .shops-grid { grid-template-columns: repeat(4, 1fr); } }
.shop-card {
  background: var(--bg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border-color); overflow: hidden;
  transition: all var(--transition); text-align: center;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.shop-cover { height: 80px; background: var(--color-primary-bg); position: relative; }
.shop-cover img { width: 100%; height: 100%; object-fit: cover; }
.shop-logo {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 3px solid var(--bg-surface);
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.shop-logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-logo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--color-primary-bg); color: var(--color-primary); font-weight: 800; font-size: 1.2rem; }
.shop-body { padding: 28px 12px 14px; }
.shop-card-name { font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.shop-card-loc { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 3px; }
.shop-card-stats { display: flex; justify-content: center; gap: 12px; margin-top: 10px; font-size: .75rem; color: var(--text-muted); }

/* ── Banner promo ─────────────────────────────────────────── */
.promo-banner {
  background: linear-gradient(135deg, var(--color-accent) 0%, #e67e22 100%);
  border-radius: var(--radius-xl); padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: hidden; position: relative; gap: 16px;
}
.promo-banner::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.promo-text { color: #fff; }
.promo-text h3 { font-size: 1.25rem; margin-bottom: 6px; }
.promo-text p { font-size: .875rem; opacity: .9; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-label .required { color: var(--color-danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 11px 14px;
  background: var(--bg-surface); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md); font-size: .9rem; color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,122,74,.12); }
.form-control::placeholder { color: var(--text-placeholder); }
.form-control.error { border-color: var(--color-danger); }
.form-error { font-size: .8rem; color: var(--color-danger); margin-top: 4px; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.input-with-icon { position: relative; }
.input-with-icon .form-control { padding-left: 40px; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - var(--header-h) - var(--bottom-nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: var(--bg-surface); border-radius: var(--radius-xl);
  border: 1px solid var(--border-color); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; padding: 36px 32px;
}
@media (max-width:480px) { .auth-card { padding: 28px 20px; border-radius: var(--radius-lg); } }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background: var(--border-color); }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--color-primary); font-weight: 600; }

/* ── Page titles ──────────────────────────────────────────── */
.page-title-bar { background: var(--bg-surface); border-bottom: 1px solid var(--border-color); padding: 20px 0; }
.page-title-bar h1 { font-size: 1.5rem; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb span { opacity: .5; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-color); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 18px; font-size: .875rem; font-weight: 600;
  color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-btn:hover { color: var(--text-primary); }
.tab-content { display: none; padding: 24px 0; }
.tab-content.active { display: block; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon { width: 80px; height: 80px; margin: 0 auto 20px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: .9rem; margin-bottom: 24px; }

/* ── Skeleton loader ──────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-hover) 50%, var(--bg-muted) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
.skeleton-card { height: 280px; border-radius: var(--radius-lg); }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 300; opacity: 0; visibility: hidden;
  transition: all 250ms var(--ease-out);
}
@media (min-width:600px) { .modal-overlay { align-items: center; } }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-surface); width: 100%; max-width: 520px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px; max-height: 90vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 300ms var(--ease);
}
@media (min-width:600px) { .modal { border-radius: var(--radius-xl); transform: translateY(20px) scale(.97); } }
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { padding: 8px; color: var(--text-muted); border-radius: var(--radius-md); }
.modal-close:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ── Messages page ────────────────────────────────────────── */
.messages-layout { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - var(--header-h) - var(--catnav-h) - var(--bottom-nav-h)); }
@media (min-width:768px) { .messages-layout { grid-template-columns: 320px 1fr; } }
.conversations-list { border-right: 1px solid var(--border-color); overflow-y: auto; }
.conv-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border-color); cursor: pointer;
  transition: background var(--transition);
}
.conv-item:hover, .conv-item.active { background: var(--color-primary-bg); }
.conv-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--color-primary-bg); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--color-primary); flex-shrink: 0; overflow: hidden; }
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: .875rem; font-weight: 600; }
.conv-preview { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conv-time { font-size: .7rem; color: var(--text-muted); }
.conv-unread { min-width: 18px; height: 18px; background: var(--color-primary); color: #fff; border-radius: 9999px; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.chat-area { display: flex; flex-direction: column; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-surface); }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--bg-base); }
.msg-bubble { max-width: 75%; }
.msg-bubble.sent { align-self: flex-end; }
.msg-bubble.received { align-self: flex-start; }
.bubble-content {
  padding: 10px 14px; border-radius: var(--radius-lg); font-size: .875rem; line-height: 1.5;
}
.msg-bubble.sent .bubble-content { background: var(--color-primary); color: #fff; border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg); }
.msg-bubble.received .bubble-content { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px; }
.msg-bubble.system { align-self: center; }
.msg-bubble.system .bubble-content { background: var(--bg-muted); color: var(--text-muted); font-size: .78rem; text-align: center; border-radius: var(--radius-full); padding: 6px 14px; }
.bubble-time { font-size: .68rem; color: var(--text-muted); margin-top: 4px; }
.msg-bubble.sent .bubble-time { text-align: right; }
.chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border-color); background: var(--bg-surface); }
.chat-input-row { display: flex; align-items: center; gap: 8px; background: var(--bg-muted); border-radius: var(--radius-full); padding: 6px 8px 6px 16px; border: 1.5px solid var(--border-color); transition: border-color var(--transition); }
.chat-input-row:focus-within { border-color: var(--color-primary); }
.chat-input-row input { flex: 1; background: transparent; border: none; outline: none; font-size: .9rem; color: var(--text-primary); }
.chat-actions { display: flex; gap: 4px; }
.chat-action-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--transition); }
.chat-action-btn:hover { color: var(--color-primary); background: var(--bg-hover); }
.chat-send-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.chat-send-btn:hover { background: var(--color-primary-light); }

/* ── Profile page ─────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width:900px) { .profile-layout { grid-template-columns: 260px 1fr; gap: 24px; } }
.profile-sidebar { background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border-color); overflow: hidden; height: fit-content; }
.profile-nav a {
  display: flex; align-items: center; gap: 12px; padding: 13px 20px;
  font-size: .875rem; color: var(--text-secondary);
  border-left: 3px solid transparent; transition: all var(--transition);
}
.profile-nav a:hover, .profile-nav a.active { background: var(--color-primary-bg); color: var(--color-primary); border-left-color: var(--color-primary); }
.profile-avatar-section { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 20px; border-bottom: 1px solid var(--border-color); }
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: var(--color-primary-bg); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: var(--color-primary); border: 3px solid var(--color-primary-bg); overflow: hidden; }
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* ── Seller dashboard ─────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width:640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 18px; }
.stat-card-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card-value { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); margin: 4px 0; }
.stat-card-change { font-size: .78rem; font-weight: 600; }
.stat-card-change.up { color: var(--color-success); }
.stat-card-change.down { color: var(--color-danger); }

/* ── Admin ────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--bg-surface); border-right: 1px solid var(--border-color); flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-main { flex: 1; padding: 32px; overflow: auto; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: .875rem; color: var(--text-secondary); transition: all var(--transition); }
.admin-nav a:hover, .admin-nav a.active { background: var(--color-primary-bg); color: var(--color-primary); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-color); background: var(--bg-surface); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { padding: 12px 16px; text-align: left; font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border-color); background: var(--bg-muted); }
td { padding: 13px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0; }
.page-btn { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 600; border: 1.5px solid var(--border-color); color: var(--text-secondary); transition: all var(--transition); }
.page-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── Status badges ────────────────────────────────────────── */
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full); font-size: .75rem; font-weight: 600; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dcfce7; color: #166534; }
.status-completed { background: #dbeafe; color: #1e40af; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* ── Stars input ──────────────────────────────────────────── */
.star-rating { display: flex; gap: 4px; direction: rtl; }
.star-rating input { display: none; }
.star-rating label { font-size: 1.6rem; color: #d1d5db; cursor: pointer; transition: color var(--transition); }
.star-rating label:hover, .star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--color-star); }

/* ── Utilities ────────────────────────────────────────────── */
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.p-4 { padding: 16px; } .p-6 { padding: 24px; } .py-4 { padding-top:16px; padding-bottom:16px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; } .text-sm { font-size: .875rem; } .text-xs { font-size: .75rem; }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.text-primary-color { color: var(--color-primary); } .text-danger { color: var(--color-danger); } .text-success { color: var(--color-success); }
.rounded { border-radius: var(--radius-md); } .rounded-lg { border-radius: var(--radius-lg); } .rounded-full { border-radius: var(--radius-full); }
.hidden { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ── Scrollbar custom ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn { from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px);}to{opacity:1;transform:translateY(0);} }
.animate-fade-in { animation: fadeIn .4s var(--ease) both; }
.animate-fade-in-up { animation: fadeInUp .5s var(--ease) both; }
.delay-1 { animation-delay: .1s; } .delay-2 { animation-delay: .2s; } .delay-3 { animation-delay: .3s; }

/* ── Theme toggle button ──────────────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-muted); border-radius: var(--radius-md);
}
.toggle-switch {
  position: relative; width: 46px; height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border-color);
  border-radius: var(--radius-full); cursor: pointer; transition: .3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: .3s; box-shadow: var(--shadow-xs);
}
input:checked + .toggle-slider { background: var(--color-primary); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Product detail ───────────────────────────────────────── */
.product-detail-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width:768px) { .product-detail-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width:1024px) { .product-detail-grid { grid-template-columns: 3fr 2fr; } }
.gallery-main { aspect-ratio: 1; border-radius: var(--radius-xl); overflow: hidden; background: var(--bg-muted); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb { width: 72px; height: 72px; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; cursor: pointer; border: 2px solid transparent; transition: border-color var(--transition); }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--color-primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Responsive helpers ───────────────────────────────────── */
@media (max-width: 639px) { .hide-mobile { display: none !important; } }
@media (min-width: 640px) { .show-mobile-only { display: none !important; } }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--bg-surface); border-top: 1px solid var(--border-color); margin-top: 60px; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 48px 16px 32px; display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width:768px) { .footer-inner { grid-template-columns: 280px 1fr; padding: 48px 40px 32px; } }
.footer-brand p { font-size: .875rem; color: var(--text-muted); margin: 12px 0 20px; max-width: 280px; line-height: 1.7; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-muted); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--transition); }
.footer-socials a:hover { background: var(--color-primary-bg); color: var(--color-primary); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width:480px) { .footer-links { grid-template-columns: repeat(2, 1fr); } }
.footer-col h4 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); margin-bottom: 14px; }
.footer-col a { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; transition: color var(--transition); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { max-width: var(--container); margin: 0 auto; padding: 20px 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border-color); font-size: .8rem; color: var(--text-muted); }
@media (min-width:768px) { .footer-bottom { padding: 20px 40px; } }
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { color: var(--text-muted); transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--color-primary); }
