/* shopyour_local — warm, editorial, community-first */

:root {
  --clay: oklch(55% 0.14 40);
  --clay-deep: oklch(45% 0.13 38);
  --clay-soft: oklch(90% 0.04 45);
  --ink: oklch(22% 0.01 60);
  --ink-2: oklch(38% 0.01 60);
  --ink-3: oklch(55% 0.008 60);
  --paper: oklch(97% 0.012 80);
  --paper-2: oklch(94% 0.016 80);
  --paper-3: oklch(99% 0.005 80);
  --sage: oklch(62% 0.08 155);
  --sage-soft: oklch(92% 0.03 155);
  --line: oklch(88% 0.01 70);
  --line-2: oklch(82% 0.012 70);
  --warn: oklch(70% 0.14 70);
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.04), 0 8px 24px rgba(60, 40, 20, 0.06);
  --shadow-lg: 0 2px 4px rgba(60, 40, 20, 0.06), 0 24px 60px rgba(60, 40, 20, 0.12);
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

.serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mono {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }

/* Utility */
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px;
  font-weight: 500; font-size: 15px;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--clay); color: var(--paper); }
.btn-primary:hover { background: var(--clay-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: oklch(30% 0.01 60); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 17px; }

/* Inputs */
.input, .select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  background: var(--paper-3);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 4px oklch(55% 0.14 40 / 0.12);
}

/* Cards */
.card {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12.5px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: var(--paper-3);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.badge-sage { background: var(--sage-soft); border-color: transparent; color: oklch(35% 0.08 155); }
.badge-clay { background: var(--clay-soft); border-color: transparent; color: var(--clay-deep); }
.badge-ink  { background: var(--ink); color: var(--paper); border-color: transparent; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}
.site-header .inner > * { min-width: 0; }
.logo {
  display: inline-flex; align-items: baseline; gap: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex-shrink: 0;
  white-space: nowrap;
}
.nav { flex-wrap: wrap; justify-content: center; }
.site-header .header-cta { flex-shrink: 0; }
@media (max-width: 1100px) {
  .nav a:not(.nav-primary) { display: none; }
  .logo .tld { display: none; }
}
@media (max-width: 760px) {
  .site-header .header-cta .btn:not(.btn-ink) { display: none; }
  .nav { display: none; }
}
.logo .dot { color: var(--clay); }
.logo .tld { color: var(--ink-3); font-size: 16px; margin-left: 2px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14.5px;
  padding: 8px 12px; border-radius: 6px;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }

/* Placeholder imagery: subtle diagonal stripes */
.ph {
  background-image: repeating-linear-gradient(
    135deg,
    var(--paper-2) 0, var(--paper-2) 10px,
    var(--paper-3) 10px, var(--paper-3) 20px
  );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  color: var(--ink-3);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.ph-clay {
  background-image: repeating-linear-gradient(
    135deg,
    var(--clay-soft) 0, var(--clay-soft) 10px,
    oklch(93% 0.035 45) 10px, oklch(93% 0.035 45) 20px
  );
  color: var(--clay-deep);
  border-color: oklch(85% 0.05 45);
}
.ph-sage {
  background-image: repeating-linear-gradient(
    135deg,
    var(--sage-soft) 0, var(--sage-soft) 10px,
    oklch(95% 0.025 155) 10px, oklch(95% 0.025 155) 20px
  );
  color: oklch(35% 0.08 155);
  border-color: oklch(85% 0.04 155);
}

/* Hairline separator */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Pills / chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Star rating */
.stars { color: var(--clay); letter-spacing: 1px; font-size: 14px; }

/* Tweaks panel */
.tweaks-panel {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  width: 320px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  font-size: 13px;
}
.tweaks-panel h4 { font-size: 13px; font-weight: 600; margin-bottom: 10px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); }
.tweaks-row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; gap: 8px; }
.tweaks-row label { color: var(--ink-2); }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }
.swatch.active { border-color: var(--ink); }

/* Theme variants */
body.theme-sage { --clay: oklch(48% 0.08 155); --clay-deep: oklch(38% 0.08 155); --clay-soft: oklch(92% 0.03 155); }
body.theme-ink  { --clay: oklch(28% 0.02 60); --clay-deep: oklch(18% 0.02 60); --clay-soft: oklch(92% 0.01 60); }
body.theme-honey{ --clay: oklch(65% 0.14 75); --clay-deep: oklch(52% 0.13 72); --clay-soft: oklch(93% 0.05 80); }

/* Scroll */
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ */
/* Phase 2 additions (not in prototype):                              */
/*   - Reset button styles for link-button nav / form actions         */
/*   - Leaflet popup overrides for directory map                      */
/*   - Quote modal fade-in + tab section toggle                       */
/*   - A few small vanilla-JS helpers the React version did inline    */
/* ------------------------------------------------------------------ */

/* Unstyled <a> that should look like body text (for href-ified buttons) */
.unlink { color: inherit; text-decoration: none; }

/* Profile tab buttons — vanilla replacement for React state */
.tab-btn {
  padding: 12px 20px;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-weight: 400;
  text-transform: capitalize;
  margin-bottom: -1px;
}
.tab-btn.active {
  border-bottom-color: var(--clay);
  color: var(--ink);
  font-weight: 500;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Leaflet overrides — keep the map visually aligned with the design system */
#map { width: 100%; height: 100%; min-height: 600px; border-radius: 12px; border: 1px solid var(--line); }
.leaflet-container { font-family: 'Geist', ui-sans-serif, system-ui, sans-serif; }
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; }
.leaflet-popup-content h4 { font-size: 15px; margin-bottom: 4px; }
.leaflet-popup-content a { color: var(--clay); text-decoration: none; font-size: 13px; }
.leaflet-popup-content a:hover { text-decoration: underline; }
.leaflet-popup-tip { border: 1px solid var(--line); }

/* Custom clay-colored marker */
.agent-marker {
  width: 28px; height: 28px;
  background: var(--clay);
  border: 3px solid var(--paper);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.agent-marker.active {
  background: var(--clay-deep);
  width: 34px; height: 34px;
}

/* Quote modal (vanilla JS replacement for React state machine) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 20, 10, 0.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal-panel {
  background: var(--paper);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.modal-step { display: none; }
.modal-step.active { display: block; }
.modal-progress-pip {
  width: 24px; height: 3px; border-radius: 2px; background: var(--line-2);
  display: inline-block;
}
.modal-progress-pip.done { background: var(--clay); }

/* Small nav link emphasis for Jinja `current_page` */
.nav a.current { color: var(--ink); font-weight: 600; }

/* Lines-of-insurance tile hover (was inline JS mouseover in prototype) */
.line-tile {
  padding: 28px 22px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-3);
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.line-tile:hover { border-color: var(--clay); }

/* Agent card hover */
.agent-card { cursor: pointer; transition: all .15s; text-decoration: none; color: inherit; display: block; }
.agent-card:hover { border-color: var(--clay); box-shadow: var(--shadow); }

/* Directory list card "highlighted" state (from map hover) */
.directory-card.highlighted { border-color: var(--clay); }
