/* Capa de interfaz flotando sobre el mapa: barra arriba, botones abajo (pulgar). */
:root {
  --ink: #14322b;        /* verde oscuro: texto y botones */
  --paper: #fbfaf5;      /* fondo de botones */
  --accent: #e8590c;     /* naranja: acción principal y avatar */
  --accent-ink: #ffffff;
  --muted: #5c6f68;
  --shadow: 0 6px 20px rgba(20, 50, 43, .18);
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--body); color: var(--ink); background: #e9eee8; overflow: hidden; }

#map { position: fixed; inset: 0; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.brand {
  display: inline-flex; flex-direction: column; gap: 1px;
  background: var(--paper); border-radius: 14px; padding: 8px 14px;
  box-shadow: var(--shadow); pointer-events: auto;
}
.brand-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.brand-zone { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 28px) max(16px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.btn {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px/1 var(--body); color: var(--ink);
  background: var(--paper); border: 0; border-radius: 999px;
  padding: 12px 16px; min-height: 44px; box-shadow: var(--shadow); cursor: pointer;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn[aria-pressed="false"] { opacity: .7; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn.is-active { background: var(--ink); color: var(--paper); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 3;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  max-width: min(92vw, 420px);
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.35;
  box-shadow: var(--shadow);
}

/* Avatar del usuario */
.avatar { width: 56px; height: 72px; position: relative; pointer-events: none; }
.avatar-ring {
  position: absolute; left: 50%; bottom: 0; width: 44px; height: 16px;
  transform: translateX(-50%); border-radius: 50%;
  border: 2px solid var(--accent); opacity: .7;
  animation: pulse 2s ease-out infinite;
}
.avatar-body { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; }
.avatar-body svg { width: 40px; height: 60px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.avatar-arrow {
  position: absolute; left: 50%; bottom: -10px; width: 0; height: 0;
  margin-left: -6px; border: 6px solid transparent; border-bottom: 9px solid var(--ink);
  transform-origin: 6px 14px; opacity: 0;
}
.avatar.has-heading .avatar-arrow { opacity: .9; }

@keyframes pulse {
  0% { transform: translateX(-50%) scale(.6); opacity: .9; }
  100% { transform: translateX(-50%) scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .avatar-ring { animation: none; } }

.maplibregl-ctrl-bottom-right { margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); }

/* Leyenda */
.topbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.leyenda {
  list-style: none; margin: 0; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 12px;
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow);
  font-size: 13px; pointer-events: auto;
}
.leyenda li { display: inline-flex; align-items: center; gap: 6px; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; }

/* Ficha del restaurante */
.ficha-popup .maplibregl-popup-content {
  border-radius: 14px; padding: 14px 16px 12px; box-shadow: var(--shadow);
  font-family: var(--body); color: var(--ink);
}
.ficha-popup .maplibregl-popup-close-button { font-size: 20px; padding: 2px 8px; color: var(--muted); }
.ficha-tipo {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--c);
  padding-right: 18px;
}
.ficha-nombre { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.15; margin: 4px 0 8px; text-wrap: balance; }
.ficha-dato { margin: 0 0 4px; font-size: 14px; line-height: 1.4; }
.ficha-dato a { color: var(--accent); font-weight: 600; }
.ficha-falta { color: var(--muted); font-style: italic; }
.ficha-estado { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid #e6e2d6; font-size: 12px; color: var(--muted); }
