/* Bud Near — design tokens */
:root {
  --pine: #143d1e;
  --leaf: #2e7d32;
  --sprout: #66bb6a;
  --mist: #eef3ee;
  --paper: #ffffff;
  --ink: #182219;
  --ink-soft: #4a5a4c;
  --line: #dbe5db;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 61, 30, 0.10);
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
}
a { color: var(--leaf); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--sprout);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.site-header {
  background: var(--pine);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 2000;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .leaf-svg { width: 26px; height: 28px; display: inline-block; line-height: 0; }
.brand .leaf-svg svg { width: 100%; height: 100%; display: block; }
.brand em { font-style: normal; color: var(--sprout); }
.site-nav { display: flex; gap: 16px; margin-left: auto; align-items: center; }
.site-nav a { color: #d9e8da; font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: #fff; text-decoration: none; }

/* licensed chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #eaf5ea;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sprout); }

/* ---------- search ---------- */
.search-wrap { position: relative; flex: 1 1 auto; max-width: 440px; }
.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 99px;
  border: none;
  font: 500 14px var(--body);
  background: rgba(255,255,255,0.94);
  color: var(--ink);
}
.search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: 0.55; pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  max-height: 340px; overflow-y: auto; display: none; z-index: 3000;
}
.search-results.open { display: block; }
.search-results .sr-item {
  display: block; padding: 9px 14px; font-size: 14px; color: var(--ink);
  border-bottom: 1px solid var(--mist); cursor: pointer;
}
.search-results .sr-item:hover, .search-results .sr-item.active { background: var(--mist); text-decoration: none; }
.search-results .sr-item small { color: var(--ink-soft); display: block; font-size: 12px; }
.search-results .sr-head {
  padding: 7px 14px 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- map hero ---------- */
.map-hero { position: relative; height: calc(100vh - 58px); min-height: 420px; }
.map-hero #map { position: absolute; inset: 0; }
.map-note {
  position: absolute; bottom: 10px; right: 10px; z-index: 1000;
  background: rgba(20,61,30,0.92); color: #fff; padding: 5px 12px;
  border-radius: 7px; font-size: 13px; font-weight: 600; pointer-events: none;
  box-shadow: var(--shadow);
}
.nearme-btn {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--leaf); color: #fff; border: none; cursor: pointer;
  font: 600 15px var(--body); padding: 10px 20px; border-radius: 99px;
  box-shadow: 0 4px 14px rgba(20,61,30,0.35);
  transition: background 0.15s ease, transform 0.15s ease;
}
.nearme-btn:hover { background: var(--pine); transform: translateX(-50%) scale(1.03); }
.nearme-btn svg { width: 16px; height: 16px; }

/* ---------- homepage hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 58px;
}
.hero .shell { position: relative; z-index: 1; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px;
  gap: 56px; align-items: center;
}
.hero-leaf {
  position: absolute; right: -70px; top: -60px; width: 380px; height: 400px;
  opacity: 0.07; transform: rotate(18deg); pointer-events: none;
}
.hero-leaf svg { width: 100%; height: 100%; }
.hero h1 {
  font-family: var(--display); font-weight: 600; letter-spacing: -1.2px;
  font-size: clamp(34px, 5.4vw, 58px); line-height: 1.06; margin: 0 0 14px;
}
.hero h1 em { font-style: normal; color: var(--leaf); }
.hero .lede {
  font-size: clamp(15px, 2vw, 17px); color: var(--ink-soft);
  max-width: 560px; margin: 0 0 26px;
}
.hero-search { position: relative; max-width: 520px; margin: 0 0 18px; }
.hero-ctas { justify-content: flex-start; }
.hero-pop { font-size: 13.5px; color: var(--ink-soft); margin: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-pop span { font-weight: 650; color: var(--ink); }
.hero-pop a { font-weight: 550; }
.hero-side {
  display: grid; gap: 18px; align-content: center;
  border-left: 1px solid var(--line); padding-left: 40px;
}
.hero-side .stat b {
  display: block; font-family: var(--display); font-size: 30px; font-weight: 600;
  color: var(--pine); letter-spacing: -0.5px; line-height: 1.1;
}
.hero-side .stat span { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.hero-side .stat-zero b { color: var(--leaf); }
.hero-updated { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

/* feature trio */
.feature-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin: 6px 0 30px;
}
.feature {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px; background: #fff;
}
.feature .f-ico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--mist);
  color: var(--leaf); display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature .f-ico svg { width: 22px; height: 22px; }
.feature h3 { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.feature p { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.55; }
.hero-search input {
  width: 100%; padding: 16px 22px 16px 50px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff; font: 500 16px var(--body);
  color: var(--ink); box-shadow: 0 4px 18px rgba(20,61,30,0.09);
}
.hero-search .search-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; opacity: 0.5; pointer-events: none;
}
.hero-search .search-results { text-align: left; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0 0 34px; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 15px var(--body); padding: 12px 24px; border-radius: 99px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--leaf); color: #fff; border: none; }
.btn-primary:hover { background: var(--pine); text-decoration: none; }
.btn-primary svg { width: 16px; height: 16px; }
.btn-ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--sprout); }
.btn-ghost:hover { background: #fff; text-decoration: none; }
.hero-stats {
  display: flex; gap: 34px; justify-content: center; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 26px;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat b {
  display: block; font-family: var(--display); font-size: 28px; font-weight: 600;
  color: var(--pine); letter-spacing: -0.5px;
}
.hero-stats .stat span { font-size: 13px; color: var(--ink-soft); font-weight: 500; }

/* map section on homepage */
.map-section { position: relative; height: min(74vh, 680px); min-height: 420px; }
.map-section #map { position: absolute; inset: 0; }

/* nearest-stores panel */
.near-panel {
  position: absolute; top: 12px; right: 54px; z-index: 1100; width: 290px;
  background: #fff; border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  overflow: hidden; font-size: 14px;
}
.near-panel .np-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--pine); color: #fff; font-weight: 650; font-size: 13.5px;
  padding: 8px 12px;
}
.near-panel .np-close {
  background: none; border: none; color: #fff; font-size: 18px; cursor: pointer;
  line-height: 1; padding: 0 2px;
}
.near-panel .np-item {
  display: block; padding: 9px 12px; border-bottom: 1px solid var(--mist);
  color: var(--ink); cursor: pointer;
}
.near-panel .np-item:hover { background: var(--mist); text-decoration: none; }
.near-panel .np-item small { display: block; color: var(--ink-soft); font-size: 12px; }

/* on-map filter chips */
.map-chips {
  position: absolute; top: 12px; left: 12px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 90px);
}
.chip-group {
  display: inline-flex; gap: 4px; background: rgba(255,255,255,0.95);
  border-radius: 99px; padding: 4px; box-shadow: var(--shadow); width: fit-content;
  flex-wrap: wrap;
}
.mchip {
  border: none; background: transparent; cursor: pointer;
  font: 600 13px var(--body); color: var(--ink-soft);
  padding: 6px 13px; border-radius: 99px; transition: background 0.15s ease, color 0.15s ease;
}
.mchip:hover { color: var(--pine); }
.mchip.on { background: var(--leaf); color: #fff; }

/* directory bar */
.dir-bar { background: var(--mist); border-bottom: 1px solid var(--line); }
.dir-inner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 16px; padding-bottom: 16px;
}
.dir-inner label { font-weight: 650; font-size: 15px; white-space: nowrap; }
.dir-inner select {
  flex: 1 1 200px; max-width: 320px; padding: 9px 12px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font: 500 14px var(--body); color: var(--ink); cursor: pointer;
}
.dir-inner select:disabled { opacity: 0.5; cursor: default; }
.dir-go {
  border: none; background: var(--leaf); color: #fff; cursor: pointer;
  font: 600 14px var(--body); padding: 10px 22px; border-radius: 8px;
  transition: background 0.15s ease;
}
.dir-go:hover { background: var(--pine); }

/* embedded (region/city) maps */
.map-embed {
  height: 440px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); position: relative;
}
.map-embed #map { position: absolute; inset: 0; }

/* ---------- page shell ---------- */
.shell { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.section { padding: 46px 0 10px; }
.section h2 {
  font-family: var(--display); font-size: 30px; font-weight: 600;
  letter-spacing: -0.4px; margin: 0 0 6px;
}
.section .sub { color: var(--ink-soft); margin: 0 0 22px; max-width: 640px; }

/* eyebrow */
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--leaf); margin: 0 0 4px;
}

/* region / city card grids */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; margin: 0 0 26px;
}
.region-card {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; color: var(--ink); font-weight: 600; font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.region-card:hover { border-color: var(--sprout); background: #e6efe6; text-decoration: none; }
.region-card .count {
  font-family: var(--display); font-weight: 600; color: var(--leaf); font-size: 15px;
}

/* store list */
.store-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 0 0 26px; }
.store-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  background: #fff; box-shadow: 0 1px 4px rgba(20,61,30,0.05);
}
.store-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; line-height: 1.3; }
.store-card .addr { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 8px; }
.store-card .links { font-size: 13.5px; font-weight: 600; display: flex; gap: 14px; flex-wrap: wrap; }

/* breadcrumbs */
.crumbs { font-size: 13px; color: var(--ink-soft); padding: 16px 0 0; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--leaf); }
.crumbs span { margin: 0 6px; color: var(--line); }

/* page hero (region/city) */
.page-hero { padding: 10px 0 20px; }
.page-hero h1 {
  font-family: var(--display); font-size: clamp(28px, 4.5vw, 44px); font-weight: 600;
  letter-spacing: -0.6px; margin: 0 0 6px; line-height: 1.12;
}
.page-hero .meta { color: var(--ink-soft); font-size: 15px; margin: 0; }
.page-hero .meta strong { color: var(--leaf); font-weight: 700; }

/* sourcing table */
.source-list { list-style: none; margin: 0 0 26px; padding: 0; border-top: 1px solid var(--line); }
.source-list li {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.source-list .reg { color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 50px; background: var(--pine); color: #cfe0d0;
  padding: 34px 0 40px; font-size: 13.5px;
}
.site-footer .shell { display: grid; gap: 8px; }
.site-footer a { color: #fff; }
.site-footer .foot-brand { font-family: var(--display); font-weight: 700; font-size: 18px; color: #fff; margin-bottom: 6px; }
.site-footer .legal { opacity: 0.8; max-width: 760px; }
.site-footer .copyright { opacity: 0.65; font-size: 12.5px; margin-top: 4px; }

/* leaflet popup reuse from original map */
.fn-popup { font-size: 14px; line-height: 1.35; max-width: 320px; font-family: var(--body); }
.fn-popup h3 {
  font-size: 15px; margin: 0; font-weight: 700; color: #fff;
  background: var(--leaf); padding: 5px 12px;
}
.fn-popup .field { margin: 6px 10px; }
.fn-popup .field strong { display: inline-block; width: 78px; font-weight: 600; color: #333; vertical-align: top; }
.fn-popup a.profile-link { display: inline-block; margin: 4px 10px 8px; color: var(--leaf); font-weight: 600; }
.leaflet-popup-content-wrapper { border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.leaflet-popup-content { margin: 0; }
.leaflet-container a.leaflet-popup-close-button { color: #fff; }

.leaf-marker {
  width: 30px; height: 32px; cursor: pointer; user-select: none;
  transform-origin: 50% 90%; transition: transform 0.15s ease;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
}
.leaf-marker svg { width: 100%; height: 100%; display: block; }
.leaf-marker:hover { transform: scale(1.3); }
.custom-cluster {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(46,125,50,0.92); color: #fff; font-weight: 700;
  box-shadow: 0 0 10px rgba(0,0,0,0.25); cursor: pointer; transition: transform 0.2s ease;
  font-size: 13px;
}
.custom-cluster:hover { transform: scale(1.12); background: rgba(46,125,50,1); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 860px) {
  .hero { padding: 44px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-side {
    border-left: none; border-top: 1px solid var(--line); padding: 22px 0 0;
    grid-template-columns: repeat(4, auto); justify-content: space-between;
  }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .search-wrap { max-width: none; }
  .map-hero { height: calc(100dvh - 58px); }
  .brand span.brand-text { font-size: 19px; }
  .hero-side { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
