/* ============ CITY MAP VIEW ============ */
#city-view {
  background: var(--surface-cream);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
  transform: translateY(20px);
}
#city-view.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
#city-view:not(.hidden) { transform: translateY(0); }

/* Parchment-unroll entrance animation (REQ-3) */
@keyframes parchmentUnroll {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
#city-view.city-entering {
  clip-path: inset(0 100% 0 0);
  animation: parchmentUnroll 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Desaturation moment — tiles start gray, warm on entry (REQ spec) */
@keyframes tileWarmUp {
  from { filter: grayscale(0.6) sepia(0.05) brightness(0.98); }
  to   { filter: sepia(0.15) saturate(0.85) brightness(1.02); }
}
.leaflet-tile-pane {
  filter: sepia(0.15) saturate(0.85) brightness(1.02);
}
.city-entering .leaflet-tile-pane,
.tiles-warming .leaflet-tile-pane {
  animation: tileWarmUp 1.2s ease-out forwards;
}

.city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-cream);
  border-bottom: 1px solid rgba(44,24,16,0.08);
  z-index: 1000;
  flex-shrink: 0;
}
.city-back {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-dark-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  transition: background var(--transition-fast);
}
.city-back:hover { background: rgba(139,69,19,0.06); }
.city-back svg { width: 18px; height: 18px; stroke: var(--text-dark-secondary); }

.city-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-dark);
}

/* Filter bar (REQ-6) */
.city-filter-bar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-cream);
  border-bottom: 1px solid rgba(44,24,16,0.06);
  overflow-x: auto;
  z-index: 1000;
  position: relative;
  flex-shrink: 0;
}
.filter-pill {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: 20px;
  border: 1px solid rgba(44,24,16,0.12);
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.filter-pill:hover {
  border-color: var(--text-dark-secondary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(44,24,16,0.08);
}
.filter-pill.active {
  background: var(--text-dark);
  color: var(--surface-cream);
  border-color: var(--text-dark);
  box-shadow: 0 2px 12px rgba(44,24,16,0.18);
}
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: rgba(44,24,16,0.08);
  border-radius: 9px;
  margin-left: var(--space-1);
  padding: 0 var(--space-1);
  transition: background 0.25s ease;
}
.filter-pill.active .filter-count { background: rgba(242,235,224,0.2); }

/* Map */
#map-container { flex: 1; position: relative; }
#city-map { width: 100%; height: 100%; }
.leaflet-control-attribution { display: none !important; }

/* Markers (REQ-2, REQ-8, REQ-9) */
.coffee-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 48% 52% 50% 50%;
  font-family: var(--font-ui);
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 0 3px rgba(255,255,255,0.15);
  cursor: pointer;
  /* WCAG 2.5.5: minimum 44x44px touch target (REQ-3, AC-9) */
  min-width: 44px;
  min-height: 44px;
  /* Bloom: start hidden, transition to visible */
  transform: scale(0);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}
.coffee-marker.bloomed {
  transform: scale(1);
  opacity: 1;
}
.coffee-marker.bloomed:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 3px rgba(255,255,255,0.25);
}
.coffee-marker.gold { background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber)); }
.coffee-marker.brown { background: linear-gradient(135deg, var(--accent-copper), #6B3410); }
.coffee-marker.tan { background: linear-gradient(135deg, var(--score-low), #9E8B6E); }
.coffee-marker.active {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(200,146,58,0.5), 0 4px 20px rgba(0,0,0,0.3);
  z-index: 1000;
}

/* Neighborhood labels (REQ-11) */
.neighborhood-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-dark-secondary);
  opacity: 0.45;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

/* Empty state */
.empty-filter-state {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 400;
  pointer-events: none;
  display: none;
}
.empty-filter-state.visible { display: block; }
.empty-filter-state p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-dark-secondary);
  opacity: 0.7;
  font-style: italic;
}

/* Shop list strip */
.shop-list-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 550;
  padding: var(--space-3) var(--space-4);
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: linear-gradient(to top, rgba(242, 235, 224, 0.95) 60%, transparent);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.shop-list-strip::-webkit-scrollbar { display: none; }
.shop-list-strip.hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }

/* Tasting cards (REQ-4, REQ-5) */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.shop-list-card {
  flex-shrink: 0;
  scroll-snap-align: center;
  background: white;
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
  padding-left: calc(var(--space-4) + 3px);
  min-width: 150px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid rgba(44,24,16,0.06);
  position: relative;
  overflow: hidden;
  /* Stagger animation */
  opacity: 0;
  animation: cardFadeIn 0.4s ease-out forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* Amber accent bar on left edge */
.shop-list-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent-gold), var(--accent-amber));
  border-radius: 3px 0 0 3px;
}
.shop-list-card:hover, .shop-list-card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
}
.shop-list-card .card-rank {
  position: absolute;
  top: 8px; right: 10px;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--accent-copper-rose);
  opacity: 0.5;
}
/* Three-font hierarchy: Space Grotesk score, Playfair Display name, Cormorant Garamond hood */
.shop-list-card .card-score {
  font-family: 'Space Grotesk', var(--font-ui);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--accent-amber);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.shop-list-card .card-name {
  font-family: 'Playfair Display', var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dark);
  margin-top: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  line-height: 1.3;
}
.shop-list-card .card-hood {
  font-family: 'Cormorant Garamond', var(--font-body);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--text-dark-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  margin-top: 1px;
  letter-spacing: 0.01em;
}
