/* TafutaChimbo - Local Shops Directory (v58)
   Palette: market-teal, marigold, brick, ink, paper
*/

:root {
  --paper: #F7F5F0;
  --panel: #FFFFFF;
  --ink: #1B1B1B;
  --ink-soft: #55524B;
  --line: #E4E0D6;
  --teal: #145C52;
  --teal-dark: #0D3F38;
  --marigold: #E3A008;
  --brick: #A63D28;
  --radius: 4px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Work Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 16px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wordmark .site-name-text span { color: var(--brick); }

.site-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  font-size: 15px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--marigold);
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn-brick {
  background: var(--brick);
  border-color: var(--brick);
  color: #fff;
}

.btn-outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */

.hero {
  border-bottom: 2px solid var(--ink);
  padding: 56px 0 40px;
  background:
    repeating-linear-gradient(135deg, transparent, transparent 38px, rgba(20,92,82,0.05) 38px, rgba(20,92,82,0.05) 40px);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  max-width: 16ch;
}

.hero p.lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 28px;
}

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-row input[type="text"] {
  flex: 1 1 260px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--panel);
}

.search-row select {
  padding: 14px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--panel);
}

.search-row button {
  padding: 14px 24px;
}

.category-browse-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
}

.category-browse-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 640px) {
  .category-browse-cta {
    display: none;
  }
}

/* ---------- Homepage supplier slideshow ---------- */

.slideshow {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin: 24px 0 14px;
  box-shadow: 6px 6px 0 var(--ink);
}

.slideshow-track {
  display: flex;
  transition: transform 0.5s ease;
}

.slideshow-slide {
  flex: 0 0 100%;
  position: relative;
  height: 440px;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-end;
}

.slideshow-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27, 27, 27, 0.78), rgba(27, 27, 27, 0) 60%);
}

.slideshow-slide-info {
  position: relative;
  z-index: 1;
  padding: 28px 32px;
  color: #fff;
}

.slideshow-slide-info .category-tag {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.slideshow-slide-info h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.6vw, 32px);
  margin: 8px 0 2px;
}

.slideshow-slide-info p {
  margin: 0;
  font-size: 15px;
  opacity: 0.9;
}

/* Advertisement slides (Admin > Homepage slideshow > Advertisements): the
   uploaded banner image is the whole creative, so it's shown edge to edge
   with no darkening gradient or text overlay on top of it - just the
   image itself, made clickable. */
.slideshow-slide-ad {
  align-items: stretch;
}

.slideshow-slide-ad::after {
  content: none;
}

.slideshow-dots {
  position: absolute;
  bottom: 16px;
  right: 22px;
  z-index: 2;
  display: flex;
  gap: 7px;
}

.slideshow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: rgba(255, 255, 255, 0.35);
  padding: 0;
  cursor: pointer;
}

.slideshow-dot.active {
  background: var(--marigold);
  border-color: var(--marigold);
}

.slideshow-prev, .slideshow-next {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

@media (max-width: 900px) {
  .slideshow-slide { height: 320px; }
}

@media (max-width: 640px) {
  .slideshow { box-shadow: 4px 4px 0 var(--ink); margin-bottom: 10px; }
  .slideshow-slide { height: 240px; }
  .slideshow-slide-info { padding: 16px 18px; }
  .slideshow-slide-info h3 { font-size: 19px; }
  .slideshow-prev, .slideshow-next { width: 36px; height: 36px; font-size: 20px; }
}

/* ---------- Directory ---------- */

.directory {
  padding: 40px 0 80px;
}

.directory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.directory-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0;
}

#result-count {
  color: var(--ink-soft);
  font-size: 14px;
}

.directory-more {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.shop-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
}

.shop-card:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }

.card-banner {
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  border-bottom: 2px solid var(--ink);
}

.card-banner-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  color: #fff;
}

.shop-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.category-tag {
  font-size: 12px;
  border: 1.5px solid var(--ink-soft);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

.shop-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
}

.shop-card .location {
  font-size: 14px;
  color: var(--ink-soft);
  margin: -6px 0 0;
}

.shop-card p.desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  flex-grow: 1;
}

.shop-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.shop-card .card-actions .btn {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  font-size: 14px;
}

.empty-state {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* ---------- Shop detail page ---------- */

.shop-hero-banner {
  height: 220px;
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid var(--ink);
}

.shop-hero-fallback { opacity: 0.85; }

.shop-hero-info {
  padding-top: 24px;
}

.shop-hero-info h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  margin: 8px 0 2px;
}

.shop-hero-info .location {
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.shop-hero-info .desc {
  max-width: 60ch;
  margin: 0 0 20px;
}

.items-section {
  padding: 40px 0 72px;
}

.items-section h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 18px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.item-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item-card:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }

.item-image {
  aspect-ratio: 4 / 3;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  border-bottom: 2px solid var(--ink);
}

.item-card h4 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 14px 16px 2px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-price {
  font-weight: 600;
  color: var(--teal-dark);
  margin: 0 16px 16px;
  font-size: 14px;
}

.item-desc {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 16px 14px;
}

.item-shop-line {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 16px 14px;
}

.item-shop-line strong { color: var(--ink); }

#products-section { padding-bottom: 12px; }

#products-section + .directory { padding-top: 0; }

.manage-link {
  margin-top: 24px;
  font-size: 14px;
}

.manage-link a { color: var(--ink-soft); }

/* ---------- Dashboard: item edit ---------- */

.item-card-actions {
  display: flex;
  gap: 8px;
  margin: 0 16px 14px;
}

.item-card-actions .btn {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  font-size: 13px;
}

.item-edit-panel {
  border-top: 2px solid var(--line);
  padding: 16px;
}

.edit-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.edit-thumb {
  position: relative;
  width: 76px;
  height: 76px;
}

.edit-thumb .thumb-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background-size: cover;
  background-position: center;
  background-color: var(--line);
}

.edit-thumb .remove-image-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--brick);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
}

/* ---------- Product detail page ---------- */

.breadcrumb {
  font-size: 14px;
  margin: 0 0 20px;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--ink); }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.product-main-image {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  max-height: 480px;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: zoom-in;
}

.product-image-fallback {
  opacity: 0.6;
  cursor: default;
  background:
    repeating-linear-gradient(135deg, var(--line), var(--line) 14px, var(--panel) 14px, var(--panel) 28px);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav:hover { background: var(--ink); color: var(--paper); }

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(27, 27, 27, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.product-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.product-thumb {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  padding: 0;
  cursor: pointer;
}

.product-thumb:hover { border-color: var(--ink-soft); }

.product-thumb.active { border-color: var(--marigold); }

.product-info h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.6vw, 32px);
  margin: 0 0 8px;
}

.product-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--teal-dark);
  margin: 0 0 16px;
}

.product-desc {
  color: var(--ink-soft);
  margin: 0 0 20px;
  white-space: pre-wrap;
}

.product-shop-line {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.product-shop-line a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.btn-order { width: 100%; text-align: center; padding: 14px 20px; }

.save-slot { margin-top: 12px; }

.save-btn { width: 100%; text-align: center; }

.save-btn.saved { background: var(--teal); color: #fff; border-color: var(--teal); }

/* A saved-items card (saved.html) needs both a link to the product and a
   Remove button, so unlike the plain <a class="item-card"> cards elsewhere,
   here the link is a child of the card rather than the card itself. */
.item-card > a { display: block; color: inherit; text-decoration: none; }

@media (max-width: 760px) {
  .product-layout { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Fullscreen image lightbox (product photos) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 13, 0.92);
  padding: 16px;
}

.lightbox.open { display: flex; }

body.lightbox-open { overflow: hidden; }

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover { background: rgba(0, 0, 0, 0.65); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover { background: rgba(0, 0, 0, 0.65); }

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 20px; }
  .lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ---------- Submit page ---------- */

.form-page {
  padding: 48px 0 80px;
}

.form-page h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 6px;
}

.form-page .sub {
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 56ch;
}

.shop-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.field .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 13px;
}

.field .hint a {
  color: var(--teal);
  font-weight: 600;
}

.field p.hint {
  margin: 6px 0 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--panel);
}

.field textarea { resize: vertical; min-height: 90px; }

.form-status {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}

.form-status.show { display: block; }

.form-status.success { background: #E7F2EE; border: 1.5px solid var(--teal); color: var(--teal-dark); }

.form-status.error { background: #FBEAE6; border: 1.5px solid var(--brick); color: var(--brick); }

.auth-divider {
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.toggle-line {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-soft);
}

.toggle-line a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.forgot-line {
  margin-top: -8px;
  text-align: right;
  font-size: 13px;
}

.forgot-line a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-row {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-row-info strong {
  font-family: var(--font-display);
  font-size: 16px;
  margin-right: 10px;
}

.admin-row-info .location {
  color: var(--ink-soft);
  font-size: 13px;
  display: block;
  margin: 2px 0;
}

.admin-row-info .desc {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 4px 0 0;
  max-width: 60ch;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-row-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
}

/* manage-categories.html: colour swatch + name input inline in an
   otherwise-plain admin-row, editable in place. */
.admin-row-info .cat-color-input {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  vertical-align: middle;
  margin-right: 10px;
  cursor: pointer;
}

.admin-row-info .cat-label-input {
  width: auto;
  max-width: 220px;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  vertical-align: middle;
  margin-right: 10px;
}

.admin-row-info .cat-id-label {
  color: var(--ink-soft);
  font-size: 13px;
}

.favicon-panel {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.favicon-panel #favicon-preview {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  object-fit: contain;
  flex-shrink: 0;
}

.favicon-panel-controls {
  flex: 1;
  min-width: 240px;
}

.favicon-panel-controls input[type="file"] {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

/* ---------- Website management page ---------- */

.settings-section {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.settings-section h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 6px;
}

.settings-hint {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 18px;
}

.settings-field {
  margin-bottom: 20px;
}

.settings-field:last-child {
  margin-bottom: 0;
}

.settings-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.settings-field input[type="text"],
.settings-field textarea {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--panel);
  margin-bottom: 10px;
}

.settings-field textarea {
  min-height: 70px;
  resize: vertical;
  display: block;
}

.settings-field input[type="file"] {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.settings-field-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-field-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
}

.settings-image-preview {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  margin-bottom: 10px;
  display: block;
}

.settings-status {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 8px 0 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 2px solid var(--ink);
  padding: 28px 0;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .site-nav { gap: 14px; }
  .site-header .wrap { flex-wrap: wrap; }
  .search-row { flex-direction: column; gap: 8px; margin-bottom: 14px; }
  .search-row select,
  .search-row input[type="text"],
  .search-row button {
    width: 100%;
    /* .search-row input[type="text"] sets flex: 1 1 260px for the desktop
       row layout, where 260px is a minimum WIDTH. Once this rule switches
       the row to flex-direction: column, that same flex-basis applies to
       the column's main axis instead - i.e. it becomes a 260px HEIGHT,
       ballooning the input. Resetting the basis to auto here keeps each
       field sized by its own content on narrow screens. */
    flex: 0 1 auto;
  }
  /* Trim the desktop padding down on mobile so the stacked search fields
     don't dominate the screen. Keep font-size at 16px on the text input -
     anything smaller triggers iOS Safari's auto-zoom-on-focus. */
  .search-row input[type="text"] { padding: 10px 12px; }
  .search-row select { padding: 10px 10px; font-size: 14px; }
  .search-row button { padding: 10px 16px; font-size: 14px; }

  .item-grid,
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .item-card h4 {
    font-size: 14px;
    line-height: 1.3;
    margin: 10px 10px 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .item-shop-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .item-price { font-size: 13px; margin: 0 10px 14px; }
  .item-desc,
  .item-shop-line { font-size: 12px; margin: 0 10px 10px; }
  .shop-card-body { padding: 12px 14px 14px; gap: 6px; }
  .card-banner,
  .card-banner-fallback { height: 96px; }
  .card-banner-fallback { font-size: 22px; }
  .shop-card h3 { font-size: 15px; }
  .category-tag { font-size: 11px; padding: 2px 8px; }
  .shop-card .location { font-size: 12px; margin-top: -4px; }
  .shop-card p.desc {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

}

/* ---------- Mobile bottom navigation ---------- */
/* A fixed tab bar replaces the top .site-nav on narrow screens, so the
   main navigation stays reachable with a thumb while scrolling instead of
   living up at the top of the page. Hidden entirely above the 640px
   breakpoint, where the header nav is already easy to reach. */

.mobile-tabbar { display: none; }

@media (max-width: 640px) {
  .site-header .site-nav { display: none; }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--panel);
    border-top: 2px solid var(--ink);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .tabbar-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 6px;
    text-decoration: none;
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }

  .tabbar-icon {
    font-size: 20px;
    line-height: 1;
  }

  .tabbar-item.active {
    color: var(--teal);
  }

  /* Keeps footer content clear of the fixed tab bar. */
  body { padding-bottom: 64px; }
}

/* Accessibility: visible focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* Account type picker (login.html signup) */
.account-type-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

.account-type-option input {
  width: auto;
  margin: 0;
}

.account-type-option:has(input:checked) {
  border-color: var(--teal);
  background: #E7F2EE;
}

/* ---------- Account panel (dashboard / customer-dashboard / admin) ---------- */
/* A clean, structured "who you are + what you can do" card shown at the
   top of every logged-in account page. It lives in the page's own
   content rather than the header, so its Log Out row stays reachable
   even on mobile, where the top .site-nav (and the header's own
   auto-inserted "Log out" link) are hidden behind the bottom tab bar. */

.account-panel {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  margin-bottom: 32px;
}

.account-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.account-info { min-width: 0; }

.account-name {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 4px;
  word-break: break-word;
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.account-role-badge {
  display: inline-block;
  border: 1.5px solid var(--teal);
  color: var(--teal-dark);
  background: #E7F2EE;
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.account-note {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 14px 0 0;
}

.account-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
}

.account-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.account-option:hover { border-color: var(--ink); }

.account-option-icon {
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.account-option-arrow {
  margin-left: auto;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.account-option-danger {
  border-color: var(--brick);
  color: var(--brick);
}

.account-option-danger:hover { background: var(--brick); color: #fff; }

.account-option-danger:disabled {
  opacity: 0.6;
  cursor: default;
}

.account-option-danger:disabled:hover {
  background: var(--paper);
  color: var(--brick);
}

@media (max-width: 640px) {
  .account-panel { padding: 16px; margin-bottom: 24px; }
  .account-avatar { width: 44px; height: 44px; font-size: 16px; }
  .account-name { font-size: 17px; }
}


/* ---------- Verified supplier badge ---------- */
/* Shown on a shop card (suppliers.html) and the shop detail page when an
   admin has confirmed the shop is real - see admin.html's "Verified
   supplier" checkbox. Kept visually consistent with .account-role-badge. */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-dark);
  background: #E7F2EE;
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}


/* ---------- Category hub (categories.html) ---------- */
/* A dedicated "browse by category" page: a tile per trade line with a
   live supplier count, plus a "Popular in X" rail of real shop cards
   underneath for every category that already has approved shops. Built
   from the same bordered-card/hard-shadow language as .shop-card and
   .account-option elsewhere on the site. */

.category-hub-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.category-hub-stat {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.category-hub-stat strong {
  color: var(--ink);
  font-family: var(--font-display);
}

.category-hub-section { padding: 40px 0 8px; }

/* Category panel — white rounded card, red top accent, two-column icon list
   (reference style: used on categories.html AND the site-wide nav dropdown) */
.category-panel {
  background: var(--panel);
  border-radius: 10px;
  border-top: 4px solid var(--brick);
  box-shadow: 0 12px 32px rgba(27, 27, 27, 0.10);
  padding: 20px 10px;
}

.category-tile-grid {
  /* container id/class kept for JS compatibility; now hosts the icon-list panel */
  margin-top: 8px;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 20px;
}

.category-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-list-item:hover,
.category-list-item:focus-visible {
  background: var(--paper);
  color: var(--brick);
}

.category-list-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-soft);
}

.category-list-item:hover .category-list-icon,
.category-list-item:focus-visible .category-list-icon {
  color: var(--brick);
}

.category-list-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-list-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.category-list-item.category-tile-empty .category-list-count { color: var(--brick); }

/* Categories page (browse-all tile grid): stack supplier count below the name for every category, consistently */
#category-tile-grid .category-list { gap: 10px 20px; }
#category-tile-grid .category-list-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  column-gap: 10px;
  row-gap: 3px;
  padding: 12px 14px;
}
#category-tile-grid .category-list-icon { grid-row: 1 / span 2; }
#category-tile-grid .category-list-label { grid-column: 2; grid-row: 1; }
#category-tile-grid .category-list-count { grid-column: 2; grid-row: 2; margin-left: 0; }

@media (max-width: 640px) {
  .category-list { grid-template-columns: 1fr; }
}

/* Site-wide Categories nav dropdown (same visual style as the panel above) */
.categories-nav { position: relative; }

.categories-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  padding: 0 0 2px;
}

.categories-nav-trigger:hover,
.categories-nav.open .categories-nav-trigger,
.categories-nav-trigger.active {
  color: var(--ink);
  border-bottom-color: var(--marigold);
}

.categories-nav-trigger .caret {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.categories-nav.open .categories-nav-trigger .caret {
  transform: rotate(180deg);
}

.categories-dropdown-all {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding: 10px 14px 4px;
}

.categories-dropdown-all a {
  font-size: 13px;
  font-weight: 600;
  color: var(--brick);
  text-decoration: none;
}

.categories-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  max-width: min(90vw, 560px);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 500;
  display: none;
}

.categories-nav.open .categories-dropdown { display: block; }

@media (max-width: 640px) {
  .categories-dropdown {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 64px;
    width: auto;
    max-width: none;
    transform: none;
  }
}

.category-rail-section { margin-top: 40px; }

.category-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.category-rail-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
}

.category-rail-head a {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
}

.category-rail-head a:hover { color: var(--teal-dark); }

.category-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.category-rail::-webkit-scrollbar { display: none; }

.category-rail .rail-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  .category-hub-section { padding-top: 24px; }
  .category-tile-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-tile { padding: 12px; gap: 10px; }
  .category-tile-icon { width: 42px; height: 42px; font-size: 19px; }
  .category-tile-name { font-size: 14px; }
  .category-tile-count { font-size: 11px; }
  .category-tile-arrow { display: none; }
  .category-rail .rail-card { flex-basis: 200px; }
  .category-rail-head h2 { font-size: 17px; }
}


/* ---------- Mobile header "Sell" button ---------- */
/* On mobile, the bottom tab bar's 4 slots are Suppliers / Products /
   Categories / Account - "List your shop" moves up into the header
   instead, as a small round icon button in the top-right corner, so
   listing a shop stays one tap away without crowding the tab bar.
   Hidden on desktop, where "List your shop" already lives in the top
   nav. Reuses the #tabbar-submit id the bottom tab used to have, so
   auth.js's existing "logged-in users don't need this link" logic
   (which hides it by id) keeps working with no changes there. */
.mobile-sell-btn { display: none; }

@media (max-width: 640px) {
  .mobile-sell-btn {
       display: none;
       align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--ink);
    background: var(--teal);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
  }
  .mobile-sell-btn:hover { background: var(--teal-dark); }
}


/* ---- Homepage hero redesign (Alibaba-inspired) ---- */
.hero-search-section{padding:40px 0 24px;background:var(--paper);}
.hero-search-section h1{margin:0 0 8px;}
.hero-search-section .lede{margin:0 0 24px;max-width:620px;}
.hero-search-form{margin-bottom:16px;}
.hero-search-bar{position:relative;display:flex;align-items:center;gap:8px;background:var(--panel);border-radius:999px;box-shadow:0 12px 32px rgba(27,27,27,0.10);padding:6px 6px 6px 22px;max-width:760px;}
.hero-search-icon{color:var(--ink-soft);font-size:18px;flex:none;}
.hero-search-bar input{flex:1;border:none;background:transparent;font-size:15px;padding:12px 4px;outline:none;color:var(--ink);position:relative;z-index:1;min-width:0;}
.hero-search-ghost{position:absolute;left:52px;top:50%;transform:translateY(-50%);color:var(--ink-soft);font-size:15px;pointer-events:none;transition:opacity .3s ease;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px;}
.hero-search-bar.has-value .hero-search-ghost,.hero-search-bar:focus-within .hero-search-ghost{opacity:0;}
.hero-search-location{border:none;border-left:1px solid var(--line);background:transparent;font-size:14px;padding:10px 12px;color:var(--ink-soft);flex:none;max-width:140px;}
.hero-search-btn{border-radius:999px;padding:10px 26px;flex:none;}
@media (max-width:640px){.hero-search-location{display:none;}.hero-search-bar{padding-left:16px;}.hero-search-ghost{left:40px;max-width:150px;}}

.hero-popular{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--ink-soft);}
.hero-popular-label{font-weight:600;color:var(--ink);}
.hero-popular-tags-wrap{display:contents;}
.hero-popular-tag{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:5px 14px;color:var(--ink-soft);text-decoration:none;background:var(--panel);transition:border-color .15s ease, color .15s ease;}
.hero-popular-tag:hover{border-color:var(--brick);color:var(--brick);}

.hero-columns{padding:0 0 32px;background:var(--paper);}
.hero-columns-grid{display:grid;grid-template-columns:220px 1fr 220px;gap:20px;align-items:stretch;}
.hero-sidebar{background:var(--panel);border-radius:var(--radius);box-shadow:0 12px 32px rgba(27,27,27,0.08);padding:18px 0;display:flex;flex-direction:column;}
.hero-sidebar-head{display:flex;align-items:center;gap:8px;font-weight:700;font-size:16px;padding:0 20px 14px;border-bottom:1px solid var(--line);margin-bottom:6px;}
.hero-sidebar-list{display:flex;flex-direction:column;max-height:320px;overflow-y:auto;}
.hero-sidebar-list a{display:flex;align-items:center;gap:10px;padding:9px 20px;color:var(--ink-soft);text-decoration:none;font-size:14px;}
.hero-sidebar-list a i{color:var(--ink-soft);font-size:15px;width:18px;text-align:center;}
.hero-sidebar-list a:hover{background:var(--paper);color:var(--ink);}
.hero-sidebar-more{margin-top:auto;font-size:13px;font-weight:600;color:var(--brick);text-decoration:none;border-top:1px solid var(--line);padding:12px 20px 0;display:flex;align-items:center;gap:4px;}
.hero-carousel-panel{background:var(--panel);border-radius:var(--radius);box-shadow:0 12px 32px rgba(27,27,27,0.08);overflow:hidden;min-height:360px;display:flex;}
.hero-carousel-panel .slideshow{width:100%;}
@media (max-width:900px){
.hero-carousel-panel{min-height:0;}
.hero-columns-grid{grid-template-columns:1fr;}
.hero-sidebar{display:none;}
.hero-sidebar-locations{
  display:flex;
  min-width:0;
  background:none;
  box-shadow:none;
  border-radius:0;
  padding:0;
}
.hero-sidebar-locations .hero-sidebar-head{
  padding:0 0 8px;
  border-bottom:none;
  margin-bottom:0;
  font-size:15px;
}
.hero-sidebar-locations .hero-sidebar-list{
  flex-direction:row;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:visible;
  max-height:none;
  min-width:0;
  gap:8px;
  padding:2px 2px 4px;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.hero-sidebar-locations .hero-sidebar-list::-webkit-scrollbar{display:none;}
.hero-sidebar-locations .hero-sidebar-list a{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel);
  color:var(--ink-soft);
  font-size:13px;
  white-space:nowrap;
  text-decoration:none;
}
.hero-sidebar-locations .hero-sidebar-list a:hover{border-color:var(--brick);color:var(--brick);}
.hero-sidebar-locations .hero-sidebar-more{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  gap:5px;
  margin-top:10px;
  padding:8px 18px;
  background:var(--teal);
  color:#fff;
  border:none;
  border-radius:999px;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  box-sizing:border-box;
}
.hero-sidebar-locations .hero-sidebar-more:hover,
.hero-sidebar-locations .hero-sidebar-more:active{background:var(--teal-dark);}
}

.trust-strip{padding:0 0 48px;background:var(--paper);}
.trust-strip-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}
.trust-badge{background:var(--panel);border-radius:var(--radius);padding:20px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 8px 20px rgba(27,27,27,0.06);}
.trust-badge-text{display:flex;flex-direction:column;gap:4px;}
.trust-badge-text strong{font-size:15px;color:var(--ink);}
.trust-badge-text span{font-size:12.5px;color:var(--ink-soft);}
.trust-badge-icon{font-size:28px;color:var(--teal);flex:none;}
@media (max-width:900px){.trust-strip-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:480px){.trust-strip-grid{grid-template-columns:1fr;}}


/* ---- Unified site search bar: image search icon ---- */
.hero-image-search-btn{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;background:var(--paper);color:var(--ink-soft);flex:none;font-size:16px;text-decoration:none;transition:background .15s ease,color .15s ease;}
.hero-image-search-btn:hover{background:var(--teal);color:#fff;}
@media (max-width:640px){.hero-image-search-btn{width:32px;height:32px;font-size:14px;}}

/* Search results page */
.search-hero{padding:32px 0 8px;background:var(--paper);}
.search-hero h1{margin:0 0 18px;}

/* ---- Unified search results page: separate Suppliers/Products sections ---- */
.search-results-section{margin-top:8px;}
.search-results-section + .search-results-section{margin-top:32px;padding-top:24px;border-top:1px solid var(--line);}
.search-results-subhead{margin:0 0 16px;font-size:18px;}


/* ---- Header-embedded search bar (v2): the search bar now lives in the
   top header row, directly after the logo, on both desktop and mobile,
   instead of a separate hero section below the header. ---- */
.site-header .wrap{justify-content:flex-start;}
.site-nav{margin-left:auto;}
.mobile-sell-btn{flex-shrink:0;}

.hero-search-form{flex:1 1 auto;min-width:0;max-width:520px;margin:0;}
.hero-search-bar{max-width:none;width:100%;padding:4px 4px 4px 14px;border:2px solid var(--ink);box-shadow:none;background:var(--panel);}
.hero-search-icon{display:none;}
.hero-search-bar input{font-size:14px;padding:9px 4px;}
.hero-search-ghost{left:20px;right:92px;font-size:14px;max-width:none;}
.hero-image-search-btn{width:34px;height:34px;font-size:15px;}
.hero-search-btn{border-radius:50%;width:36px;height:36px;padding:0;display:flex;align-items:center;justify-content:center;font-size:15px;flex:none;}

@media (max-width:640px){
  .site-header .wrap{flex-wrap:nowrap;gap:10px;}
  .hero-search-form{max-width:none;}
  .hero-search-ghost{left:16px;right:92px;max-width:none;}
}

@media (max-width:480px){
  .wordmark{font-size:20px;gap:8px;}
  .site-logo-img{height:24px;}
  .hero-image-search-btn{width:28px;height:28px;font-size:12px;}
  .hero-search-ghost{left:14px;right:82px;font-size:12px;max-width:none;}
  .hero-search-btn{width:32px;height:32px;font-size:13px;}
}

.hero-search-section{padding:28px 0 20px;}

/* ---------- Homepage: How Connect Works (auto-advancing step timeline) ---------- */

.connect-steps-section {
  padding: 48px 0 84px;
  border-top: 1px solid var(--line);
}

.connect-steps-head { margin-bottom: 28px; max-width: 640px; }

.connect-steps-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brick);
  margin: 0 0 6px;
}

.connect-steps-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 8px;
}

.connect-steps-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

.connect-step-row {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 26px;
}
.connect-step-row:last-child { padding-bottom: 0; }

.connect-step-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}
.connect-step-rail::before {
  content: "";
  position: absolute;
  top: 48px;
  bottom: -26px;
  width: 2px;
  background: var(--line);
}
.connect-step-row:last-child .connect-step-rail::before { display: none; }

.connect-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s ease;
  cursor: pointer;
}
.connect-step-icon svg { width: 22px; height: 22px; }

.connect-step-row.active .connect-step-icon {
  background: var(--ink);
  color: var(--paper);
  transform: scale(1.06);
}

.connect-step-body { flex: 1 1 auto; min-width: 0; padding-top: 4px; }

.connect-step-title-row { cursor: pointer; }

.connect-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}
.connect-step-row.active .connect-step-title { color: var(--ink); }

.connect-step-tagline {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.connect-step-progress-track {
  width: 100%;
  max-width: 140px;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
  display: none;
}
.connect-step-row.active .connect-step-progress-track { display: block; }

.connect-step-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brick);
  border-radius: 2px;
}
.connect-step-progress-fill.run { animation: connectFillProgress 10s linear forwards; }

@keyframes connectFillProgress {
  from { width: 0%; }
  to { width: 100%; }
}

.connect-step-card {
  margin-top: 14px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 18px;
  max-width: 420px;
  display: none;
}
.connect-step-row.active .connect-step-card {
  display: block;
  animation: connectCardIn 0.35s ease;
}
@keyframes connectCardIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.connect-step-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.connect-step-card p:last-child { margin-bottom: 0; }

.connect-step-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.connect-step-cta:hover { color: var(--teal-dark); }
.connect-step-cta svg { width: 14px; height: 14px; }

.connect-step-cta-final {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brick);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}
.connect-step-cta-final:hover { background: #8a3220; }
.connect-step-cta-final svg { width: 13px; height: 13px; flex-shrink: 0; }

@media (max-width: 480px) {
  .connect-steps-section { padding: 40px 0 64px; }
  .connect-steps-title { font-size: 21px; }
  .connect-step-icon { width: 42px; height: 42px; }
  .connect-step-icon svg { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .connect-step-progress-fill.run { animation: none; width: 100%; }
}

/* ---------- Hero: inline "See how Connect works" link ---------- */

.hero-connect-inline-link {
  display: inline-block;
  margin-left: 2px;
  color: var(--brick);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.hero-connect-inline-link:hover { text-decoration: underline; }

/* ---------- "Can't find it" empty-state, branded for Connect ---------- */

.empty-state-connect {
  border-style: solid;
  border-color: var(--brick);
  background: rgba(166, 61, 40, 0.04);
}

.connect-empty-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brick);
  margin: 0 0 8px;
}

.connect-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
}

.connect-empty-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.connect-empty-link:hover { color: var(--teal-dark); text-decoration: underline; }

@media (max-width: 480px) {
  .hero-connect-inline-link { display: block; margin: 8px 0 0; }
}


/* ---------- Supplier shop header (v50): card-style header, desktop overlap ---------- */

.shop-hero-info {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px 32px 32px;
  position: relative;
}

.shop-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.shop-hero-info h1 {
  margin: 0 0 10px;
  line-height: 1.15;
}

.shop-hero-info .location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 15px;
}

.shop-hero-info .location .bi {
  color: var(--brick);
  font-size: 14px;
}

.shop-hero-info .desc {
  line-height: 1.65;
  margin: 0 0 24px;
}

.shop-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.shop-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 641px) {
  .shop-hero-banner {
    height: 240px;
  }

  .shop-hero-info {
    margin-top: -56px;
    max-width: 760px;
  }
}

@media (max-width: 640px) {
  .shop-hero-info {
    padding: 22px 20px 26px;
  }
}


/* ---------- Kariakoo Guide (guide.html) ---------- */

.guide-section { padding: 48px 0; border-top: 1px solid var(--line); }
.hero + .guide-section { border-top: none; padding-top: 40px; }

.guide-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brick);
  margin: 0 0 6px;
  display: block;
}

.guide-section-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 14px;
  max-width: 30ch;
}

.guide-section-sub {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}

.guide-intro-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 24px;
}

.guide-intro-grid p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
}

.guide-intro-grid p:last-child { margin-bottom: 0; }

.guide-stats-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  display: grid;
  gap: 18px;
  align-self: start;
}

.guide-stat { display: flex; flex-direction: column; }

.guide-stat-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

.guide-stat-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.guide-step-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}

.guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.guide-step-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 8px;
}

.guide-step-card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}

.guide-step-card p a { color: var(--brick); font-weight: 600; }

.guide-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.guide-tip-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.guide-tip-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--brick);
}

.guide-tip-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 4px;
}

.guide-tip-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.guide-cta-banner {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  border-top: 4px solid var(--brick);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.guide-cta-banner h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 6px;
}

.guide-cta-banner p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 46ch;
}

.guide-cta-banner .btn { flex-shrink: 0; }

.guide-intro-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-stats-cta {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  border-top: 4px solid var(--brick);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-stats-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(166, 61, 40, 0.1);
  color: var(--brick);
  font-size: 17px;
}

.guide-stats-cta h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0;
}

.guide-stats-cta p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.guide-stats-cta-btn { align-self: flex-start; }

@media (max-width: 640px) {
  .guide-stats-cta-btn { align-self: stretch; text-align: center; }
}

@media (max-width: 800px) {
  .guide-intro-grid { grid-template-columns: 1fr; }
  .guide-steps-grid { grid-template-columns: 1fr; }
  .guide-tips-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .guide-section { padding: 36px 0; }
  .hero + .guide-section { padding-top: 32px; }
  .guide-cta-banner { padding: 22px; }
}


/* ---------- Kariakoo Guide: interactive street map ---------- */

.guide-map {
  height: 420px;
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-top: 24px;
}

.guide-map.guide-map-ready { opacity: 1; transform: scale(1); }

.guide-map img { max-width: none; }

.guide-map-fallback {
  margin: 0;
  padding: 20px;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.guide-map-fallback a { color: var(--brick); font-weight: 600; }

.guide-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.guide-map-legend span { display: inline-flex; align-items: center; gap: 8px; }

.guide-map-legend-swatch {
  display: inline-block;
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: #9C9686;
  opacity: 0.7;
}

.guide-map-legend-swatch.guide-map-legend-active { background: var(--teal); opacity: 0.9; }

.guide-map-caption {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 0;
}

.guide-map-caption a { color: var(--brick); font-weight: 600; }

@keyframes guideStreetPulse {
  0%, 100% { stroke-opacity: 0.9; }
  50% { stroke-opacity: 0.4; }
}

.leaflet-pane .guide-street-line-active {
  animation: guideStreetPulse 2.4s ease-in-out infinite;
  cursor: pointer;
}

.leaflet-pane .guide-street-line {
  cursor: pointer;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  box-shadow: none;
}

.leaflet-popup-content {
  font-family: var(--font-body);
  font-size: 13.5px;
  margin: 12px 14px;
}

.leaflet-popup-content strong { font-family: var(--font-display); font-size: 14.5px; }

.leaflet-popup-content a { color: var(--brick); font-weight: 600; }

.leaflet-popup-tip { border: 2px solid var(--ink); box-shadow: none; }

@media (max-width: 640px) {
  .guide-map { height: 320px; }
}


/* ---------- Kariakoo Guide map v2: pins, fullscreen, in-map legend ---------- */

.guide-map-pin svg { filter: drop-shadow(0 2px 3px rgba(27,27,27,0.35)); }

.guide-map-pin { cursor: pointer; }

.guide-map-legend-ctrl {
  background: rgba(255,255,255,0.94);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.3;
  font-family: var(--font-body);
  box-shadow: none;
  margin: 0 0 8px 8px;
}

.guide-map-legend-ctrl span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.guide-map-fullscreen-btn {
  width: 34px;
  height: 34px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  box-shadow: none;
  padding: 0;
  margin: 8px 8px 0 0;
}

.guide-map-fullscreen-btn:hover { background: var(--paper); }

.guide-map.guide-map-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999;
  border-radius: 0;
  margin: 0 !important;
  transform: none;
}

html.guide-map-fullscreen-lock,
html.guide-map-fullscreen-lock body {
  overflow: hidden;
  height: 100%;
}

.leaflet-control-zoom a {
  width: 30px;
  height: 30px;
  line-height: 30px;
}

@media (max-width: 640px) {
  .guide-map-fullscreen-btn { width: 40px; height: 40px; font-size: 17px; }
  .leaflet-control-zoom a { width: 38px; height: 38px; line-height: 38px; font-size: 19px; }
  .guide-map-legend-ctrl { font-size: 11.5px; padding: 7px 9px; }
}



/* ---------- Kariakoo Guide map: visible full-screen link (in addition to the corner icon control) ---------- */

.guide-map-fullscreen-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 14px auto 0;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  background: var(--panel);
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  cursor: pointer;
}

.guide-map-fullscreen-link:hover { background: var(--teal); color: #fff; }

@media (max-width: 640px) {
  .guide-map-fullscreen-link {
    width: 100%;
    margin-top: 12px;
    padding: 13px 18px;
    font-size: 15px;
  }
}
