@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Work+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- ShopKuku brand palette (from logo) ---- */
  --bg: #F7F8FA;
  --paper: #FFFFFF;
  --ink: #16233B;
  --primary: #1B3A6B;      /* logo navy blue */
  --primary-dark: #12294D;
  --accent: #F26522;       /* logo orange */
  --accent-dark: #D14F14;
  --leaf: #7CB93F;         /* logo green */
  --sage: #E7F1DC;
  --border: #E3E7ED;
  --success: #2E7D5B;
  --danger: #C0463B;
  --muted: #6B7686;
  --white: #fff;

  /* legacy aliases so existing panel pages keep working */
  --dark: var(--ink);
  --light-bg: var(--bg);
  --text: var(--ink);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ================= Scrolling announcement bar ================= */
.announcement-bar {
  background: var(--accent);
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
}
.announcement-track {
  display: inline-flex;
  animation: announcement-scroll 22s linear infinite;
}
.announcement-track span {
  padding: 0 40px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
@keyframes announcement-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.announcement-bar:hover .announcement-track { animation-play-state: paused; }

/* ================= Utility top bar ================= */
.utility-bar {
  background: var(--ink);
  color: #cfd8d1;
  font-size: 12.5px;
}
.utility-bar .container {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 20px; flex-wrap: wrap; gap: 6px;
}
.utility-bar a { color: #cfd8d1; }
.utility-bar a:hover { color: var(--accent); }
.utility-bar .sep { opacity: 0.4; margin: 0 8px; }

/* ================= Main navbar ================= */
.navbar { background: var(--paper); border-bottom: 1px solid var(--border); padding: 18px 0; }
.navbar .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.navbar .logo { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.navbar .logo span { color: var(--accent); }

.navbar .search-form { flex: 1; display: flex; min-width: 220px; max-width: 520px; }
.navbar .search-form input {
  flex: 1; padding: 11px 16px; border: 1.5px solid var(--border); border-right: none;
  border-radius: 24px 0 0 24px; font-family: var(--font-body); font-size: 14px; background: var(--bg);
}
.navbar .search-form input:focus { outline: none; border-color: var(--primary); }
.navbar .search-form button {
  background: var(--primary); color: #fff; border: none; padding: 0 22px;
  border-radius: 0 24px 24px 0; cursor: pointer; font-weight: 600; font-size: 13px;
}
.navbar .search-form button:hover { background: var(--primary-dark); }

.cart-icon-link {
  position: relative; font-size: 22px; text-decoration: none; flex-shrink: 0;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 50%;
  margin-left: auto;
}
.cart-count-badge {
  position: absolute; top: -4px; right: -4px; background: var(--accent); color: var(--ink);
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; font-family: var(--font-mono);
}

.navbar nav { display: flex; align-items: center; gap: 24px; }
.navbar nav > a { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.navbar nav > a:hover { color: var(--primary); }

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 600;
  color: var(--ink); font-family: var(--font-body); padding: 0;
}
.nav-dropdown-btn:hover { color: var(--primary); }
.nav-dropdown-panel {
  display: none;
  position: absolute; top: calc(100% + 14px); left: 0;
  background: var(--paper); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(22,35,59,0.12);
  min-width: 220px; padding: 8px 0; z-index: 50;
}
.nav-dropdown-panel.open { display: block; }
.nav-dropdown-panel a {
  display: block; padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap;
}
.nav-dropdown-panel a:hover { background: var(--bg); color: var(--primary); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 20px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}

/* ================= Hero: Market Stalls ================= */
.hero-market {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  margin: 28px 0;
  align-items: stretch;
}
.hero-headline {
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero-headline::after {
  content: "";
  position: absolute; right: -40px; bottom: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(232,163,61,0.18);
}
.hero-headline .eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero-headline h1 { font-size: 38px; line-height: 1.15; color: #fff; max-width: 420px; }
.hero-headline p { margin-top: 14px; color: #d9e9df; max-width: 380px; font-size: 15px; }
.hero-headline .btn { margin-top: 22px; align-self: flex-start; }

.hero-stalls { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 18px; }
.stall-tile {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 110px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stall-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31,111,84,0.12); }
.stall-tile .tile-icon { font-size: 26px; margin-bottom: 10px; }
.stall-tile .tile-name { font-weight: 600; font-size: 14.5px; }
.stall-tile .tile-count { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

@media (max-width: 860px) {
  .hero-market { grid-template-columns: 1fr; }
  .hero-headline h1 { font-size: 28px; }
}

/* ================= Product image (full size, not cropped) ================= */
.product-zoom-container {
  width: 400px; max-width: 100%; min-height: 400px;
  border-radius: 10px; overflow: hidden; position: relative;
  border: 1px solid var(--border); background: var(--sage); cursor: zoom-in;
  display: flex; align-items: center; justify-content: center;
}
.product-zoom-container img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 0.15s ease-out;
}
.zoom-hint {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(22,35,59,0.7); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 12px; pointer-events: none; opacity: 0;
  transition: opacity 0.15s;
}
.product-zoom-container:hover .zoom-hint { opacity: 1; }
.product-zoom-container.zoomed .zoom-hint,
.product-zoom-container.zoomed-tap .zoom-hint { opacity: 0; }
@media (max-width: 480px) {
  .product-zoom-container { width: 100%; height: auto; min-height: 280px; }
}

/* ================= Color swatch picker (variations) ================= */
.color-swatch-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; padding: 0; position: relative; transition: transform 0.1s, border-color 0.15s;
}
.color-swatch-btn:hover { transform: scale(1.08); }
.color-swatch-btn.selected {
  border-color: var(--primary); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--primary);
}

/* ================= Rich text description content ================= */
.rich-content { line-height: 1.75; font-size: 14.5px; }
.rich-content h1, .rich-content h2, .rich-content h3 { margin: 16px 0 8px; font-family: var(--font-display); }
.rich-content p { margin-bottom: 10px; }
.rich-content ul, .rich-content ol { margin: 10px 0 10px 22px; }
.rich-content blockquote { border-left: 3px solid var(--primary); padding-left: 14px; color: var(--muted); margin: 12px 0; }
.rich-content a { color: var(--primary); text-decoration: underline; }

/* ================= Onload popup ================= */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(22,35,59,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.25s;
  padding: 20px;
}
.popup-overlay.open { opacity: 1; pointer-events: auto; }
.popup-box {
  background: var(--paper); border-radius: 14px; overflow: hidden;
  max-width: 440px; width: 100%; max-height: 90vh; overflow-y: auto;
  position: relative;
  transform: scale(0.9); transition: transform 0.25s;
}
.popup-overlay.open .popup-box { transform: scale(1); }
.popup-box img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.popup-title { padding: 16px 20px; font-weight: 600; text-align: center; }
.popup-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; z-index: 2;
}

/* ================= Banner slider ================= */
.banner-slider { position: relative; margin: 28px 0; border-radius: 14px; overflow: hidden; }
.banner-slider-full {
  margin: 0;
  border-radius: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.slider-track { display: flex; transition: transform 0.5s ease; }
.slider-track .slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  position: relative;
  display: block;
}
.slider-track .slide img { width: 100%; height: 340px; object-fit: cover; display: block; }
.banner-slider-full .slider-track .slide img { width: 100%; height: auto; aspect-ratio: 1296 / 679; object-fit: cover; }
.slide-caption { position: absolute; left: 60px; bottom: 50px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.4); max-width: 520px; }
.slide-caption h2 { color: #fff; font-size: 32px; }
.slide-caption p { margin-top: 8px; font-size: 15px; }
.slider-dots { position: absolute; bottom: 20px; right: 30px; display: flex; gap: 6px; }
.slider-dots .dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); cursor: pointer; }
.slider-dots .dot.active { background: var(--accent); width: 22px; border-radius: 5px; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.85); color: var(--ink); font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.slider-arrow:hover { background: #fff; }
.slider-arrow.prev { left: 24px; }
.slider-arrow.next { right: 24px; }
/* Tablet range */
@media (max-width: 1024px) and (min-width: 701px) {
  .slide-caption h2 { font-size: 26px; }
}

@media (max-width: 700px) {
  .slider-track .slide img { height: 200px; min-height: 200px; display: block; }
  .slide-caption { left: 16px; bottom: 16px; max-width: calc(100% - 32px); }
  .slide-caption h2 { font-size: 20px; }
  .slider-arrow { width: 34px; height: 34px; font-size: 18px; }
  .slider-arrow.prev { left: 10px; }
  .slider-arrow.next { right: 10px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .slide-caption h2 { font-size: 17px; }
  .slide-caption p { font-size: 12px; }
}

/* ================= Two-column hero: banner slider + new arrivals ================= */
.hero-two-col { display: flex; gap: 0; align-items: flex-start; margin-bottom: 24px; }
.hero-two-col + .container > .section-row:first-child { margin-top: 20px; }
.hero-banner-col { flex: 1 1 68%; min-width: 0; }
.hero-newproducts-col {
  flex: 0 0 32%; max-width: 32%;
  background: var(--paper); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden; /* height is set explicitly via JS to exactly match the slider */
}
.new-arrivals-header {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
/* Reuses the exact same .product-card component as Best Sellers/Latest —
   this override just forces it into a tight 2-column grid to fit the
   narrow hero column, with slightly smaller type to match the space. */
.new-arrivals-grid.product-grid {
  height: 100%;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  margin-bottom: 0;
}
/* The image flexes to fill whatever space is left after the text block,
   instead of a fixed height — that's what let the name/price get clipped
   off before when the carousel's available height was tighter than a
   fixed-height image + text needed. */
.new-arrivals-grid .product-card { display: flex; flex-direction: column; height: 100%; }
.new-arrivals-grid .product-card .thumb-wrap { flex: 1; min-height: 40px; }
.new-arrivals-grid .product-card img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.new-arrivals-grid .product-card .info { flex-shrink: 0; padding: 8px 10px 10px; }
.new-arrivals-grid .product-card .name { font-size: 12.5px; -webkit-line-clamp: 2; }
.new-arrivals-grid .product-card .price { font-size: 13px; }
.new-arrivals-grid .product-card .stars,
.new-arrivals-grid .product-card .vendor-stamp { display: none; } /* keep it compact in the tight column */

@media (max-width: 900px) {
  .hero-two-col { flex-direction: column; }
  .hero-newproducts-col { flex: none; max-width: 100%; height: auto !important; border-left: none; border-top: 1px solid var(--border); overflow: visible; }
  .new-arrivals-header { font-size: 22px; font-weight: 600; } /* matches .section-title used by Best Sellers */
  .na-carousel-viewport { min-height: 0; overflow-x: hidden; overflow-y: visible; }
  .na-carousel-track { height: auto; }
  .na-carousel-page { height: auto; }
  .new-arrivals-grid.product-grid { height: auto; grid-template-rows: none; gap: 16px; padding: 16px; }
  /* On mobile there's no height constraint, so a fixed, generous image
     size looks better than the flex-fill used on desktop. */
  .new-arrivals-grid .product-card { height: auto; }
  .new-arrivals-grid .product-card .thumb-wrap { flex: none; }
  .new-arrivals-grid .product-card img { width: 286px; max-width: 100%; height: 200px; object-fit: cover; }
  .new-arrivals-grid .product-card .info { padding: 14px; }
  .new-arrivals-grid .product-card .name { font-size: 14.5px; -webkit-line-clamp: 2; }
  .new-arrivals-grid .product-card .price { font-size: 15px; }
  .new-arrivals-grid .product-card .stars { display: flex; }
  .new-arrivals-grid .product-card .vendor-stamp { display: none; }
}

/* ================= Homepage scrolling category strip ================= */
.category-strip-wrap { position: relative; margin: 28px 0; display: flex; align-items: center; gap: 8px; }
.category-strip-scroll {
  display: flex; gap: 20px; overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x proximity; padding: 4px 2px 10px;
  flex: 1; min-width: 0;
  scrollbar-width: thin;
}
.category-strip-scroll::-webkit-scrollbar { height: 6px; }
.category-strip-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.cat-strip-item {
  flex: 0 0 calc(25% - 15px); min-width: 130px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.cat-strip-circle {
  width: 100px; height: 100px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--border); display: block; transition: border-color 0.15s, transform 0.15s;
}
.cat-strip-item:hover .cat-strip-circle { border-color: var(--primary); transform: translateY(-3px); }
.cat-strip-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-strip-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cat-strip-arrow {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--paper); cursor: pointer; font-size: 20px; color: var(--ink); line-height: 1;
}
.cat-strip-arrow:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 768px) {
  .cat-strip-item { flex: 0 0 calc(33.33% - 14px); min-width: 100px; }
  .cat-strip-circle { width: 76px; height: 76px; }
  .cat-strip-name { font-size: 12px; }
  .cat-strip-arrow { display: none; }
}
@media (max-width: 480px) {
  .cat-strip-item { flex: 0 0 calc(40% - 12px); min-width: 88px; }
  .cat-strip-circle { width: 68px; height: 68px; }
}

/* ================= Mid-page banner (between Best Sellers and Latest) ================= */
.mid-page-banner { position: relative; width: 100%; margin: 32px 0; }
.mid-page-banner img { width: 100%; height: 280px; object-fit: cover; display: block; }
.mid-page-banner a { display: block; position: relative; }
@media (max-width: 700px) {
  .mid-page-banner img { height: 160px; }
}

/* ================= Section headers ================= */
.section-row { display: flex; justify-content: space-between; align-items: baseline; margin: 38px 0 16px; }
.section-row .section-title { font-size: 24px; margin: 0; }
.section-row .section-sub { font-size: 13px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.section-row .view-all { font-size: 13px; font-weight: 600; color: var(--primary); border-bottom: 1.5px solid var(--primary); padding-bottom: 1px; }
.section-title { font-size: 22px; margin: 30px 0 16px; }

/* Tabs (Featured / Best Selling / Latest) */
.product-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.product-tabs button {
  background: none; border: none; padding: 10px 4px; margin-right: 22px; font-family: var(--font-body);
  font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent;
}
.product-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  padding: 11px 22px; border-radius: 24px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 18px; }
.btn-block { width: 100%; justify-content: center; }

/* ================= Product cards ================= */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin-bottom: 10px; }
.product-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; position: relative; transition: box-shadow 0.15s, transform 0.15s;
}
.product-card:hover { box-shadow: 0 12px 28px rgba(27,36,32,0.1); transform: translateY(-3px); }
.product-card .thumb-wrap { position: relative; }
.product-card img { height: 190px; width: 100%; object-fit: cover; background: var(--sage); }
.product-card .discount-flag {
  position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--ink);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px;
}
.product-card .info { padding: 14px; }
.product-card .stars { color: var(--accent); font-size: 12px; margin-bottom: 4px; }
.product-card .stars .count { color: var(--muted); font-family: var(--font-mono); margin-left: 3px; }
.product-card .name { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; line-height: 1.3; }
.product-card .price { font-family: var(--font-mono); color: var(--primary); font-weight: 600; font-size: 15px; }
.product-card .old-price { text-decoration: line-through; color: #b3aca0; font-size: 12.5px; margin-left: 6px; font-family: var(--font-mono); }
.vendor-name { font-size: 12.5px; color: var(--muted); }

/* vendor stamp: signature element */
.vendor-stamp {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
}
.vendor-stamp .seal {
  width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700; color: #fff;
  border: 1.5px dashed rgba(255,255,255,0.6);
}
.vendor-stamp .shop { font-size: 11.5px; color: var(--muted); }

/* ================= Category tiles (Find what you need) ================= */
.category-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin-bottom: 10px; }
.category-tile-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: 14px; padding: 30px 20px;
  text-align: center; transition: border-color 0.15s, transform 0.15s;
}
.category-tile-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.category-tile-card .glyph {
  width: 72px; height: 72px; border-radius: 50%; background: var(--sage); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 32px;
}
.category-tile-card .cname { font-weight: 700; font-size: 17px; }
.category-tile-card .ccount { font-size: 13px; color: var(--muted); font-family: var(--font-mono); margin-top: 4px; }

/* ================= Vendor spotlight ================= */
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vendor-spot-card { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.vendor-spot-card .vhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.vendor-spot-card .seal { width: 44px; height: 44px; font-size: 18px; }
.vendor-spot-card .vname { font-weight: 700; font-size: 16px; }
.vendor-spot-card .vcount { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.vendor-spot-card .vproducts { display: flex; gap: 8px; }
.vendor-spot-card .vproducts img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

/* ================= Trust / features strip ================= */
.features-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 20px; margin: 44px 0; padding: 30px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-item .ficon { width: 46px; height: 46px; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.feature-item .ftitle { font-weight: 600; font-size: 14px; }
.feature-item .fsub { font-size: 12px; color: var(--muted); }

/* ================= Auth boxes ================= */
.auth-box {
  max-width: 420px; margin: 60px auto; background: var(--paper); padding: 34px;
  border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 8px 30px rgba(27,36,32,0.05);
}
.auth-box h2 { margin-bottom: 6px; }
.auth-box p.sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.auth-box label { display: block; margin: 12px 0 5px; font-size: 13px; font-weight: 500; }
.auth-box input, .auth-box select, .auth-box textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: var(--font-body); background: var(--bg);
}
.auth-box input:focus, .auth-box select:focus, .auth-box textarea:focus { outline: none; border-color: var(--primary); background: var(--paper); }
.auth-box button { margin-top: 20px; }
.auth-box .switch-link { display: block; margin-top: 16px; font-size: 13px; text-align: center; color: var(--primary); font-weight: 600; }

.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.alert-error { background: #fbe9e7; color: var(--danger); border: 1px solid #f3c9c3; }
.alert-success { background: #e6f3ec; color: var(--success); border: 1px solid #bfe0cd; }
.alert { background: #e6f3ec; color: var(--success); border: 1px solid #bfe0cd; } /* default .alert used in a few pages */

/* ================= Dashboard (Admin/Vendor) ================= */
.dashboard { display: flex; min-height: 100vh; }
.sidebar { width: 235px; background: var(--ink); color: #fff; padding: 22px 0; flex-shrink: 0; }
.sidebar .brand { padding: 0 22px 22px; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--accent); }
.sidebar a { display: block; padding: 12px 22px; color: #cdd6cf; font-size: 13.5px; font-weight: 500; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,0.07); color: #fff; border-left: 3px solid var(--accent); }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; margin-left: 4px;
  font-family: var(--font-mono);
}
.main-content { flex: 1; padding: 26px 30px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.topbar h2 { font-size: 22px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--paper); padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.stat-card .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 10px; overflow: hidden; }
table th, table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13.5px; }
table th { background: var(--bg); color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; }

/* ================= Generic dashboard form styling ================= */
/* Applies to every plain form inside admin/vendor panels so labels,
   inputs, selects and textareas are consistent without needing
   per-page CSS. Inline styles on individual inputs still win where set. */
.main-content form:not(.dashboard form) label,
.main-content > form label,
.main-content form label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.main-content form input[type="text"],
.main-content form input[type="email"],
.main-content form input[type="password"],
.main-content form input[type="number"],
.main-content form input[type="date"],
.main-content form input[type="tel"],
.main-content form input[type="file"],
.main-content form select,
.main-content form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
}
.main-content form input:focus,
.main-content form select:focus,
.main-content form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--paper);
}
.main-content form input[type="file"] { padding: 8px 10px; background: var(--paper); }
.panel-card {
  background: var(--paper);
  padding: 26px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.panel-card label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.panel-card label:first-child { margin-top: 0; }
.panel-card input[type="text"],
.panel-card input[type="email"],
.panel-card input[type="password"],
.panel-card input[type="number"],
.panel-card input[type="date"],
.panel-card input[type="tel"],
.panel-card input[type="file"],
.panel-card select,
.panel-card textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
}
.panel-card input:focus, .panel-card select:focus, .panel-card textarea:focus {
  outline: none; border-color: var(--primary); background: var(--paper);
}
.panel-card input[readonly] { background: #eef0f2; color: var(--muted); cursor: not-allowed; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.inline-mini-form label { display: none; } /* small inline forms embedded in table cells stay compact */
.inline-mini-form input, .inline-mini-form select {
  width: auto !important;
  padding: 6px 8px !important;
  font-size: 12.5px !important;
  margin-bottom: 0 !important;
}
.badge { padding: 3px 11px; border-radius: 12px; font-size: 11.5px; font-weight: 600; }
.badge-pending { background: #fdf2df; color: #93690f; }
.badge-approved, .badge-active, .badge-delivered, .badge-paid { background: #e6f3ec; color: var(--success); }
.badge-rejected, .badge-suspended, .badge-cancelled, .badge-failed { background: #fbe9e7; color: var(--danger); }
.badge-processing, .badge-shipped, .badge-out_for_delivery { background: #e5eefa; color: #1a5fa8; }

footer.site-footer { background: var(--ink); color: #cdd6cf; padding: 50px 0 0; margin-top: 50px; font-size: 13.5px; }
footer.site-footer .foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 34px; }
footer.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 14px; margin-bottom: 14px; }
footer.site-footer a { color: #b7c2ba; display: block; margin-bottom: 9px; }
footer.site-footer a:hover { color: var(--accent); }
footer.site-footer .brand { font-family: var(--font-display); font-size: 22px; color: #fff; margin-bottom: 10px; }
footer.site-footer .brand span { color: var(--accent); }
footer.site-footer .newsletter-form { display: flex; margin-top: 10px; max-width: 320px; }
footer.site-footer .newsletter-form input { flex: 1; padding: 9px 12px; border-radius: 6px 0 0 6px; border: none; font-size: 13px; }
footer.site-footer .newsletter-form button { background: var(--accent); color: var(--ink); border: none; padding: 0 16px; border-radius: 0 6px 6px 0; font-weight: 700; cursor: pointer; }
footer.site-footer .bottom-bar { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; text-align: center; font-size: 12px; color: #8b968f; }
@media (max-width: 800px) { footer.site-footer .foot-grid { grid-template-columns: 1fr 1fr; } }

/* legacy plain footer (used in dashboards) */
footer:not(.site-footer) { background: var(--ink); color: #cdd6cf; text-align: center; padding: 20px; margin-top: 40px; font-size: 13px; }

/* ================= Mobile bottom nav (app-style) ================= */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  /* ---- App-like bottom navigation ---- */
  body { padding-bottom: 64px; }
  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--paper);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(22,35,59,0.08);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10.5px; font-weight: 600; color: var(--muted);
    padding: 4px 0;
  }
  .mobile-bottom-nav a.active { color: var(--primary); }
  .mobile-bottom-nav .mbn-icon { font-size: 19px; position: relative; line-height: 1; }
  .mobile-bottom-nav .mbn-badge {
    position: absolute; top: -6px; right: -10px; background: var(--accent); color: var(--ink);
    font-size: 9px; font-weight: 700; min-width: 14px; height: 14px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; font-family: var(--font-mono);
  }

  /* ---- Admin/Vendor dashboard shell ---- */
  .dashboard { flex-direction: column; }
  .sidebar {
    width: 100%;
    padding: 12px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .sidebar .brand { padding: 0 14px; border-right: 1px solid rgba(255,255,255,0.12); flex-shrink: 0; }
  .sidebar > div { flex-shrink: 0; border-bottom: none !important; padding: 0 14px !important; margin-bottom: 0 !important; }
  .sidebar a {
    display: inline-block;
    padding: 10px 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sidebar a.active { border-left: none; border-bottom: 3px solid var(--accent); }
  .main-content { padding: 18px 16px; }

  /* ---- Storefront navbar ---- */
  .navbar .container { flex-wrap: wrap; align-items: center; gap: 10px; position: relative; }
  .navbar .logo { order: 1; }
  .navbar .logo img { height: 40px !important; }
  .navbar .search-form { order: 4; max-width: none; margin: 0; flex-basis: 100%; }
  .cart-icon-link { order: 2; margin-left: auto; }
  .nav-toggle { display: block; order: 3; }
  .navbar nav {
    display: none;
    order: 5;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-top: 4px;
  }
  .navbar nav.open { display: flex; }
  .navbar nav > a { padding: 10px 4px; width: 100%; }
  .nav-dropdown-panel { position: static; box-shadow: none; border: none; padding: 0 0 0 12px; min-width: 0; }
  .nav-dropdown-panel.open { display: block; }
  .utility-bar .container { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* ---- Topbar / page headers ---- */
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .section-row { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* ---- Tables: scroll horizontally within themselves, never the whole page ---- */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table tr { display: table-row; }

  /* ---- Stat cards / grids ---- */
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .category-tiles { grid-template-columns: repeat(2, 1fr); }
  .vendor-grid { grid-template-columns: 1fr; }

  /* ---- Hero / stalls ---- */
  .hero-stalls { grid-template-columns: 1fr 1fr; }

  /* ---- Auth boxes ---- */
  .auth-box { margin: 30px auto; padding: 24px 20px; }

  /* ---- Checkout summary shouldn't stick once stacked on mobile ---- */
  [style*="position:sticky"] { position: static !important; }

  /* ---- Cart page: card layout instead of horizontal-scroll table ---- */
  .cart-table { display: block; overflow-x: visible; white-space: normal; }
  .cart-table tr:first-child { display: none; } /* hide header row, labels shown per-field instead */
  .cart-table tr {
    display: block; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px; margin-bottom: 12px; background: var(--paper);
  }
  .cart-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border: none; font-size: 13.5px;
  }
  .cart-table td[data-label]::before {
    content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; margin-right: 10px;
  }
  .cart-table td:first-child { display: block; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
  .cart-table td:first-child::before { content: none; }

  /* ---- Footer ---- */
  footer.site-footer .foot-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .category-tiles { grid-template-columns: 1fr; }
  .hero-stalls { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .navbar .logo img { height: 30px !important; }
  h1 { font-size: 22px !important; }
  .hero-headline h1 { font-size: 22px !important; }
}
