/* ZonQR — Directorio local */
:root {
  --bg: #080808;
  --bg-card: #121212;
  --bg-elevated: #1a1a1a;
  --line: #2a2a2a;
  --text: #f3f3ee;
  --text-muted: #9a9a90;
  --lime: #c6ff3d;
  --lime-dim: #a8d934;
  --lime-glow: color-mix(in srgb, var(--lime) 25%, transparent);
  --on-primary: #080808; /* texto sobre el color primario */
  --header-bg: rgba(8,8,8,0.92);
  /* alias usados por el banner de instalación */
  --surface: var(--bg-card);
  --border: var(--line);
  --accent: var(--lime);
  --danger: #ff5c5c;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Outfit", system-ui, sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ========== HEADER ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--lime);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 800;
}

.search-wrap {
  flex: 1;
  position: relative;
  max-width: 420px;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s;
}

.search-wrap input:focus {
  border-color: var(--lime);
}

.search-wrap input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.zone-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.zone-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--lime);
}

@media (min-width: 640px) {
  .zone-badge { display: flex; }
}
/* Móvil: las categorías ocupan su propia fila para no quedar aplastadas */
@media (max-width: 639px) {
  .categories { flex-basis: 100%; order: 10; }
}

/* ========== MAIN LAYOUT ========== */
.main {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-h));
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.view-toggle {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--line);
}

.view-toggle button {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.view-toggle button.active {
  background: var(--lime);
  color: var(--on-primary);
  font-weight: 600;
}

.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding-bottom: 2px;
}

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

.cat-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-chip:hover { border-color: var(--text-muted); color: var(--text); }
.cat-chip.active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-primary);
  font-weight: 600;
}

.result-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.loc-btn {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--lime);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.filters-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px 10px;
  -webkit-overflow-scrolling: touch;
}
.filters-bar select,
.filter-chip {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.filter-chip { cursor: pointer; }
.filter-chip.on {
  background: var(--lime);
  color: var(--on-primary);
  border-color: var(--lime);
  font-weight: 700;
}

.nearest-bar {
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text);
}
.nearest-bar strong { color: var(--lime); }
.nearest-bar .linkish {
  background: none;
  border: 0;
  color: var(--lime);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ========== LIST VIEW ========== */
.list-view {
  flex: 1;
  padding: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 640px) {
  .list-view {
    grid-template-columns: repeat(2, 1fr);
  }
}

.biz-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.biz-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.biz-card.destacado {
  border-color: color-mix(in srgb, var(--lime) 35%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--lime) 12%, transparent);
}

.biz-card-img {
  height: 140px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.biz-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-destacado {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--lime);
  color: var(--on-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.biz-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.biz-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.biz-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.biz-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--lime);
  font-weight: 600;
  flex-shrink: 0;
}

.biz-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.biz-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.biz-status {
  color: var(--lime-dim);
}

.biz-promo {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--lime);
  background: color-mix(in srgb, var(--lime) 8%, transparent);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.biz-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--lime);
  color: var(--on-primary);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ========== MAP VIEW ========== */
.map-view {
  flex: 1;
  position: relative;
  display: none;
  min-height: 400px;
}

.map-view.active { display: block; }
.list-view.hidden { display: none; }

#map {
  width: 100%;
  height: 100%;
  min-height: calc(100dvh - var(--header-h) - 70px);
  background: var(--bg-elevated);
}

.map-tools {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 500;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}
.map-tools button {
  pointer-events: auto;
  border: 0;
  background: var(--lime);
  color: var(--on-primary);
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

/* Mapa principal: OSM oscurecido en tema oscuro (en tema claro se ve normal) */
#map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.6); }
html[data-theme-mode="light"] #map .leaflet-tile-pane { filter: none; }

/* Leaflet custom markers */
.zonqr-marker {
  background: var(--lime);
  border: 2px solid #080808;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.zonqr-marker span {
  transform: rotate(45deg);
  font-size: 12px;
  font-weight: 800;
  color: var(--on-primary);
}

.zonqr-marker.destacado {
  background: #fff;
  box-shadow: 0 0 0 3px var(--lime), 0 2px 10px rgba(0,0,0,0.5);
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
  border: 1px solid var(--line);
  box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-popup-content { margin: 12px 14px !important; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-muted) !important; }

.popup-name { font-weight: 700; font-family: var(--font-display); margin-bottom: 4px; }
.popup-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.popup-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 5px 12px;
  background: var(--lime);
  color: var(--on-primary);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ========== DETAIL MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg);
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid var(--line);
  border-bottom: none;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: 20px;
    max-height: 90vh;
    border-bottom: 1px solid var(--line);
  }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.modal-gallery {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.modal-gallery::-webkit-scrollbar { display: none; }

.modal-gallery img {
  width: 240px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  scroll-snap-align: start;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.modal-body { padding: 0 16px 24px; }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.modal-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stars { color: var(--lime); letter-spacing: 1px; }

.modal-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.modal-info {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.modal-info-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.modal-info-row svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}

.modal-promo {
  background: color-mix(in srgb, var(--lime) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--lime) 25%, transparent);
  color: var(--lime);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Reviews section */
.reviews-section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.review-form {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.review-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.star-input {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.star-input button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--line);
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}

.star-input button.active,
.star-input button:hover { color: var(--lime); }

.review-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
}

.review-form textarea:focus { border-color: var(--lime); }

.photo-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.photo-upload input[type="file"] { display: none; }

.photo-preview {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-elevated);
  display: none;
}

.photo-preview.visible { display: block; }

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.review-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.review-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.review-stars {
  color: var(--lime);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.review-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.review-photo {
  margin-top: 10px;
  border-radius: 8px;
  max-height: 180px;
  object-fit: cover;
  width: 100%;
}

.empty-reviews {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 0;
  font-size: 0.9rem;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--lime);
  color: var(--on-primary);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 300;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Loading map */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  z-index: 10;
}

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* PWA Install banner */
.install-banner {
  position: fixed;
  bottom: 20px;
  left: 16px;
  right: 16px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 1000;
  transform: translateY(120%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.install-banner.show {
  transform: translateY(0);
}
.install-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--on-primary);
  flex-shrink: 0;
}
.install-banner-text {
  flex: 1;
  min-width: 0;
}
.install-banner-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}
.install-banner-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.install-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.install-banner-actions button {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.install-banner-actions .btn-install {
  background: var(--accent);
  color: var(--on-primary);
}
.install-banner-actions .btn-dismiss {
  background: transparent;
  color: var(--text-muted);
}

/* Offline badge */
.offline-badge {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-elevated);
  color: #f5a623;
  border: 1px solid rgba(245, 166, 35, 0.4);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.offline-badge.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* App footer (demo → sales) */
.app-footer {
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
}
.app-footer a { color: var(--lime); }
.app-footer .sep { margin: 0 6px; color: var(--line); }


/* Google Maps InfoWindow */
.gmap-popup { min-width: 140px; }
.gmap-popup .popup-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 12px;
  background: var(--lime);
  color: var(--on-primary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.gm-style .gm-style-iw-c {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
.gm-style .gm-style-iw-d { overflow: auto !important; max-height: none !important; }
.gm-style .gm-style-iw-tc::after { background: var(--bg-card) !important; }
.gm-style-iw-chr button { filter: invert(1); }

/* ========== TEMA: logo / tagline / banner ========== */
.logo-icon.has-img { background: transparent; overflow: hidden; }
.logo-icon:has(.zq-mark) { background: none; }
.zq-mark { width: 100%; height: 100%; display: block; }
.install-banner-icon img { width: 100%; height: 100%; display: block; }
.logo-icon.has-img img { width: 100%; height: 100%; object-fit: contain; }
.site-hero { max-width: 900px; width: 100%; margin: 0 auto; padding: 10px 16px 0; }
.site-hero[hidden], .site-tagline[hidden] { display: none; }
.site-hero img { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.site-tagline { max-width: 900px; width: 100%; margin: 0 auto; padding: 10px 16px 0; color: var(--text-muted); font-size: 0.9rem; }

/* ========== Ubicación manual ========== */
.loc-pick-btn { color: var(--text); }
.loc-btn.manual { border-color: var(--lime); }
.loc-sheet .modal { padding-bottom: 8px; }
.loc-sheet-body { padding: 12px 16px 16px; display: grid; gap: 12px; }
.loc-sheet-body p.hint { font-size: 0.82rem; color: var(--text-muted); }
.loc-search { display: flex; gap: 8px; }
.loc-search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--line); outline: none;
}
.loc-search input:focus { border-color: var(--lime); }
.loc-results { display: grid; gap: 6px; }
.loc-results button, .loc-zones button {
  text-align: left; background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; font-size: 0.85rem;
}
.loc-results button:hover, .loc-zones button:hover { border-color: var(--lime); }
.loc-zones { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; }
.loc-zones button { border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; }
#loc-map { height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-elevated); }
.loc-current { font-size: 0.85rem; }
.loc-current strong { color: var(--lime); }
.loc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-pin {
  width: 22px; height: 22px; border-radius: 50%; background: var(--lime);
  border: 3px solid var(--on-primary); box-shadow: 0 0 0 4px var(--lime-glow), 0 2px 8px rgba(0,0,0,.5);
}

/* ========== Catálogo completo ========== */
.full-btn { font-weight: 600; }
.full-bar {
  margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--lime) 10%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--lime) 35%, transparent);
  font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
}
.full-bar[hidden] { display: none; }
.full-bar .linkish { background: none; border: 0; color: var(--lime); font: inherit; cursor: pointer; text-decoration: underline; }
.filters-bar.disabled select, .filters-bar.disabled .filter-chip { opacity: .45; pointer-events: none; }

/* Móvil: la insignia flotante "Powered by Netlify" (abajo) no debe tapar botones de hojas, toast ni banner */
@media (max-width: 639px) {
  .modal, .loc-sheet .modal { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: 84px; transform: translateX(-50%) translateY(calc(100% + 120px)); }
  .toast.show { transform: translateX(-50%) translateY(0); }
  .install-banner { bottom: 84px; transform: translateY(calc(100% + 120px)); }
  .install-banner.show { transform: translateY(0); }
}

/* ========== Redes sociales (tarjeta y ficha) ========== */
.biz-social { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.social-ico {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-muted); background: transparent; font-size: 0.85rem; font-weight: 600;
}
.social-ico:hover, .social-ico:focus-visible { border-color: var(--lime); color: var(--lime); }
.social-ico.with-label { padding: 0 14px 0 12px; }
.social-ico svg { flex-shrink: 0; }
.modal-social { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 24px; }

/* ========== Vista previa dentro del admin (index.html?preview=1) ========== */
.preview-mode .search-wrap, .preview-mode .zone-badge, .preview-mode .toolbar, .preview-mode .filters-bar,
.preview-mode .nearest-bar, .preview-mode .full-bar, .preview-mode .app-footer, .preview-mode .map-tools,
.preview-mode .install-banner, .preview-mode .offline-badge, .preview-mode .reviews-section { display: none !important; }
.preview-mode .list-view { max-width: 640px; margin: 0 auto; grid-template-columns: 1fr; padding-top: 16px; }

/* ========== Safe area (iPhone/iPad instalada: status bar black-translucent + viewport-fit=cover) ==========
   env() vale 0 en Safari normal (pestaña con barra) y en páginas sin viewport-fit=cover → no hay doble relleno. */
:root {
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
.header {
  height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) max(16px, var(--safe-r)) 0 max(16px, var(--safe-l));
}
.main { min-height: calc(100dvh - var(--header-h) - var(--safe-t)); }
#map { min-height: calc(100dvh - var(--header-h) - var(--safe-t) - 70px); }
.toolbar { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
.filters-bar { padding-left: max(12px, var(--safe-l)); padding-right: max(12px, var(--safe-r)); }
.offline-badge { top: calc(var(--header-h) + var(--safe-t) + 8px); }
/* Hojas/modales: nunca debajo del notch; en horizontal, fuera de las orillas redondeadas */
.modal-overlay { padding: var(--safe-t) var(--safe-r) 0 var(--safe-l); }
.modal { max-height: min(92dvh, calc(100dvh - var(--safe-t) - 8px)); }
@media (min-width: 640px) {
  .modal-overlay { padding: calc(var(--safe-t) + 12px) max(12px, var(--safe-r)) max(12px, var(--safe-b)) max(12px, var(--safe-l)); }
  .modal { max-height: min(90vh, calc(100dvh - var(--safe-t) - var(--safe-b) - 24px)); }
}
.install-banner { left: max(16px, var(--safe-l)); right: max(16px, var(--safe-r)); bottom: calc(20px + var(--safe-b)); }
.toast { bottom: calc(24px + var(--safe-b)); }
@media (max-width: 639px) {
  .toast, .install-banner { bottom: calc(84px + var(--safe-b)); }
}

/* Instalada (standalone) en vertical: si iOS no reporta el inset del notch, reserva al menos 44px */
@media (display-mode: standalone) and (orientation: portrait) and (max-width: 500px) {
  :root { --safe-t: max(env(safe-area-inset-top, 0px), 44px); }
}
@media (display-mode: standalone) { .header { background: var(--bg, #080808); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.header { isolation: isolate; }
.search-wrap { z-index: 2; }
.search-wrap input { position: relative; z-index: 2; pointer-events: auto; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.search-wrap .search-icon { pointer-events: none; z-index: 3; }

/* Textos editables desde el admin (vacíos = ocultos) */
.site-intro { padding: 14px max(16px, var(--safe-l, 0px)) 0; }
.site-intro:not(:has(:not([hidden]))) { display: none; }
.site-intro-title { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 6px; }
.site-intro-text { color: var(--text-muted); max-width: 60ch; margin: 0; }
.footer-note { width: 100%; text-align: center; color: var(--text-muted); font-size: .85rem; margin: 0 0 8px; }
.cat-chip .cat-ico { margin-right: 4px; }
.cat-chip[data-color] { --cat-c: var(--lime); }
.biz-logo { position: absolute; left: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--bg); border: 2px solid var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.biz-card-img { position: relative; }

/* Ficha del taxi (entrada por QR) */
.taxi-card { position: relative; margin: 12px max(16px, var(--safe-l, 0px)) 0; padding: 14px 48px 14px 14px; border: 1px solid var(--lime); border-radius: 16px; background: var(--bg-card, #121212); }
.taxi-top { display: flex; gap: 12px; align-items: center; }
.taxi-ico { font-size: 28px; }
.taxi-top strong { font-family: var(--font-display); font-size: 1.15rem; }
.taxi-plate { font-size: .8rem; padding: 2px 8px; border-radius: 6px; background: var(--lime); color: var(--on-primary, #080808); margin-left: 6px; font-weight: 700; }
.taxi-sub { color: var(--text-muted); font-size: .9rem; }
.taxi-note { margin: 8px 0 0; }
.taxi-routes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; color: var(--text-muted); font-size: .85rem; }
.taxi-route { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); }
.taxi-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-muted); font-size: 24px; }
