/* =====================================================================
   Bazaar Zero — Design System
   Zero-Commission Multi-Store Marketplace
   ===================================================================== */

:root {
  /* Brand palette — emerald/teal primary (zero-commission, fresh, money-saved) */
  --c-primary: #0d9488;
  --c-primary-600: #0f766e;
  --c-primary-700: #115e59;
  --c-primary-50: #f0fdfa;
  --c-primary-100: #ccfbf1;
  --c-primary-fg: #ffffff;

  --c-accent: #f59e0b;       /* amber — offers, savings */
  --c-accent-600: #d97706;

  /* Semantic */
  --c-success: #16a34a;
  --c-success-50: #f0fdf4;
  --c-warning: #d97706;
  --c-danger: #dc2626;
  --c-danger-50: #fef2f2;
  --c-info: #0891b2;

  /* Neutrals */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-inv: #ffffff;

  /* Status badge colors */
  --st-amber: #f59e0b; --st-amber-bg: #fffbeb;
  --st-blue: #2563eb; --st-blue-bg: #eff6ff;
  --st-green: #16a34a; --st-green-bg: #f0fdf4;
  --st-red: #dc2626; --st-red-bg: #fef2f2;
  --st-violet: #7c3aed; --st-violet-bg: #f5f3ff;
  --st-indigo: #4f46e5; --st-indigo-bg: #eef2ff;
  --st-gray: #64748b; --st-gray-bg: #f1f5f9;

  /* Radius & shadow */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 30px rgba(15,23,42,.12);

  /* Layout */
  --header-h: 64px;
  --maxw: 1200px;
  --sidebar-w: 248px;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
ul { list-style: none; }

/* ---------- Layout shell ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.header-inner {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 0 16px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--c-primary-700); }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-700));
  color: #fff; display: grid; place-items: center; font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.header-search { flex: 1; max-width: 460px; position: relative; }
.header-search input {
  width: 100%; height: 42px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 0 16px 0 44px; transition: .15s;
}
.header-search input:focus { outline: none; border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px var(--c-primary-100); }
.header-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.main { flex: 1 0 auto; width: 100%; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 560px; }
.container-lg { max-width: 1080px; }

.footer { flex-shrink: 0; background: #0f172a; color: #cbd5e1; margin-top: 48px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 16px 24px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .04em; }
.footer a { color: #94a3b8; display: block; padding: 4px 0; font-size: 14px; transition: .15s; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 16px; text-align: center; font-size: 13px; color: #64748b; }
.footer .brand { color: #fff; margin-bottom: 12px; }
.footer p { color: #94a3b8; font-size: 14px; max-width: 320px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s; white-space: nowrap;
  background: var(--surface); color: var(--text); text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--c-primary); color: var(--c-primary-fg); border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-600); }
.btn-accent { background: var(--c-accent); color: #fff; }
.btn-accent:hover { background: var(--c-accent-600); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--c-success); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-hover { transition: .18s; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--c-primary-100); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.badge-amber  { background: var(--st-amber-bg);  color: #b45309; }
.badge-blue   { background: var(--st-blue-bg);   color: #1d4ed8; }
.badge-green  { background: var(--st-green-bg);  color: #15803d; }
.badge-red    { background: var(--st-red-bg);    color: #b91c1c; }
.badge-violet { background: var(--st-violet-bg); color: #6d28d9; }
.badge-indigo { background: var(--st-indigo-bg); color: #4338ca; }
.badge-gray   { background: var(--st-gray-bg);   color: #475569; }
.badge-primary{ background: var(--c-primary-50); color: var(--c-primary-700); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary-700); }
.chip.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-label .req { color: var(--c-danger); }
.form-control, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); transition: .15s;
}
textarea { height: auto; padding: 10px 14px; min-height: 88px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-100); }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 5px; }
.input-group { display: flex; gap: 8px; }
.input-group > * { flex: 1; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--c-primary); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.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; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-8{margin-top:32px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}
.text-sm{font-size:13px}.text-xs{font-size:12px}.text-lg{font-size:18px}.text-xl{font-size:22px}.text-2xl{font-size:28px}.text-3xl{font-size:34px}
.font-bold{font-weight:800}.font-semibold{font-weight:600}.font-medium{font-weight:500}
.text-2{color:var(--text-2)}.text-3{color:var(--text-3)}
.text-primary{color:var(--c-primary-700)}.text-success{color:var(--c-success)}.text-danger{color:var(--c-danger)}.text-accent{color:var(--c-accent-600)}
.text-center{text-align:center}.text-right{text-align:right}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hidden{display:none}
.w-full{width:100%}
.rounded-full{border-radius:var(--r-full)}
.relative{position:relative}
.divider{height:1px;background:var(--border);margin:16px 0}
hr{border:none;height:1px;background:var(--border);margin:16px 0;}

/* ---------- Stars / rating ---------- */
.stars { color: var(--c-accent); letter-spacing: 1px; font-size: 14px; }
.star-count { color: var(--text-3); font-size: 12px; margin-left: 4px; }

/* ---------- Hero / sections ---------- */
.section { padding: 32px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title h2 { font-size: 22px; font-weight: 800; }
.section-title a { color: var(--c-primary-700); font-weight: 600; font-size: 14px; }

.hero {
  background: linear-gradient(135deg, var(--c-primary-700) 0%, var(--c-primary) 60%, #14b8a6 100%);
  color: #fff; border-radius: var(--r-xl); padding: 44px 40px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero::before { content: ''; position: absolute; right: 60px; bottom: -100px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 12px; line-height: 1.15; position: relative; z-index: 1; }
.hero p { font-size: 17px; opacity: .92; max-width: 560px; position: relative; z-index: 1; }
.hero .hero-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn-primary { background: #fff; color: var(--c-primary-700); }
.hero .btn-outline { border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.1); }

/* category pills row */
.cat-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; }
.cat-strip::-webkit-scrollbar { height: 6px; }
.cat-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.cat-tile {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 92px; padding: 14px 8px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--border); transition: .15s; cursor: pointer; text-align: center;
}
.cat-tile:hover { border-color: var(--c-primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cat-tile .emoji { font-size: 28px; }
.cat-tile span { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* ---------- Store card ---------- */
.store-card { overflow: hidden; }
.store-card .banner { height: 90px; background: linear-gradient(135deg, var(--c-primary-100), var(--c-primary-50)); position: relative; }
.store-card .logo-wrap { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px; margin-top: -28px; position: relative; }
.store-card .logo { width: 56px; height: 56px; border-radius: 14px; background: var(--surface); border: 3px solid var(--surface); display: grid; place-items: center; font-size: 24px; box-shadow: var(--shadow-sm); }
.store-card .body { padding: 12px 16px 16px; }
.store-card h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.store-card .meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ---------- Product card ---------- */
.product-card { overflow: hidden; display: flex; flex-direction: column; }
.product-card .img-wrap { aspect-ratio: 1/1; background: var(--surface-2); position: relative; overflow: hidden; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .disc-badge { position: absolute; top: 8px; left: 8px; background: var(--c-danger); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-sm); }
.product-card .body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card .pname { font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.product-card .pstore { font-size: 12px; color: var(--text-3); }
.product-card .punit { font-size: 12px; color: var(--text-3); }
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.product-card .price { font-size: 16px; font-weight: 800; color: var(--text); }
.product-card .mrp { font-size: 13px; color: var(--text-3); text-decoration: line-through; }
.product-card .add-btn { margin-top: 8px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }

/* ---------- Dashboard layout ---------- */
.dash { display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 0; align-items: start; min-height: calc(100vh - var(--header-h)); }
.dash-sidebar {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  background: #0f172a; color: #cbd5e1; padding: 16px 12px; overflow-y: auto;
}
.dash-sidebar .ds-brand { padding: 4px 12px 16px; font-weight: 800; color: #fff; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dash-sidebar .ds-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: 14px 12px 6px; }
.dash-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  color: #cbd5e1; font-size: 14px; font-weight: 500; transition: .12s; margin-bottom: 2px;
}
.dash-sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.dash-sidebar a.active { background: var(--c-primary); color: #fff; }
.dash-sidebar a .ic { width: 18px; text-align: center; }
.dash-sidebar .ds-badge { margin-left: auto; background: var(--c-accent); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: var(--r-full); }
.dash-main { padding: 24px; min-width: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.dash-head h1 { font-size: 24px; font-weight: 800; }
.dash-head p { color: var(--text-3); font-size: 14px; margin-top: 2px; }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile { padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat-tile .st-label { font-size: 13px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat-tile .st-value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.stat-tile .st-delta { font-size: 12px; margin-top: 4px; }
.stat-tile .st-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; margin-left: auto; }
.stat-tile.teal { border-left: 3px solid var(--c-primary); }
.stat-tile.teal .st-icon { background: var(--c-primary-50); color: var(--c-primary-700); }
.stat-tile.amber { border-left: 3px solid var(--c-accent); }
.stat-tile.amber .st-icon { background: var(--st-amber-bg); color: #b45309; }
.stat-tile.violet { border-left: 3px solid var(--st-violet); }
.stat-tile.violet .st-icon { background: var(--st-violet-bg); color: #6d28d9; }
.stat-tile.green { border-left: 3px solid var(--c-success); }
.stat-tile.green .st-icon { background: var(--st-green-bg); color: #15803d; }

/* ---------- Alert / flash ---------- */
.alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.alert-success { background: var(--st-green-bg); color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: var(--st-red-bg); color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: var(--st-blue-bg); color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--st-amber-bg); color: #b45309; border: 1px solid #fde68a; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #fff; padding: 12px 18px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .25s ease; max-width: 340px; }
.toast.success { border-left: 4px solid var(--c-success); }
.toast.error { border-left: 4px solid var(--c-danger); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .emoji { font-size: 48px; margin-bottom: 12px; }
.empty h3 { font-size: 18px; color: var(--text-2); margin-bottom: 6px; }

/* ---------- Avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--c-primary-100); color: var(--c-primary-700); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

/* ---------- Timeline / stepper ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 28px; height: 28px; border-radius: var(--r-full); background: var(--surface-2); border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; flex-shrink: 0; z-index: 1; }
.timeline-item.done .timeline-dot { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.timeline-item.current .timeline-dot { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.timeline-content h4 { font-size: 14px; font-weight: 600; }
.timeline-content .t-time { font-size: 12px; color: var(--text-3); }

/* ---------- Progress / stepper horizontal ---------- */
.stepper { display: flex; align-items: center; gap: 0; margin: 16px 0; }
.stepper .step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); flex: 1; }
.stepper .step .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.stepper .step.active { color: var(--c-primary-700); font-weight: 600; }
.stepper .step.active .dot { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.stepper .step.done .dot { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.stepper .line { flex: 0 0 24px; height: 2px; background: var(--border); }
.stepper .line.done { background: var(--c-success); }

/* ---------- Mobile bottom nav ---------- */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 50; padding: 6px 0 env(safe-area-inset-bottom, 8px); }
.mobile-nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto; }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: 11px; color: var(--text-3); font-weight: 500; }
.mobile-nav a.active { color: var(--c-primary-700); }
.mobile-nav a .ic { font-size: 20px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r-lg); max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; transition: .12s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--c-primary-700); border-color: var(--c-primary); }

/* ---------- Qty stepper ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.qty button { width: 34px; height: 34px; background: var(--surface-2); border: none; font-size: 18px; font-weight: 600; color: var(--c-primary-700); }
.qty button:hover { background: var(--surface-3); }
.qty input { width: 44px; height: 34px; border: none; text-align: center; font-weight: 600; }

/* ---------- Cart ---------- */
.cart-store-group { margin-bottom: 20px; }
.cart-store-group .csg-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md) var(--r-md) 0 0; border-bottom: none; }
.cart-store-group .csg-head .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--c-primary-100); display: grid; place-items: center; font-size: 16px; }
.cart-item { display: flex; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-top: none; }
.cart-item:last-child { border-radius: 0 0 var(--r-md) var(--r-md); }
.cart-item .ci-img { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 14px; }
.cart-item .ci-meta { font-size: 12px; color: var(--text-3); }
.cart-item .ci-price { font-weight: 700; }
.cart-item .ci-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* ---------- Order detail ---------- */
.order-summary { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; }
.order-summary .os-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.order-summary .os-total { border-top: 1px dashed var(--border-strong); margin-top: 8px; padding-top: 10px; font-weight: 800; font-size: 17px; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; height: calc(100vh - var(--header-h) - 48px); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-list-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.chat-list-item:hover { background: var(--surface-2); }
.chat-list-item.active { background: var(--c-primary-50); }
.chat-list-item .cli-info { flex: 1; min-width: 0; }
.chat-list-item .cli-name { font-weight: 600; font-size: 14px; }
.chat-list-item .cli-msg { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chat-msg { max-width: 70%; padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; word-wrap: break-word; }
.chat-msg.them { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.me { background: var(--c-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg .cm-time { font-size: 10px; opacity: .7; margin-top: 4px; display: block; }
.chat-input { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input input { flex: 1; }

/* ---------- Banner / notice strip ---------- */
.notice-strip { background: var(--c-primary-700); color: #fff; padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 500; }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar { position: fixed; left: -260px; top: var(--header-h); height: calc(100vh - var(--header-h)); width: var(--sidebar-w); z-index: 60; transition: left .2s; }
  .dash-sidebar.open { left: 0; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - var(--header-h) - 110px); }
  .chat-list { display: none; }
}
@media (max-width: 720px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .header-search { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .mobile-nav { display: block; }
  .main { padding-bottom: 72px; }
  .dash-main { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .section-title h2 { font-size: 19px; }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: repeat(2, 1fr); }
  .text-2xl { font-size: 24px; }
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* mobile menu button */
.menu-toggle { display: none; }
@media (max-width: 980px) { .menu-toggle { display: inline-flex; } }
