/* ============================================================
   Atlas Coffee — styles.css
   Design: warm-minimal, mobile-first, Beany-inspired
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Backgrounds */
  --color-bg:          #F5F0E8;   /* Warm parchment — panel / sheet background */
  --color-surface:     #FFFFFF;   /* Cards, panels */
  --bg-hover:          #F0EBE1;   /* Card hover state */

  /* Text */
  --color-text:        #1A1A1A;
  --color-text-muted:  #6B6B6B;
  --text-muted-light:  #9B9B9B;  /* Helper text, distances */

  /* Accent — dark honey, deeper than the old pale amber */
  --color-accent:      #B8733A;
  --color-accent-dark: #A0632E;
  --accent-light:      #F5E6D3;  /* Accent at ~15% — tag tints, hover */

  /* Badge — World's Best */
  --badge-bg:          #B8733A;
  --badge-text:        #FFFFFF;

  /* Borders & dividers */
  --color-border:      #E5E0D8;
  --divider:           #EDE8E0;

  /* Brew method tags */
  --color-tag-pourover-bg:   #E8F0E8;
  --color-tag-pourover-text: #4A6B4A;
  --color-tag-espresso-bg:   #F0E8E0;
  --color-tag-espresso-text: #7A5C3C;
  --color-tag-aeropress-bg:  #E0E8F0;
  --color-tag-aeropress-text:#3C5A7A;
  --color-tag-batch-bg:      #F0EDE0;
  --color-tag-batch-text:    #6B5F3C;
  --color-tag-siphon-bg:     #F0E0E8;
  --color-tag-siphon-text:   #7A3C5A;
  --color-tag-cold-bg:       #E0F0F0;
  --color-tag-cold-text:     #3C6B6B;

  --radius-card:       18px;
  --radius-pill:       100px;
  --radius-btn:        12px;
  --radius-sheet:      20px;

  --shadow-card:  0 1px 4px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.08);
  --shadow-float: 0 2px 12px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Bottom sheet snap points (mobile) */
  --sheet-peek: 220px;   /* collapsed: shows ~2-3 cards */
  --sheet-mid:  55vh;    /* mid: covers half */
  --sheet-full: 92vh;    /* full: nearly full screen */
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  overflow: hidden; /* prevent body scroll — scrolling happens inside panels */
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh; /* dynamic viewport height for mobile browsers */
  position: relative;
}

/* Side panel hidden on mobile */
#side-panel { display: none; }

/* Mobile locate-me button — floats above the bottom sheet */
#locate-me-mobile {
  display: none; /* shown only on mobile via media query below */
  position: fixed;
  right: 16px;
  bottom: calc(var(--sheet-height, var(--sheet-peek)) + 16px);
  z-index: 210;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.10);
  color: var(--color-text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease, color 0.15s ease;
}

#locate-me-mobile:active {
  color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Mobile overlay (search + filters) hidden on desktop */
@media (max-width: 767px) {
  #locate-me-mobile { display: flex; }
}

#bottom-sheet.sheet-detail-mode ~ #locate-me-mobile {
  display: none !important;
}

/* ── Filter bar gradient fade ────────────────────────────── */
.filter-bar-wrap {
  position: relative;
}

.filter-bar-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--color-bg));
  pointer-events: none;
  z-index: 1;
}

/* On mobile the fade sits over the map — use a slightly transparent stop */
@media (max-width: 767px) {
  .filter-bar-wrap::after {
    background: linear-gradient(to right, transparent, rgba(245, 240, 232, 0.9));
  }
}

/* ── Mobile wordmark strip ────────────────────────────────── */
#mobile-wordmark {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text);
  text-transform: lowercase;
  background: rgba(245, 240, 232, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
  #mobile-overlay    { display: none !important; }
  #bottom-sheet      { display: none !important; }
  #detail-panel      { display: none !important; }
  #locate-me-mobile  { display: none !important; }
}

/* ── Map container ────────────────────────────────────────── */
#map {
  flex: 1;
  width: 100%;
  min-height: 0;
  filter: saturate(0.88) brightness(1.02);
}

/* ── Floating search bar ──────────────────────────────────── */
#search-bar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  z-index: 100;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08), 0 2px 14px rgba(0,0,0,0.07);
  border: 1.5px solid var(--color-border);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.search-input-wrap:focus-within {
  border-color: rgba(184,115,58,0.4);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08), 0 2px 14px rgba(0,0,0,0.07), 0 0 0 2px rgba(184,115,58,0.12);
}

.search-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
  width: 18px;
  height: 18px;
}

#search-input,
#mobile-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 16px; /* ≥16px prevents iOS Safari auto-zoom on focus */
  color: var(--color-text);
  background: transparent;
  min-width: 0;
  -webkit-appearance: none; /* strip native search-input chrome on Safari */
  appearance: none;
}

#search-input::placeholder,
#mobile-search-input::placeholder {
  color: var(--color-text-muted);
}

/* Clear button — shown when wrapper has .has-value */
.search-clear-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.search-input-wrap.has-value .search-clear-btn {
  opacity: 1;
  pointer-events: auto;
}

.search-clear-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Hide the native search cancel/decoration icons injected by WebKit */
#search-input::-webkit-search-decoration,
#search-input::-webkit-search-cancel-button,
#mobile-search-input::-webkit-search-decoration,
#mobile-search-input::-webkit-search-cancel-button {
  display: none;
}

/* ── Filter chips bar ─────────────────────────────────────── */
#filter-bar {
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 99;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

#filter-bar::-webkit-scrollbar { display: none; }
#mobile-filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.filter-chip:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--color-accent);
}

.filter-chip.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(184,115,58,0.35);
}

/* ── Bottom sheet (mobile) ────────────────────────────────── */
#bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-bg);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: 0 -2px 20px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  /* height controlled by JS via CSS custom property */
  height: var(--sheet-peek);
  transition: height 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: height;
}

#bottom-sheet.dragging {
  transition: none;
}

/* Pull handle */
.sheet-handle {
  width: 100%;
  padding: 12px 0 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}

.sheet-handle:active { cursor: grabbing; }

.sheet-handle-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
}

/* Sheet header row */
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  flex-shrink: 0;
}

.sheet-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.sheet-count {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Sheet internal state views */
#sheet-list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

#sheet-detail-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

#bottom-sheet.sheet-detail-mode #sheet-list-view {
  display: none;
}

#bottom-sheet.sheet-detail-mode #sheet-detail-view {
  display: flex;
}

/* Back button row */
.sheet-detail-header {
  display: flex;
  align-items: center;
  padding: 2px 16px 10px;
  flex-shrink: 0;
}

.sheet-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 6px 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sheet-back-btn svg {
  width: 18px;
  height: 18px;
}

/* Scrollable detail body inside sheet */
#sheet-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px max(24px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

#sheet-detail-body::-webkit-scrollbar { width: 0; }

/* Card list inside sheet */
#card-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

#card-list::-webkit-scrollbar { width: 0; }

/* ── Shop card ────────────────────────────────────────────── */
.shop-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.shop-card:hover {
  background: var(--bg-hover);
}

.shop-card.active {
  background: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(184,115,58,0.65), var(--shadow-card);
  position: relative;
}


.shop-card:active {
  transform: scale(0.985);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 5px;
}

.card-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.card-badge {
  flex-shrink: 0;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  padding: 3.5px 9px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.card-badge.gold {
  color: #fff;
  background: linear-gradient(135deg, #C9980A 0%, #A87800 100%);
}

.card-neighbourhood {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 9px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 0;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.tag-pourover   { background: var(--color-tag-pourover-bg);   color: var(--color-tag-pourover-text); }
.tag-espresso   { background: var(--color-tag-espresso-bg);   color: var(--color-tag-espresso-text); }
.tag-aeropress  { background: var(--color-tag-aeropress-bg);  color: var(--color-tag-aeropress-text);}
.tag-batch      { background: var(--color-tag-batch-bg);      color: var(--color-tag-batch-text);    }
.tag-siphon     { background: var(--color-tag-siphon-bg);     color: var(--color-tag-siphon-text);   }
.tag-cold_brew  { background: var(--color-tag-cold-bg);       color: var(--color-tag-cold-text);     }

.card-distance {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.card-distance-sep {
  color: var(--color-border);
}

.card-descriptor {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ── Info / detail sheet — mobile-only, now retired in favour of in-sheet state ── */
/* Kept in HTML for potential future use; hidden everywhere via base style */
#detail-panel {
  display: none;
}

.detail-handle {
  width: 100%;
  padding: 12px 0 4px;
  display: flex;
  justify-content: center;
}

.detail-handle-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.detail-body {
  padding: 8px 20px 0;
}

.detail-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 3px;
  padding-right: 36px; /* clear close btn */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.detail-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-roaster {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.detail-roaster strong {
  color: var(--color-text);
  font-weight: 500;
}

.detail-notes {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.detail-source {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.detail-source a {
  color: var(--color-accent);
  text-decoration: none;
}

.detail-source a:hover { text-decoration: underline; }

.detail-links {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-links a {
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.detail-links a:hover { text-decoration: underline; }

.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.detail-badge.amber { background: var(--color-tag-pourover-bg); color: var(--color-accent); }
.detail-badge.gold  { background: #FEF9E0; color: #B8860B; }

/* ── Hours ────────────────────────────────────────────────── */
.detail-hours {
  margin-bottom: 14px;
}

.detail-hours summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: var(--color-text);
}

.detail-hours summary::-webkit-details-marker { display: none; }

.hours-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hours-dot.open   { background: #22c55e; }
.hours-dot.closed { background: #ef4444; }

.hours-chevron {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform 0.18s ease;
  line-height: 1;
}

.detail-hours[open] .hours-chevron {
  transform: rotate(180deg);
}

.hours-week {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 3ch 1fr;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.hours-week .day-today {
  color: var(--color-text);
  font-weight: 600;
}

.btn-maps {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-maps:hover { background: var(--color-accent-dark); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.empty-state-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  opacity: 0.75;
}

.empty-state p {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.empty-state small {
  font-size: 13px;
  line-height: 1.5;
}

.suggest-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  text-align: left;
}

.suggest-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text) !important;
  margin-bottom: 2px;
}

.suggest-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.suggest-form input:focus {
  border-color: rgba(184, 115, 58, 0.5);
  box-shadow: 0 0 0 2px rgba(184, 115, 58, 0.12);
}

.suggest-form input::placeholder {
  color: var(--color-text-muted);
}

.suggest-form button {
  width: 100%;
  padding: 11px 16px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
  margin-top: 2px;
}

.suggest-form button:hover  { background: var(--color-accent-dark); }
.suggest-form button:disabled { opacity: 0.6; cursor: default; }

.suggest-thanks {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 500;
  text-align: center;
}

/* ── Cluster badge (injected by markerclusterer) ─────────── */
/* markerclusterer renders its own DOM; we style via the renderer */

/* ── Custom map marker wrapper ────────────────────────────── */
.atlas-marker {
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.atlas-marker:hover {
  transform: scale(1.15);
  z-index: 10;
}

/* White circular disc — solid surface, strong shadow, warm outline */
.atlas-marker-disc {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.22),
    0 1px 3px  rgba(0, 0, 0, 0.14);
  border: 1.5px solid rgba(184, 115, 58, 0.28);
}

/* World's 100 Best — restrained gold disc, warm ivory surface */
.atlas-marker.gold .atlas-marker-disc {
  background: #FFFBF0;
  border-color: rgba(172, 130, 32, 0.4);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.24),
    0 1px 4px  rgba(0, 0, 0, 0.14),
    0 0 0 2.5px rgba(172, 130, 32, 0.52);
}

/* Hovered state — soft emphasis when the corresponding card is hovered */
.shop-card.hovered { background: var(--bg-hover); }

.atlas-marker.hovered .atlas-marker-disc {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.24),
    0 1px 3px  rgba(0, 0, 0, 0.14),
    0 0 0 2.5px rgba(184, 115, 58, 0.45);
}

/* Selected state — shown when card/marker is chosen */
.atlas-marker.selected .atlas-marker-disc {
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.28),
    0 1px 4px  rgba(0, 0, 0, 0.16),
    0 0 0 3px rgba(184, 115, 58, 0.9);
  background: var(--accent-light);
}

/* Featured ring — shops on 2+ curated lists get a warm amber halo */
.atlas-marker.featured-ring .atlas-marker-disc {
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.22),
    0 1px 3px  rgba(0, 0, 0, 0.14),
    0 0 0 2.5px rgba(184, 115, 58, 0.55);
}

/* Entrance animation for newly visible markers */
@keyframes markerEnter {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.atlas-marker.marker-entering {
  animation: markerEnter 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Amber pulse ring — fires when a card is selected from the side panel */
@keyframes markerPulse {
  0%   { box-shadow: 0 3px 10px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.14), 0 0 0 2.5px rgba(184,115,58,0.55), 0 0 0 2.5px rgba(184,115,58,0.7); }
  50%  { box-shadow: 0 3px 10px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.14), 0 0 0 2.5px rgba(184,115,58,0.55), 0 0 0 14px rgba(184,115,58,0.18); }
  100% { box-shadow: 0 3px 10px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.14), 0 0 0 2.5px rgba(184,115,58,0.55), 0 0 0 22px rgba(184,115,58,0);   }
}

.atlas-marker.marker-pulse .atlas-marker-disc {
  animation: markerPulse 0.6s ease-out 2;
}

/* ── Marker hover card ────────────────────────────────────── */
.marker-hover-card {
  display: none;
  position: fixed;
  z-index: 500;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
  pointer-events: auto;
  min-width: 180px;
  max-width: 260px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.marker-hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.hover-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hover-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-tag-pourover-bg);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  white-space: nowrap;
}

.hover-card-badge.gold {
  color: #B8860B;
  background: #FEF9E0;
}

.hover-card-neighbourhood {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.hover-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hover-card-notes {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

.hover-card-roaster {
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 8px;
}

.hover-card-links {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.hover-card-links a {
  font-size: 12px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.hover-card-links a:hover { text-decoration: underline; }

.hover-card-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.hover-card-source {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-text-muted);
}

/* Active (clicked) state — elevated above the transient preview card */
.marker-hover-card.active {
  z-index: 502;
  box-shadow: 0 6px 28px rgba(0,0,0,0.16), 0 1px 4px rgba(0,0,0,0.08);
}

.hover-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.marker-hover-card.active .hover-card-header {
  padding-right: 28px; /* clear the close button */
}

.hover-card-cta {
  display: block;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease;
}

.hover-card-cta:hover {
  background: var(--color-accent-dark);
}

/* Hide on touch/mobile — hover doesn't exist there */
@media (hover: none) {
  .marker-hover-card { display: none !important; }
}

/* ── Google Places Autocomplete dropdown ─────────────────── */
.pac-container {
  font-family: var(--font) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-float) !important;
  margin-top: 6px !important;
  overflow: hidden;
  padding: 4px 0 !important;
  background: var(--color-surface) !important;
}

.pac-item {
  padding: 9px 16px !important;
  font-size: 14px !important;
  color: var(--color-text) !important;
  border-top: none !important;
  cursor: pointer;
  line-height: 1.4 !important;
}

.pac-item:hover,
.pac-item-selected {
  background: var(--bg-hover) !important;
}

.pac-item-query {
  font-size: 14px !important;
  color: var(--color-text) !important;
  font-weight: 500;
}

.pac-matched {
  font-weight: 700;
  color: var(--color-accent) !important;
}

.pac-icon {
  display: none !important; /* hide Google's pin icon — too busy */
}

.pac-logo::after {
  /* keep the "powered by Google" footer but slim it down */
  padding: 4px 12px !important;
  font-size: 11px !important;
}

/* ── Desktop layout (≥ 768px) ─────────────────────────────── */
@media (min-width: 768px) {
  #app {
    flex-direction: row;
  }

  /* Side panel */
  #side-panel {
    display: flex;
    flex-direction: column;
    width: 380px;
    flex-shrink: 0;
    background: var(--color-bg);
    height: 100dvh;
    overflow: hidden;
    border-right: 1px solid var(--color-border);
  }

  #map {
    flex: 1;
  }

  /* Wordmark */
  #wordmark {
    padding: 20px 16px 10px;
    flex-shrink: 0;
  }

  .wordmark-title {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--color-text);
    text-transform: lowercase;
  }

  .wordmark-tagline {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 3px;
  }

  /* Search bar repositioned inside side panel on desktop */
  #search-bar {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
    max-width: none;
    padding: 16px 16px 0;
  }

  #filter-bar {
    position: relative;
    top: auto;
    padding: 12px 16px 2px;
  }

  /* Panel card list */
  #side-card-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #side-card-list::-webkit-scrollbar {
    width: 4px;
  }

  #side-card-list::-webkit-scrollbar-track {
    background: transparent;
  }

  #side-card-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
  }

  #panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 4px;
  }

  #panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
  }

  #panel-count {
    font-size: 13px;
    color: var(--color-text-muted);
    transition: opacity 0.2s ease;
  }

  .panel-distance-note {
    font-size: 11px;
    color: var(--color-text-muted);
    padding: 0 16px 8px;
    opacity: 0.7;
  }

  /* Desktop detail: inline expansion in side panel */
  #desktop-detail {
    position: absolute;
    bottom: 0;
    left: 380px;
    width: 340px;
    z-index: 200;
    background: var(--color-surface);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    box-shadow: var(--shadow-float);
    padding: 0 0 24px;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }

  #desktop-detail.visible {
    transform: translateY(0);
  }
}

/* ── Very small screens ────────────────────────────────────── */
@media (max-width: 359px) {
  .card-name { font-size: 14px; }
  .filter-chip { padding: 6px 11px; font-size: 12px; }
}

/* ── Loading overlay ──────────────────────────────────────── */
#loading {
  position: fixed;
  inset: 0;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-dot {
  width: 48px;
  height: 48px;
}

.loading-text {
  font-size: 15px;
  color: var(--color-text-muted);
}

/* ── Fade-in animation for cards ──────────────────────────── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.shop-card {
  animation: cardIn 0.22s ease both;
}

/* stagger each card */
.shop-card:nth-child(1)  { animation-delay: 0.03s; }
.shop-card:nth-child(2)  { animation-delay: 0.06s; }
.shop-card:nth-child(3)  { animation-delay: 0.09s; }
.shop-card:nth-child(4)  { animation-delay: 0.12s; }
.shop-card:nth-child(5)  { animation-delay: 0.15s; }
.shop-card:nth-child(n+6){ animation-delay: 0.18s; }
