/* Florida Farm Finder — mobile-first styles.
   Palette is deliberately narrow: white surfaces, a whisper of green in the
   background, one deep forest green doing all the emphasis work. */

:root {
  --bg: #c5d3bc;            /* sage-200 — the site's page ground */
  --surface: #ffffff;
  --surface-2: #f6f3ee;     /* earth-50 */
  --text: #271e16;          /* earth-900 */
  --muted: #6e5b41;         /* earth-600 */
  --line: #ece5d8;          /* earth-100 */
  --line-soft: #f6f3ee;     /* earth-50 */
  --brand: #3d3023;         /* earth-800 — matches .btn-primary */
  --brand-2: #564531;       /* earth-700 */
  --brand-ink: #fdfaf4;     /* cream-50 */
  --brand-soft: #ece5d8;    /* earth-100 */
  --header: #fdfaf4;        /* cream-50 — the site header */
  --price: #8b7355;         /* earth-500 */
  --price-soft: #f9f2e3;    /* cream-100 */
  --warn: #6e5b41;
  --warn-soft: #f9f2e3;
  --alert: #8a3324;
  --alert-soft: #f7e9e4;
  --shadow: 0 1px 2px rgba(39, 30, 22, .05), 0 6px 20px rgba(39, 30, 22, .07);
  --shadow-lift: 0 2px 6px rgba(39, 30, 22, .07), 0 16px 40px rgba(39, 30, 22, .14);
  --radius: 4px;            /* the site uses square-ish edges, not pills */
  --tap: 46px;
  --header-h: 0px;
  --serif: Georgia, Cambria, "Times New Roman", serif;
}

/* Ala Natural ships one light theme; no dark variant here on purpose. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-underline-offset: 2px; }

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

/* The store's own top bar, restated here so the page does not feel bolted on. */
.sitebar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 2px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .01em;
  white-space: nowrap;
}

.sitenav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.sitenav::-webkit-scrollbar { display: none; }

.sitenav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .01em;
}

.sitenav a:hover { color: var(--text); }
.sitenav a[aria-current="page"] { color: var(--text); font-weight: 600; }

@media (max-width: 430px) {
  .sitebar { gap: 10px; padding-inline: 14px; }
  .wordmark { font-size: 17px; }
  .sitenav { gap: 12px; }
  .sitenav a { font-size: 12px; }
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  padding: max(8px, env(safe-area-inset-top)) 0 0;
}

.brandrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 18px 10px;
}

.brandmark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.brandrow h1 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0;
}

.count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.searchrow {
  padding: 0 18px 11px;
  display: flex;
  gap: 8px;
}

.searchwrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.searchwrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

#q {
  width: 100%;
  height: var(--tap);
  padding: 0 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
  outline: none;
  appearance: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

#q::placeholder { color: var(--muted); }

#q:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.clearq {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  display: none;
}

.searchwrap.has-value .clearq { display: block; }

/* ---------- Category chips ---------- */

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 18px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .14s, border-color .14s, color .14s;
}

.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

/* ---------- Location bar ---------- */

.locbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--brand-soft);
  font-size: 13.5px;
}

.locbar.hidden { display: none; }
.locbar .loctext { flex: 1; min-width: 0; color: var(--text); }
.locbar .loctext b { font-weight: 600; }

.locbtn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 2px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.locbtn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

/* ---------- Where-are-you form ---------- */

.wherewrap {
  display: none;
  gap: 8px;
  padding: 11px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.wherewrap.open { display: flex; }

#where {
  flex: 1;
  min-width: 0;
  height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
  outline: none;
}

#where:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.gobtn {
  height: var(--tap);
  padding: 0 20px;
  border: 0;
  border-radius: 2px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

/* ---------- Main ---------- */

main { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

.view { display: none; }
.view.active { display: block; }

/* ---------- List ---------- */

#list { padding: 14px 18px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  margin-bottom: 11px;
  box-shadow: var(--shadow);
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  transition: box-shadow .16s, transform .1s;
}

.card:active { transform: scale(.994); }

.card .top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.card h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.015em;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.dist {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: .01em;
}

.meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* Price tags the user has recorded themselves. */
.sharetag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(31, 81, 50, .18);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
}

@media (prefers-color-scheme: dark) {
  .sharetag { border-color: rgba(134, 201, 154, .25); }
}

.pricetag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--price-soft);
  color: var(--price);
  border: 1px solid rgba(122, 92, 20, .16);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

@media (prefers-color-scheme: dark) {
  .sharetag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(31, 81, 50, .18);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
}

@media (prefers-color-scheme: dark) {
  .sharetag { border-color: rgba(134, 201, 154, .25); }
}

.pricetag { border-color: rgba(217, 189, 118, .22); }
}

.snippet {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rowacts {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.act {
  flex: 1;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.act.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* ---------- Empty / loading ---------- */

.empty {
  text-align: center;
  padding: 60px 26px;
  color: var(--muted);
}

.empty .big { font-size: 32px; margin-bottom: 12px; opacity: .8; }
.empty h3 { font-family: var(--serif); color: var(--text); font-size: 19px; font-weight: 600; margin: 0 0 7px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

.morebtn {
  display: block;
  width: 100%;
  height: var(--tap);
  margin: 4px 0 20px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  color: var(--brand);
}

.pricebackup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 22px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.pricebackup > div { display: flex; gap: 7px; }

.pricebackup button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Map ---------- */

#mapwrap { position: relative; }

#map {
  width: 100%;
  height: calc(100dvh - var(--header-h) - 74px);
  background: var(--surface-2);
}

.leaflet-container { font: inherit; background: var(--surface-2); }

/* Basemap switch, floating over the map. */
.basemap {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  display: inline-flex;
  padding: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(22, 33, 26, .1);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(1.6) blur(8px);
}

.basemap button {
  border: 0;
  background: transparent;
  color: #3a4a3f;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 6px 14px;
  border-radius: 2px;
}

.basemap button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.mepin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, .35);
}

/* ---------- Bottom tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  flex: 1;
  height: 58px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tab[aria-selected="true"] { color: var(--brand); }

/* ---------- Detail sheet ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 26, 20, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: 4px 4px 0 0;
  box-shadow: var(--shadow-lift);
  transform: translateY(101%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.sheet.open { transform: translateY(0); }

.grabber {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 10px auto 4px;
}

.sheet-in { padding: 6px 20px 0; }

.sheet h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 8px 0 9px;
}

.sheet .meta { font-size: 13.5px; }

.actions {
  display: flex;
  gap: 9px;
  margin: 18px 0 8px;
}

.actions .act { height: var(--tap); }

.detail {
  border-top: 1px solid var(--line-soft);
  padding: 13px 0;
  display: flex;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.5;
}

.detail .k {
  flex: 0 0 78px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  padding-top: 3px;
}

.detail .v { flex: 1; min-width: 0; word-wrap: break-word; }
.detail .v a { word-break: break-all; }

/* ---------- Price notebook ---------- */

.prices { border-top: 1px solid var(--line-soft); padding: 14px 0 4px; }

.prices h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}

.pricelist { display: flex; flex-direction: column; gap: 7px; margin-bottom: 11px; }

.pricerow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 14px;
}

.pricerow .item { flex: 1; min-width: 0; }
.pricerow .amt { font-weight: 700; color: var(--price); font-variant-numeric: tabular-nums; }

.pricerow .del {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.priceform { display: flex; gap: 7px; }

.priceform input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  padding: 0 14px;
  outline: none;
  min-width: 0;
  font-size: 14px;
}

.priceform input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.priceform .pitem { flex: 1; }
.priceform .pamt { flex: 0 0 96px; }

.priceform button {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 2px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  font-size: 14px;
}

.pricehint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  margin: 10px 0 0;
}

.note {
  display: flex;
  gap: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 13px;
  margin: 16px 0 2px;
  line-height: 1.45;
}

.note.alert { background: var(--alert-soft); color: var(--alert); }
.note a { color: inherit; font-weight: 600; }

.okflag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 2px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.warnflag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--alert-soft);
  color: var(--alert);
  border-radius: 2px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.src {
  font-size: 11.5px;
  color: var(--muted);
  padding: 13px 0 4px;
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
  letter-spacing: .01em;
}

/* ---------- Misc ---------- */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 720px) {
  header, main { max-width: 700px; margin-inline: auto; }
  header { border-inline: 1px solid var(--line); }
  .sheet { max-width: 700px; margin-inline: auto; border-radius: 4px 4px 0 0; }
  .tabbar { max-width: 700px; margin-inline: auto; border-inline: 1px solid var(--line); }
}
