/* ============================================================
   ONION.SHOP — Premium Design System
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --ink:        #111c15;
  --ink-2:      #2e3d33;
  --muted:      #667a6e;
  --line:       rgba(17, 28, 21, 0.1);
  --paper:      #ffffff;
  --panel:      #f7faf4;
  --wash:       #eef5e7;
  --leaf:       #0d8f5c;
  --leaf-dark:  #096e46;
  --leaf-light: #e6f7ef;
  --sprout:     #d0f5e0;
  --lime:       #b8ea50;
  --lime-dark:  #9ace3a;
  --coral:      #ff5f52;
  --sky:        #2fa8ff;
  --amber:      #ffcc00;
  --purple:     #8b5cf6;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --shadow-sm:  0 2px 8px rgba(17,28,21,0.06);
  --shadow:     0 8px 32px rgba(17,28,21,0.10);
  --shadow-lg:  0 20px 60px rgba(17,28,21,0.14);
  --shadow-xl:  0 32px 80px rgba(17,28,21,0.18);
  --topbar-h:   56px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --ink:        #e8f5ec;
  --ink-2:      #b8ccbe;
  --muted:      #7a9482;
  --line:       rgba(232,245,236,0.10);
  --paper:      #0f1a12;
  --panel:      #162019;
  --wash:       #0a110c;
  --leaf:       #42d491;
  --leaf-dark:  #6eddb0;
  --leaf-light: #0d2a1a;
  --sprout:     #15362a;
  --lime:       #d4f57c;
  --lime-dark:  #b8ea50;
  --coral:      #ff7b70;
  --sky:        #5cc4ff;
  --amber:      #ffd740;
  --purple:     #a78bfa;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.2);
  --shadow:     0 8px 32px rgba(0,0,0,0.3);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.4);
  --shadow-xl:  0 32px 80px rgba(0,0,0,0.5);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  min-height: 100dvh;
  background: var(--wash);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
a { color: inherit; text-decoration: none; }

/* ── Focus ──────────────────────────────────────────────── */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13,143,92,0.4);
  outline-offset: 2px;
}

/* ── Layout ─────────────────────────────────────────────── */
main#main {
  width: min(100% - 24px, 1400px);
  margin: 0 auto;
  padding-top: 8px;
  padding-bottom: 88px;
}

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes fadeUp      { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight{ from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes scaleIn     { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes pulse       { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes bounce      { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } 60% { transform: translateY(-3px); } }
@keyframes shimmer     { 0% { background-position: -600px 0; } 100% { background-position: 600px 0; } }
@keyframes barGrow     { from { height: 0; } to { height: var(--bar-h, 40%); } }
@keyframes float       { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes gradShift   {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Boot / Loading ─────────────────────────────────────── */
.boot {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  gap: 20px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}
.boot strong { font-size: 1.1rem; font-weight: 700; }
.loader {
  width: 48px; height: 48px;
  border: 3px solid var(--line);
  border-top-color: var(--leaf);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 0 clamp(12px, 3vw, 24px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border: 0;
  padding: 0;
  transition: opacity var(--transition);
}
.brand:hover { opacity: 0.9; }
.brand-mark {
  display: grid;
  width: 32px; height: 32px;
  place-items: center;
  border-radius: 4px;
  background: var(--leaf);
  color: white;
  font-size: 1.1rem;
}
.brand strong { display: block; font-size: 0.95rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; color: var(--leaf-dark); }
.brand small { display: block; font-size: 0.65rem; color: var(--muted); line-weight: 1.2; font-weight: 500; }

/* Search Wrap */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 580px;
  width: 100%;
  justify-self: center;
}
.global-search {
  display: flex;
  align-items: center;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 0 12px;
  height: 38px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-icon-inside {
  color: var(--muted);
  display: flex;
  align-items: center;
  margin-right: 8px;
}
.global-search:focus-within {
  border-color: var(--leaf);
  box-shadow: 0 0 0 2px rgba(13,143,92,0.1);
}
.global-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
}
.global-search input::placeholder { color: var(--muted); }
.voice-search {
  display: grid;
  place-items: center;
  height: 38px; width: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: color var(--transition);
}
.voice-search:hover { color: var(--leaf); }
.search-submit {
  border: 0;
  background: var(--leaf);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  height: 38px;
  padding: 0 16px;
  border-radius: 0 4px 4px 0;
  display: none; /* Hide button to match mockup styling, or show compactly */
}


/* Search Suggestions */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  animation: scaleIn 0.15s ease;
}
.suggestions small {
  display: block;
  padding: 10px 16px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  border: 0;
  text-align: left;
  transition: background var(--transition);
  border-radius: 0;
}
.suggestion-item span { color: var(--muted); font-size: 0.78rem; }
.suggestion-item:hover, .suggestion-item.active-suggestion { background: var(--panel); }
.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
}
.clear-btn {
  font-size: 0.75rem;
  color: var(--coral);
  font-weight: 600;
  background: transparent;
  border: 0;
  padding: 2px 6px;
}
.recent-item-wrap {
  display: flex;
  align-items: center;
}
.recent-item-wrap .suggestion-item { flex: 1; }
.delete-recent {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.1rem;
  margin-right: 8px;
  border-radius: 8px;
  transition: all var(--transition);
}
.delete-recent:hover { background: var(--wash); color: var(--coral); }

/* Top Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-actions .top-action-btn {
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition: color var(--transition);
  padding: 6px 8px;
}
.top-actions .top-action-btn:hover {
  color: var(--leaf);
}
.top-actions .top-action-btn svg {
  color: var(--ink-2);
}
.top-actions .top-action-btn:hover svg {
  color: var(--leaf);
}
.top-actions .avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--leaf), var(--purple));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.arrow-down {
  font-size: 0.55rem;
  color: var(--muted);
  margin-left: 2px;
}
.top-actions b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  margin-left: 4px;
}
.icon-only-btn {
  background: transparent;
  border: 0;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  padding: 6px;
  transition: color var(--transition);
}
.icon-only-btn:hover {
  color: var(--leaf);
}
.icon-only-btn b {
  position: absolute;
  top: 0; right: 0;
}


/* Hamburger */
.hamburger {
  display: none;
  width: 42px; height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
  border: 0;
  transition: background var(--transition);
}
.hamburger:hover { background: var(--panel); }

/* ── Drawer ─────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.menu-drawer {
  position: fixed;
  top: 0; left: -330px; bottom: 0;
  width: min(320px, calc(100vw - 48px));
  background: var(--paper);
  z-index: 201;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-drawer.open { left: 0; }
.menu-drawer button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.93rem;
  border: 0;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu-drawer button:hover { background: var(--panel); color: var(--leaf); }
.menu-drawer hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.menu-user {
  border-radius: var(--radius);
  transition: background 0.6s ease;
  background-size: cover;
}

/* ── Hero Carousel Container ── */
.hero-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 12px;
}
.hero-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 7.5% 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.hero-track::-webkit-scrollbar {
  display: none;
}
.hero-slide {
  width: 85%;
  flex-shrink: 0;
  scroll-snap-align: center;
  min-height: 220px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform var(--transition);
}
.hero-slide:hover {
  transform: scale(1.01);
}
.hero-slide-content {
  position: relative;
  z-index: 3;
  max-width: 70%;
}
.hero-slide-content h2 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.hero-slide-content p {
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  opacity: 0.95;
  margin: 0 0 14px;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.hero-slide-cta {
  padding: 8px 18px;
  border-radius: 4px;
  background: var(--lime);
  color: #111c15;
  font-weight: 700;
  font-size: 0.8rem;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(184,234,80,0.3);
  transition: all var(--transition);
}
.hero-slide-cta:hover {
  background: var(--lime-dark);
  transform: translateY(-1px);
}
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: -8px;
  margin-bottom: 12px;
}
.slider-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all var(--transition);
}
.slider-dots button.active {
  width: 18px;
  border-radius: 3px;
  background: var(--leaf);
}

/* ── Quick Category Strip ───────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 16px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: space-between;
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 68px;
  padding: 4px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.quick-actions button span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all var(--transition);
}
.quick-actions button:hover {
  transform: translateY(-2.5px);
}
.quick-actions button:hover span {
  background: var(--sprout);
  border-color: var(--leaf);
}
.quick-actions button.active {
  border-bottom: 2px solid var(--leaf);
  color: var(--leaf-dark);
}
.quick-actions button.active span {
  background: var(--sprout);
  border-color: var(--leaf);
  box-shadow: 0 0 0 2px rgba(13, 143, 92, 0.15);
}

/* Category Rail */
.category-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.category-rail::-webkit-scrollbar { display: none; }
.category-rail button {
  min-width: 100px;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.84rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.category-rail button:hover { border-color: var(--leaf); color: var(--leaf-dark); background: var(--leaf-light); }
.category-rail button.active {
  border-color: var(--leaf);
  background: var(--sprout);
  color: var(--leaf-dark);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(13,143,92,0.2);
}

/* ── Section Headers ─────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 14px;
}
.section-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.section-head p   { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.section-head button {
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--leaf-light);
  color: var(--leaf-dark);
  font-weight: 700;
  font-size: 0.8rem;
  border: 0;
  white-space: nowrap;
  transition: all var(--transition);
}
.section-head button:hover { background: var(--sprout); }

/* ── Product Cards & Grid ─────────────────────────────────── */
.product-grid, .mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.horizontal-products-wrap {
  position: relative;
}

.horizontal-products {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.horizontal-products::-webkit-scrollbar { display: none; }
.horizontal-products .product-card { min-width: 160px; max-width: 160px; flex-shrink: 0; }

/* Scroll Arrow buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 48px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(0,0,0,0.12);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.2s, background 0.2s;
  opacity: 0;
}
.horizontal-products-wrap:hover .scroll-btn {
  opacity: 1;
}
.scroll-btn:hover {
  background: var(--wash);
}
.scroll-btn.prev {
  left: 0;
  border-radius: 0 4px 4px 0;
}
.scroll-btn.next {
  right: 0;
  border-radius: 4px 0 0 4px;
}

.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.product-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 150px;
  background: #ffffff;
  padding: 10px;
  border: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.product-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: contain;
  transition: transform var(--transition);
}
.product-card:hover .product-media img { transform: scale(1.04); }
.product-media span {
  position: absolute;
  top: 6px; left: 6px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--leaf);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.product-body {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.link-title {
  display: block;
  height: 32px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font-weight: 500;
  font-size: 0.78rem;
  line-height: 1.3;
  border: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.link-title:hover { color: var(--leaf); }
.product-body small { color: var(--muted); font-size: 0.68rem; display: block; margin-bottom: 6px; }
.rating { display: flex; align-items: center; gap: 6px; }
.rating span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--leaf);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
}
.rating small { color: var(--muted); font-size: 0.68rem; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin-top: 6px; }
.price strong { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.price del { color: var(--muted); font-size: 0.7rem; text-decoration: line-through; }
.price b { font-size: 0.7rem; font-weight: 600; color: var(--leaf-dark); }

.product-actions {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
}
.product-actions button {
  min-height: 28px;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
  transition: all var(--transition);
}
.product-actions button:first-child {
  background: var(--leaf);
  color: white;
}
.product-actions button:first-child:hover { background: var(--leaf-dark); }
.product-actions button:last-child {
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-actions button:last-child:hover { background: var(--coral); color: white; }
.product-actions button:last-child.active { background: var(--coral); color: white; }

/* ── Market Sections ─────────────────────────────────────── */
.market-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  margin-top: 8px;
}
.market-section .section-head {
  margin: 0 0 12px 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}


/* ── Vendors ─────────────────────────────────────────────── */
.vendor-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.vendor-tile {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}
.vendor-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.vendor-tile strong { display: block; font-size: 1rem; font-weight: 800; }
.vendor-tile small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.82rem; }
.vendor-tile span { display: inline-block; margin-top: 12px; padding: 4px 10px; border-radius: 6px; background: var(--sprout); color: var(--leaf-dark); font-size: 0.78rem; font-weight: 700; }

/* ── Recent Searches ─────────────────────────────────────── */
.recent-searches {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.recent-searches > div { min-width: max-content; }
.recent-searches strong { font-size: 0.88rem; font-weight: 700; }
.recent-searches small { display: block; font-size: 0.72rem; color: var(--muted); }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-chips button {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
}
.recent-chips button:hover { background: var(--leaf); border-color: var(--leaf); color: white; }

/* ── Flash Sale Banner ───────────────────────────────────── */
.flash-sale {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #111c15, #0d3d24);
  color: white;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}
.flash-sale::after {
  content: '⚡';
  position: absolute;
  right: 120px;
  font-size: 8rem;
  opacity: 0.05;
  line-height: 1;
  top: -10px;
  pointer-events: none;
}
.flash-sale small { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--lime); font-weight: 800; margin-bottom: 5px; }
.flash-sale strong { display: block; font-size: 1.4rem; font-weight: 900; }
.flash-sale span { display: block; font-size: 0.82rem; opacity: 0.65; margin-top: 4px; }
.flash-sale button {
  flex-shrink: 0;
  padding: 13px 24px;
  border-radius: var(--radius);
  background: var(--lime);
  color: #111c15;
  font-weight: 800;
  font-size: 0.9rem;
  border: 0;
  box-shadow: 0 4px 16px rgba(184,234,80,0.35);
  transition: all var(--transition);
  white-space: nowrap;
}
.flash-sale button:hover { background: var(--lime-dark); transform: scale(1.03); }

/* ── Sort Slider ─────────────────────────────────────────── */
.sort-slider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.sort-slider > div { min-width: max-content; }
.sort-slider strong { font-size: 0.88rem; font-weight: 700; }
.sort-slider small { font-size: 0.72rem; color: var(--muted); }
.sort-line { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-line button {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
}
.sort-line button:hover { border-color: var(--leaf); color: var(--leaf-dark); background: var(--leaf-light); }
.sort-line button.active { background: var(--leaf); border-color: var(--leaf); color: white; }

/* ── Filter Tease / Open ─────────────────────────────────── */
.filter-tease {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 4px;
}
.filter-tease button {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  transition: all var(--transition);
}
.filter-tease button:hover { border-color: var(--leaf); color: var(--leaf); }
.filter-tease span { color: var(--muted); font-size: 0.82rem; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
  padding: 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.filters input, .filters select {
  width: 100%; min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 0.85rem;
  transition: border-color var(--transition);
}
.filters input:focus, .filters select:focus { border-color: var(--leaf); outline: none; }

/* ── Product Feed / Pagination ───────────────────────────── */
.feed { margin-top: 8px; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 8px;
}
.pagination button {
  padding: 9px 20px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  transition: all var(--transition);
}
.pagination button:hover:not(:disabled) { background: var(--leaf); border-color: var(--leaf); color: white; }
.pagination span { color: var(--muted); font-size: 0.84rem; }

/* ── Product Detail ──────────────────────────────────────── */
.product-detail { margin-top: 16px; animation: fadeUp 0.3s ease; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 16px;
  transition: all var(--transition);
}
.back:hover { background: var(--leaf-light); color: var(--leaf-dark); border-color: var(--leaf); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.gallery, .detail-copy {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.zoom-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  object-fit: cover;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.thumbs button {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
  padding: 4px;
  transition: all var(--transition);
}
.thumbs button:hover { border-color: var(--leaf); }
.thumbs img { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.detail-copy h1 { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 900; letter-spacing: -0.03em; margin-top: 4px; }
.detail-price { margin: 14px 0; }
.detail-price strong { font-size: 1.8rem; font-weight: 900; }
.specs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.specs li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.detail-actions button {
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  transition: all var(--transition);
}
.detail-actions button:first-child { background: var(--leaf); color: white; box-shadow: 0 4px 14px rgba(13,143,92,0.3); }
.detail-actions button:first-child:hover { background: var(--leaf-dark); transform: translateY(-2px); }
.detail-actions button:nth-child(2) { background: var(--panel); border: 1.5px solid var(--line); color: var(--ink); }
.detail-actions button:last-child { background: var(--ink); color: white; }
.vendor-card {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1.5px solid var(--line);
}
.vendor-card strong { font-size: 0.95rem; font-weight: 800; display: block; }
.vendor-card small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.vendor-card span { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 6px; background: var(--sprout); color: var(--leaf-dark); font-size: 0.76rem; font-weight: 700; }

/* Reviews */
.reviews { margin-top: 24px; display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.reviews > div, .review-form { border-radius: var(--radius-xl); background: var(--paper); border: 1.5px solid var(--line); padding: 20px; }
.reviews > div h2, .review-form h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.reviews > div article { padding: 14px 0; border-bottom: 1px solid var(--line); }
.reviews > div article:last-child { border-bottom: 0; }
.reviews > div article strong { font-size: 0.9rem; font-weight: 700; display: block; }
.reviews > div article p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* ── Forms ──────────────────────────────────────────────── */
form input, form select, form textarea {
  width: 100%; min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 11px 14px;
  font-size: 0.9rem;
  transition: all var(--transition);
  display: block;
  margin-bottom: 12px;
}
form input:focus, form select:focus, form textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(13,143,92,0.1); outline: none; }
form textarea { min-height: 100px; resize: vertical; }
form button[type="submit"], form button:not([type="button"]) {
  padding: 12px 22px;
  border-radius: var(--radius);
  background: var(--leaf);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  box-shadow: 0 4px 14px rgba(13,143,92,0.25);
  transition: all var(--transition);
}
form button[type="submit"]:hover, form button:not([type="button"]):hover { background: var(--leaf-dark); transform: translateY(-1px); }
form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
form label:has(input, select) { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
form label input, form label select { margin-bottom: 0; }

/* ── Cart ────────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}
.cart-list { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-xl); padding: 20px; }
.cart-list h2 { font-size: 1.3rem; font-weight: 800; }
.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; border: 1.5px solid var(--line); }
.cart-item > div strong { display: block; font-weight: 700; font-size: 0.88rem; }
.cart-item > div small { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty button {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--panel);
  border: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  transition: all var(--transition);
}
.qty button:hover { background: var(--leaf); color: white; }
.qty span {
  min-width: 38px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0 6px;
}
.cart-item > button {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  transition: all var(--transition);
}
.cart-item > button:hover { background: rgba(255,95,82,0.1); color: var(--coral); }
.checkout-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}
.checkout-card > small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 600; margin-bottom: 6px; }
.checkout-card > strong { display: block; font-size: 1.8rem; font-weight: 900; margin-bottom: 16px; }
.checkout-card > button {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--leaf);
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  border: 0;
  box-shadow: 0 4px 16px rgba(13,143,92,0.3);
  transition: all var(--transition);
}
.checkout-card > button:hover { background: var(--leaf-dark); transform: translateY(-2px); }
.checkout-card > p { font-size: 0.76rem; color: var(--muted); margin-top: 12px; }

/* ── Checkout ─────────────────────────────────────────────── */
.checkout-page {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}
.checkout-page .panel, .order-summary {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.checkout-page h2, .order-summary h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; }
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.summary-row span { color: var(--muted); }
.summary-row strong { font-weight: 700; }
.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  font-size: 1rem;
  font-weight: 700;
}
.total strong { font-size: 1.6rem; font-weight: 900; color: var(--leaf-dark); }
.order-summary [data-action="place-order"] {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--leaf);
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  border: 0;
  box-shadow: 0 4px 16px rgba(13,143,92,0.3);
  transition: all var(--transition);
}
.order-summary [data-action="place-order"]:hover { background: var(--leaf-dark); transform: translateY(-2px); }

/* ── Orders ──────────────────────────────────────────────── */
.dashboard { margin-top: 8px; }
.dashboard h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.orders { display: grid; gap: 14px; }
.order-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: all var(--transition);
}
.order-card:hover { box-shadow: var(--shadow); }
.order-card > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.order-card > div:first-child strong { font-weight: 800; }
.order-card > div:first-child span {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sprout);
  color: var(--leaf-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.order-card small { color: var(--muted); font-size: 0.8rem; display: block; margin: 10px 0 8px; }
.order-card p { font-size: 0.85rem; color: var(--ink-2); padding: 5px 0; border-bottom: 1px solid var(--line); }
.order-card p:last-child { border-bottom: 0; }

/* Order steps */
.steps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0 4px;
}
.steps i {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  display: block;
  transition: background 0.3s ease;
}
.steps i.done { background: var(--leaf); }

/* ── Notifications ───────────────────────────────────────── */
.dashboard.narrow { max-width: 640px; }
.notice {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.notice strong { display: block; font-weight: 700; }
.notice p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.notice small { font-size: 0.75rem; color: var(--muted); display: block; margin-top: 8px; }

/* ── Profile/Workspace ───────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}
.side-tabs {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}
.side-tabs button {
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  border: 0;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.side-tabs button:hover { background: var(--panel); color: var(--ink); }
.side-tabs button.active { background: var(--leaf-light); color: var(--leaf-dark); font-weight: 800; }

.panel {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.panel h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 20px; }

/* Coupons */
.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.coupon-grid article {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--leaf-light), var(--sprout));
  border: 1.5px dashed var(--leaf);
}
.coupon-grid article strong { display: block; font-size: 1rem; font-weight: 900; font-family: monospace; color: var(--leaf-dark); letter-spacing: 0.08em; }
.coupon-grid article small { display: block; font-size: 0.78rem; color: var(--ink-2); margin-top: 5px; }

/* ── Seller / Admin Workspace ────────────────────────────── */
.product-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.product-form input, .product-form select, .product-form textarea { margin-bottom: 0; }
.product-form textarea { grid-column: span 2; }
.product-form button { grid-column: span 1; }

.table-list { display: grid; gap: 10px; margin-top: 16px; }
.table-list article {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1.5px solid var(--line);
  transition: all var(--transition);
}
.table-list article:hover { box-shadow: var(--shadow-sm); }
.table-list img { width: 54px; height: 54px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--line); }
.table-list article > span strong { display: block; font-weight: 700; font-size: 0.88rem; }
.table-list article > span small { color: var(--muted); font-size: 0.76rem; display: block; margin-top: 2px; }
.table-list button {
  padding: 7px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all var(--transition);
  margin-left: 6px;
}
.table-list button:hover { background: var(--leaf); border-color: var(--leaf); color: white; }

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stats article {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stats article small { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.stats article strong { display: block; font-size: 1.5rem; font-weight: 900; }

/* Analytics Chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding: 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}
.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.bar span {
  display: block;
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--leaf), var(--leaf-dark));
  min-height: 4px;
  height: var(--bar-h, 40%);
  animation: barGrow 0.8s cubic-bezier(0.4,0,0.2,1) forwards;
  box-shadow: 0 -2px 8px rgba(13,143,92,0.2);
}
.bar small { font-size: 0.7rem; font-weight: 600; color: var(--muted); }

/* Audit log */
.audit { max-height: 280px; overflow-y: auto; display: grid; gap: 6px; }
.audit p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 0.82rem;
}
.audit p strong { font-weight: 700; }
.audit p small { color: var(--muted); font-size: 0.72rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split article { padding: 16px; border-radius: var(--radius-lg); background: var(--panel); border: 1.5px solid var(--line); }
.split article h3 { font-size: 0.88rem; font-weight: 800; margin-bottom: 6px; }
.split article p { font-size: 0.84rem; color: var(--muted); }

/* Control grid */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.control-grid button {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition);
  text-align: left;
}
.control-grid button:hover { background: var(--leaf-light); border-color: var(--leaf); color: var(--leaf-dark); }

/* ── Category Page ───────────────────────────────────────── */
.category-page { margin-top: 8px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.category-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border-radius: var(--radius-xl);
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  text-align: center;
  transition: all var(--transition);
}
.category-grid button span { font-size: 2.2rem; }
.category-grid button strong { font-size: 0.85rem; font-weight: 800; }
.category-grid button small { color: var(--muted); font-size: 0.72rem; }
.category-grid button:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--leaf); background: var(--leaf-light); }

/* ── About ───────────────────────────────────────────────── */
.about-card {
  max-width: 600px;
  margin: 32px auto;
  text-align: center;
  padding: 40px 32px;
}
.about-card strong { font-size: 2rem; font-weight: 900; display: block; margin-bottom: 16px; }
.about-card p { color: var(--muted); margin-bottom: 24px; }

/* ── Locked / Empty ──────────────────────────────────────── */
.locked {
  max-width: 440px;
  margin: 48px auto;
  padding: 40px 32px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: var(--paper);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease;
}
.locked strong { font-size: 1.3rem; font-weight: 800; display: block; margin-bottom: 10px; }
.locked p { color: var(--muted); margin-bottom: 20px; font-size: 0.9rem; }
.locked button {
  padding: 12px 28px;
  border-radius: var(--radius);
  background: var(--leaf);
  color: white;
  border: 0;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(13,143,92,0.3);
  transition: all var(--transition);
}
.locked button:hover { background: var(--leaf-dark); transform: translateY(-2px); }

.empty {
  padding: 40px 24px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: var(--paper);
  border: 1.5px solid var(--line);
  animation: fadeUp 0.3s ease;
}
.empty strong { display: block; font-size: 1.05rem; font-weight: 800; }
.empty p { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

/* ── Skeleton ─────────────────────────────────────────────── */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.skeleton-grid article {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: var(--paper);
}
.skeleton-grid i {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, var(--panel) 25%, var(--wash) 50%, var(--panel) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-grid span {
  display: block;
  margin: 12px 14px 8px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--wash) 50%, var(--panel) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-grid b {
  display: block;
  margin: 0 14px 14px;
  width: 60%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--wash) 50%, var(--panel) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
}

/* ── AI Assistant ─────────────────────────────────────────── */
.assistant {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 150;
}
.assistant-fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--leaf), var(--purple));
  color: white;
  border: 0;
  font-size: 1.3rem;
  box-shadow: 0 8px 24px rgba(13,143,92,0.4);
  display: grid;
  place-items: center;
  transition: all var(--transition);
}
.assistant-fab:hover { transform: scale(1.1) rotate(5deg); }

.assistant-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 320px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: none;
  animation: scaleIn 0.2s ease;
}
.assistant.open .assistant-panel { display: block; }
.assistant-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--leaf-light), var(--panel));
}
.assistant-panel > div:first-child strong { font-weight: 800; font-size: 0.9rem; }
.assistant-panel > div:first-child button { background: transparent; border: 0; color: var(--muted); font-size: 1.1rem; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.assistant-panel form { padding: 12px 16px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.assistant-panel form input { flex: 1; margin-bottom: 0; padding: 9px 12px; font-size: 0.85rem; }
.assistant-panel form button { padding: 9px 12px; font-size: 0.78rem; white-space: nowrap; }
#assistantReply { padding: 12px 16px; font-size: 0.84rem; max-height: 280px; overflow-y: auto; }
#assistantReply p { color: var(--muted); margin-bottom: 10px; }
#assistantReply button { display: block; width: 100%; text-align: left; padding: 8px 12px; margin-bottom: 6px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); font-size: 0.82rem; font-weight: 600; color: var(--ink); transition: all var(--transition); }
#assistantReply button:hover { background: var(--leaf-light); color: var(--leaf-dark); }

/* ── Auth Modal ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: min(440px, 100%);
  background: var(--paper);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.2s ease;
  position: relative;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-head h2 { font-size: 1.4rem; font-weight: 900; }
.modal-head button { background: var(--panel); border: 0; width: 32px; height: 32px; border-radius: 8px; font-size: 1.1rem; color: var(--muted); display: grid; place-items: center; transition: all var(--transition); }
.modal-head button:hover { background: var(--wash); color: var(--ink); }
.demo-logins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.demo-logins button {
  padding: 9px 6px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all var(--transition);
}
.demo-logins button:hover { background: var(--leaf-light); border-color: var(--leaf); color: var(--leaf-dark); }

/* ── Mobile Nav ──────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 140;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 8px 4px env(safe-area-inset-bottom, 8px);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.mobile-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 6px 2px;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mobile-nav button span { font-size: 1.3rem; display: block; }
.mobile-nav button.active { color: var(--leaf); }
.mobile-nav button.active span { transform: scale(1.15); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease;
  white-space: nowrap;
  max-width: min(420px, calc(100vw - 32px));
  text-align: center;
}
.toast.error { background: var(--coral); }
.toast.success { background: var(--leaf); }

/* ── Muted text ──────────────────────────────────────────── */
.muted { color: var(--muted); font-size: 0.82rem; }

/* ── ============================================================
   RESPONSIVE — Tablet (≤900px)
   ============================================================ */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .reviews { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .checkout-page { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .side-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    gap: 6px;
  }
  .side-tabs button { flex: none; }
  .vendor-row { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; min-height: 280px; }
  .onion-logo-scene { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .product-form { grid-template-columns: 1fr; }
  .product-form textarea { grid-column: span 1; }
  .product-form button { grid-column: span 1; }
  .split { grid-template-columns: 1fr; }
}

/* ── ============================================================
   RESPONSIVE — Mobile (≤640px)
   ============================================================ */
@media (max-width: 640px) {
  :root { --topbar-h: auto; }
  main#main { width: calc(100% - 16px); padding-bottom: 76px; }

  .topbar {
    display: grid;
    grid-template-areas: 
      "menu brand actions"
      "search search search";
    grid-template-columns: auto 1fr auto;
    height: auto !important;
    padding: 10px 12px;
    gap: 8px;
  }
  
  .hamburger {
    grid-area: menu;
    display: grid;
  }
  
  .brand {
    grid-area: brand;
    justify-content: center;
  }
  .brand small { display: none; }

  .search-wrap {
    grid-area: search;
    width: 100%;
    max-width: none;
  }

  .top-actions {
    grid-area: actions;
    gap: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .top-actions > * {
    display: none !important;
  }
  .top-actions > .login-btn,
  .top-actions > .cart-btn {
    display: inline-flex !important;
    padding: 4px;
    background: transparent;
    border: 0;
    color: var(--ink);
    align-items: center;
    justify-content: center;
    min-width: unset;
  }
  .top-actions > .login-btn > span:not(.avatar-circle),
  .top-actions > .login-btn .arrow-down,
  .top-actions > .cart-btn > span {
    display: none !important;
  }

  .quick-actions {
    justify-content: flex-start;
    gap: 16px;
    padding: 10px 4px;
  }
  .quick-actions button {
    min-width: 60px;
  }
  .quick-actions button span {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .product-grid, .skeleton-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
  .horizontal-products .product-card { min-width: 150px; }

  .hero { padding: 20px; min-height: 200px; grid-template-columns: 1fr; border-radius: 8px; }
  .hero h1 { font-size: 1.8rem; }
  .section-head h2 { font-size: 1.1rem; }
  .flash-sale { flex-direction: column; text-align: center; gap: 14px; padding: 20px; }
  .flash-sale::after { display: none; }

  .vendor-row { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chart { height: 120px; }

  .workspace { grid-template-columns: 1fr; }
  .side-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; position: static; padding: 8px; gap: 4px; }
  .side-tabs::-webkit-scrollbar { display: none; }
  .side-tabs button { flex-shrink: 0; font-size: 0.78rem; padding: 8px 12px; }

  .cart-layout { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 56px 1fr auto; }
  .cart-item .qty { display: none; }
  .checkout-page { grid-template-columns: 1fr; }

  .detail-grid { grid-template-columns: 1fr; }
  .reviews { grid-template-columns: 1fr; }

  .mobile-nav { display: grid; }
  .assistant { bottom: 74px; right: 14px; }
  .toast { bottom: 78px; font-size: 0.82rem; padding: 10px 18px; }
  .demo-logins { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .product-form { grid-template-columns: 1fr; }
}

/* ── ============================================================
   RESPONSIVE — Small mobile (≤400px)
   ============================================================ */
@media (max-width: 400px) {

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.7rem; }
  .modal { padding: 24px 18px; }
}

/* ── Special Offers Section ── */
.special-offers-section {
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.special-offers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.special-offers-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #212121;
  margin: 0;
}
.special-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform var(--transition);
}
.special-arrow-btn:hover {
  transform: scale(1.1);
}
.special-offers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.special-offer-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
}
.special-offer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.special-offer-image {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: #ffffff;
}
.special-offer-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.special-offer-title {
  font-size: 0.82rem;
  color: #212121;
  margin-bottom: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.special-offer-promo {
  font-size: 0.88rem;
  font-weight: 700;
  color: #000000;
}

[data-theme="dark"] .special-offers-section {
  background: var(--panel) !important;
  border-color: var(--line) !important;
}
[data-theme="dark"] .special-offers-section h2,
[data-theme="dark"] .special-offer-title {
  color: #ffffff;
}
[data-theme="dark"] .special-offer-promo {
  color: var(--leaf);
}
[data-theme="dark"] .special-offer-card {
  background: var(--paper);
}

@media (max-width: 640px) {
  .special-offers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .special-offer-image {
    height: 100px;
  }
}

