/* Mapa Interactivo — dedicated page styles (extends styles.css tokens) */

.map-page-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.map-page-header .nav-logo { height: 24px; }
.map-back {
  font-weight: 700; font-size: .88rem; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: .35rem;
}
.map-back:hover { color: var(--tjx-blue); }

.map-intro {
  padding: calc(var(--nav-h) + 2.25rem) clamp(1.25rem, 6vw, 5rem) 1.5rem;
  max-width: 1280px; margin-inline: auto;
}
.map-intro h1 { font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; }
.map-intro p { margin-top: .6rem; color: var(--ink-soft); max-width: 52ch; }
.map-intro .data-note { margin-top: 1.1rem; }

/* ---------------- viewport / lens ---------------- */
.map-shell {
  position: relative;
  margin: 0 clamp(1rem, 4vw, 3rem) 3rem;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #EFE9DA;
  height: min(72vh, 680px);
  cursor: grab;
  touch-action: none;
}
.map-shell.is-dragging { cursor: grabbing; }

.map-sheet {
  position: absolute; inset: 0;
}
.map-layer-base, .map-layer-pins {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.map-layer-base img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }

/* The focus zone — a plain guide ring, no distortion/magnification.
   Pins simply grow + pop when they cross into it (see .map-pin.is-near). */
.map-focus-zone {
  position: absolute;
  width: var(--zone-d, 260px); height: var(--zone-d, 260px);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(10,10,20,0.16);
  pointer-events: none;
  z-index: 4;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%) scale(var(--pin-scale, 1));
  transform-origin: 50% 100%;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  z-index: 10;
}
.map-pin-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(10,10,20,0.3);
  transition: border-radius .3s var(--ease-out);
}
.map-pin[data-tipo="zona"] .map-pin-dot { width: 15px; height: 15px; background: var(--tjx-blue); }
.map-pin[data-tipo="punto"] .map-pin-dot { background: var(--tjx-orange); }
.map-pin.is-near .map-pin-dot { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.map-pin-icon { display: block; pointer-events: none; }

/* Zone polygons — drawn in the map editor's Zonas tab. */
.map-zones-svg { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; overflow: visible; }
.map-zone-poly {
  fill-opacity: .22; stroke-width: 2; stroke-opacity: .55;
  cursor: pointer; pointer-events: auto;
  transition: fill-opacity .25s var(--ease-out);
}
.map-zone-poly:hover { fill-opacity: .34; }
.map-pin-label {
  margin-top: .4rem; padding: .25rem .6rem; border-radius: 999px;
  background: #fff; font-size: .72rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 6px 14px rgba(10,10,20,0.14);
  opacity: 0; transform: translateY(-4px) scale(.8);
  transition: opacity .3s var(--ease-out), transform .3s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.map-pin.is-near .map-pin-label { opacity: 1; transform: translateY(0) scale(1); }
.map-pin:hover .map-pin-label { opacity: 1; transform: translateY(0) scale(1); }

.map-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: rgba(10,10,20,0.78); color: #fff; font-size: .8rem; font-weight: 600;
  padding: .55rem 1.05rem; border-radius: 999px; z-index: 6;
  pointer-events: none;
  transition: opacity .4s var(--ease-out);
}
.map-shell.has-moved .map-hint { opacity: 0; }

.map-controls {
  position: absolute; right: 18px; bottom: 18px; z-index: 6;
  display: flex; flex-direction: column; gap: .5rem;
}
.map-control-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: #fff; box-shadow: 0 10px 24px rgba(10,10,20,0.16);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  color: var(--ink);
}
.map-control-btn:hover { color: var(--tjx-blue); }

/* ---------------- inline editor (temporary, on the public page) ---------------- */
.map-edit-toggle {
  position: absolute; left: 18px; bottom: 18px; z-index: 6;
  background: var(--ink); color: #fff; font-weight: 700; font-size: .82rem;
  padding: .65rem 1rem; border-radius: 999px; box-shadow: 0 10px 24px rgba(10,10,20,0.22);
  transition: background .2s var(--ease-out), transform .2s var(--ease-out);
}
.map-edit-toggle:hover { transform: translateY(-2px); }
.map-edit-toggle.is-active { background: var(--tjx-orange); }
.map-shell.is-editing .map-pin { cursor: grab; }
.map-shell.is-editing .map-pin:active { cursor: grabbing; }
.map-shell.is-editing .map-layer-pins { outline: 2px dashed rgba(255,0,161,0.4); outline-offset: -2px; }

.map-edit-panel {
  position: fixed; right: 20px; top: calc(var(--nav-h, 76px) + 20px); z-index: 70;
  width: 240px; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(10,10,20,0.25); padding: 1rem;
  display: flex; flex-direction: column; gap: .8rem;
}
.map-edit-panel[hidden] { display: none; }
.map-edit-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.map-edit-panel-head strong { font-family: var(--display); font-size: 1rem; }
.map-edit-panel-head button { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-soft); font-size: 1rem; }
.map-edit-hint { font-size: .76rem; color: var(--ink-mute); margin: -.3rem 0 0; }
.map-edit-field { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.map-edit-field input[type="range"] { width: 100%; }
.map-edit-save {
  background: var(--tjx-blue); color: #fff; font-weight: 700; font-size: .85rem;
  padding: .6rem; border-radius: 10px; text-align: center;
}
.map-edit-saved { font-size: .74rem; color: #2fae63; margin: 0; }

/* ---------------- place sheet ---------------- */
.place-sheet-scrim {
  position: fixed; inset: 0; background: rgba(10,10,20,0.38); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease-out);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .place-sheet-scrim { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
}
.place-sheet-scrim.is-open { opacity: 1; pointer-events: auto; }

/* Liquid Glass panel — v2, per Rodrigo's correction (2026-09-29): the
   effect isn't the tint, it's the SHAPE. A flush edge-to-edge sidebar
   reads as a docked panel, not glass. Real Liquid Glass floats as an
   inset card — rounded on all four corners, a soft ambient shadow all
   around (not just to one side), a multi-tone gradient (not a flat
   tint), and small specular "glint" highlights hugging the rounded
   corners where light would catch a real curved edge. Static blur only
   (never animated — see perf notes above); transform+opacity move.
   Solid fallback first for browsers/users without backdrop-filter. */
.place-sheet {
  position: fixed; top: 2.2vh; right: 2.2vh; bottom: 2.2vh; z-index: 61;
  width: min(420px, calc(100vw - 4.4vh));
  border-radius: 32px;
  background: rgba(255,255,255,0.96); /* rung 1: solid, always legible */
  box-shadow: 0 24px 70px rgba(10,10,20,0.35), 0 4px 18px rgba(10,10,20,0.18);
  transform: translateX(calc(100% + 6vh)) scale(.96);
  opacity: 0;
  transition: transform .6s cubic-bezier(.22,1,.36,1), opacity .4s var(--ease-out);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .place-sheet {
    background:
      radial-gradient(120% 90% at 0% 0%, rgba(90,129,255,0.16), transparent 55%),
      radial-gradient(110% 90% at 100% 100%, rgba(224,98,60,0.12), transparent 55%),
      rgba(255,255,255,0.68); /* rung 2: liquid glass, multi-tone */
    backdrop-filter: blur(30px) saturate(190%);
    -webkit-backdrop-filter: blur(30px) saturate(190%);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.7),
      0 24px 70px rgba(10,10,20,0.32), 0 4px 18px rgba(10,10,20,0.18);
  }
}
/* Specular glints — soft light catching the rounded corners, the detail
   that actually reads as "glass" instead of "blurred panel". Sits behind
   the real content (painted first) so text/photos stay on top. */
.place-sheet::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(90px 70px at 10% 4%, rgba(255,255,255,0.85), transparent 70%),
    radial-gradient(70px 110px at 100% 18%, rgba(255,255,255,0.5), transparent 70%),
    radial-gradient(80px 60px at 6% 96%, rgba(255,255,255,0.3), transparent 70%);
  mix-blend-mode: screen;
  opacity: .9;
  pointer-events: none;
}
.place-sheet.is-open { transform: translateX(0) scale(1); opacity: 1; }
@media (prefers-reduced-transparency: reduce) {
  .place-sheet { background: rgba(255,255,255,0.97) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .place-sheet::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .place-sheet { transition: transform .01s linear, opacity .2s linear; }
}
@media (max-width: 640px) {
  .place-sheet { top: 1.4vh; right: 1.4vh; bottom: 1.4vh; border-radius: 26px; }
}

.place-sheet-close {
  position: absolute; top: 1.1rem; right: 1.1rem; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); box-shadow: 0 6px 16px rgba(10,10,20,0.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .place-sheet-close {
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.55);
  }
}

.place-sheet-photos {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  aspect-ratio: 4/3; background: var(--bg-soft);
}
.place-sheet-photos .photo-slide {
  flex: 0 0 100%; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: .95rem; color: #fff;
  text-align: center; padding: 1rem;
}
.photo-slide--img { padding: 0; }
.photo-slide--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* A touch of solid backing behind the text column itself — glass looks
   right on the photo/header, but paragraphs need guaranteed contrast
   regardless of what color is blurred underneath (zone color varies). */
.place-sheet-body {
  padding: 1.5rem; display: flex; flex-direction: column; gap: 1.3rem;
  background: rgba(255,255,255,0.4);
}
.place-sheet-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tjx-orange); }
.place-sheet-title { font-family: var(--display); font-weight: 700; font-size: 1.5rem; }
.place-sheet-ficha { color: var(--ink-soft); font-size: .95rem; }

/* "iPhone Music"-style row: square album-art tile (brand-color gradient +
   music-note glyph — no real cover art, avoids using copyrighted album
   covers), title/artist stacked, circular play button on the right. */
.place-song {
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem .8rem; border-radius: 14px; background: var(--bg-soft);
  border: 1px solid transparent;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .place-song {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-color: rgba(255,255,255,0.6);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  }
}
.place-song-art {
  width: 46px; height: 46px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(10,10,20,0.18);
}
.place-song-note { width: 20px; height: 20px; color: rgba(255,255,255,0.92); }
.place-song-meta { flex: 1; min-width: 0; }
.place-song-meta strong { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-song-meta span { font-size: .8rem; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.place-song-play {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  font-size: .68rem; padding-left: 2px;
  transition: transform .2s var(--ease-out, ease);
}
.place-song-play:hover { transform: scale(1.08); }

.place-comments h3 { font-family: var(--display); font-size: 1.05rem; margin-bottom: .8rem; }
.comment-item { padding: .75rem 0; border-top: 1px solid var(--line); font-size: .88rem; }
.comment-item strong { display: block; margin-bottom: .2rem; }
.comment-item span { color: var(--ink-mute); font-size: .76rem; }
.comment-empty { font-size: .85rem; color: var(--ink-mute); padding: .5rem 0; }

.comment-form { display: flex; gap: .5rem; margin-top: .9rem; }
.comment-form input {
  flex: 1; padding: .7rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  font: inherit; font-size: .85rem;
}
.comment-form button {
  padding: .7rem 1.1rem; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: .85rem;
}

/* ---------------- zone sheet — "liquid glass" ----------------
   Tune the effect globally with these two variables: --glass-blur is
   the frost strength (px), --glass-tint is how much of the zone's own
   color shows through the gradient (0-1). Everything else derives from
   them, so "change the level" is a one-line edit here. */
:root {
  --glass-blur: 26px;
  --glass-tint: .55;
}
.place-sheet--zone {
  /* solid fallback first, for browsers without backdrop-filter/color-mix */
  background: rgba(255,255,255,0.92);
}
.place-sheet--zone {
  /* multi-tone: zone color at top-left, a second warm tone at bottom-right,
     white in between — a flat single tint reads as a wash, not glass. */
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--zone-color, var(--tjx-blue)) calc(var(--glass-tint) * 100%), white) 0%,
    rgba(255,255,255,0.55) 45%,
    color-mix(in srgb, var(--zone-color, var(--tjx-blue)) 25%, white) 100%);
  border: 1px solid rgba(255,255,255,0.6);
}
@supports (backdrop-filter: blur(1px)) {
  .place-sheet--zone {
    background: linear-gradient(165deg,
      color-mix(in srgb, var(--zone-color, var(--tjx-blue)) calc(var(--glass-tint) * 60%), transparent) 0%,
      rgba(255,255,255,0.5) 45%,
      color-mix(in srgb, var(--zone-color, var(--tjx-blue)) 20%, transparent) 100%);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.7),
      0 24px 70px rgba(10,10,20,0.32), 0 4px 18px rgba(10,10,20,0.18);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .place-sheet--zone { background: rgba(255,255,255,0.97) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
.place-sheet--zone .place-sheet-close { background: rgba(255,255,255,0.75); }
.place-sheet--zone .place-sheet-kicker { color: var(--zone-color, var(--tjx-orange)); }
.place-sheet--zone .place-sheet-body { background: rgba(255,255,255,0.5); }

.zone-sheet-cover { aspect-ratio: 16/10; background: var(--bg-soft); overflow: hidden; }
.zone-sheet-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zone-cover-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: #fff; text-align: center; padding: 1rem;
}

.zone-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.zone-media-col h3 { font-family: var(--display); font-size: .92rem; margin-bottom: .6rem; }
.zone-photos { display: flex; flex-direction: column; gap: .5rem; }
.zone-photo-tile {
  aspect-ratio: 4/3; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .74rem; font-weight: 600; text-align: center; padding: .5rem;
  overflow: hidden;
}
.zone-photo-tile--img { padding: 0; }
.zone-photo-tile--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zone-playlist { display: flex; flex-direction: column; gap: .5rem; }
.place-song--compact { padding: .5rem .6rem; gap: .6rem; background: rgba(255,255,255,0.55); }
.place-song--compact .place-song-art { width: 36px; height: 36px; border-radius: 7px; }
.place-song--compact .place-song-note { width: 16px; height: 16px; }
.place-song--compact .place-song-play { width: 28px; height: 28px; font-size: .62rem; }
.place-song--compact .place-song-meta strong { font-size: .8rem; }
.place-song--compact .place-song-meta span { font-size: .72rem; }

@media (max-width: 640px) {
  .map-shell { height: 62vh; border-radius: 16px; margin-inline: .75rem; }
  .map-focus-zone { --zone-d: 220px; }
  .place-sheet { width: calc(100vw - 2.8vh); }
  .zone-media-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   V4 — mapa real (MapLibre). Reemplaza el comportamiento de la foto de
   fondo; los estilos viejos de .map-pin / .map-focus-zone ya no se usan.
   ===================================================================== */
.map-shell { cursor: auto; touch-action: auto; background: #FFF9EF; height: min(80vh, 780px); }
#real-map { position: absolute; inset: 0; }
.map-fallback { padding: 2rem; color: var(--ink-soft); }
.map-shell .maplibregl-ctrl-bottom-right { bottom: 56px; }

/* Pines (NO poner position en .real-pin: el marcador de MapLibre ya es position:absolute y es el ancla de la etiqueta). El tamaño/recorte los pone mapa.js; aquí solo apariencia.
   OJO: MapLibre mueve el marcador con `transform`, así que NUNCA se anima ni se
   escala `transform` del pin ni se cambia su tamaño al pasar el cursor
   (eso era lo que los hacía "moverse raro"). El hover solo toca brillo/sombra. */
.real-pin { cursor: pointer; user-select: none; -webkit-user-drag: none; transition: filter .2s ease; }
.real-pin-art { position: relative; overflow: hidden; }
.real-pin-art img { position: absolute; max-width: none; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.real-pin:hover { filter: brightness(1.08); }
.maplibregl-marker:hover { z-index: 5; }
.real-pin-label {
  position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%);
  white-space: nowrap; font-size: .72rem; font-weight: 700; color: var(--ink);
  padding: .25rem .6rem; border-radius: 999px; pointer-events: none;
  background: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 6px 16px rgba(10,10,20,0.18);
  opacity: 0; transition: opacity .2s ease;
}
.real-pin:hover .real-pin-label, .real-pin.is-selected .real-pin-label { opacity: 1; }
.map-shell.is-editing .real-pin { cursor: grab; }
.real-pin.is-selected .real-pin-art { outline: 3px dashed var(--tjx-orange); outline-offset: 4px; border-radius: 6px; }

.zone-chip {
  pointer-events: none; font-family: var(--display); font-weight: 700; font-size: .85rem;
  padding: .3rem .8rem; border-radius: 999px; color: var(--ink);
  background: rgba(255,255,255,0.78); border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 6px 18px rgba(10,10,20,0.15);
}
@supports (backdrop-filter: blur(1px)) {
  .zone-chip { backdrop-filter: blur(10px) saturate(170%); -webkit-backdrop-filter: blur(10px) saturate(170%); }
}
.is-dark-map .zone-chip { background: rgba(20,26,50,0.8); color: #DCE6FF; border-color: rgba(255,255,255,0.15); }

/* Panel del editor (más ancho y con scroll) */
.map-edit-panel { width: 300px; max-height: calc(100vh - var(--nav-h, 76px) - 40px); overflow-y: auto; }
.map-edit-field { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; align-items: center; }
.map-edit-field input[type="range"], .map-edit-field select { grid-column: 1 / -1; }
.map-edit-field output { font-weight: 700; color: var(--ink); font-size: .74rem; }
.map-edit-field select { padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); font: inherit; font-size: .82rem; background: #fff; }
.map-edit-sub { font-size: .74rem; font-weight: 700; color: var(--ink-soft); margin: .2rem 0 0; }
.map-edit-selected, .map-edit-panel > div[data-edit-unplaced-wrap] { display: flex; flex-direction: column; gap: .6rem; }
.map-edit-selected[hidden], [data-edit-unplaced-wrap][hidden] { display: none; }
.map-edit-crop { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; }
.map-edit-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.map-edit-chip { padding: .35rem .7rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--tjx-blue); color: #fff; }
.map-edit-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.map-edit-row .map-edit-save { flex: 1; }
.map-edit-ghost { padding: .55rem .8rem; border-radius: 10px; font-size: .78rem; font-weight: 700; background: var(--bg-soft); color: var(--ink); }
.map-edit-ghost:hover { background: rgba(10,10,20,0.1); }
.map-edit-msg { font-size: .74rem; color: var(--ink-soft); margin: 0; min-height: 1em; }

/* =====================================================================
   V5 — vista ordenada (tope del zoom out), buscador, zonas editables, biblioteca de íconos
   ===================================================================== */
#real-map { transition: filter .55s ease; }
.real-pin { transition: filter .2s ease, opacity .35s ease; }
.zone-chip { transition: opacity .35s ease; }

/* Al alejarse hasta el tope: el mapa se desenfoca y los íconos pasan a filas ordenadas */
.map-shell.is-overview #real-map { filter: blur(7px) saturate(.85) brightness(1.04); }
.map-shell.is-overview .real-pin, .map-shell.is-overview .zone-chip { opacity: 0; pointer-events: none; }
.map-overview {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  padding: clamp(16px, 4vh, 36px) clamp(12px, 3vw, 36px);
  pointer-events: none; opacity: 0; visibility: hidden;
  background: linear-gradient(180deg, rgba(255,249,239,.38) 0%, rgba(255,249,239,.10) 45%, rgba(255,249,239,.38) 100%);
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.map-shell.is-overview .map-overview { opacity: 1; visibility: visible; transition-delay: 0s; }
.map-overview-band { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.map-overview-title {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); padding: .3rem .9rem; border-radius: 999px;
  background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 6px 18px rgba(10,10,20,.12);
}
.map-overview-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: .8rem 1.2rem; max-width: 1100px; }
.ov-item {
  pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: .35rem;
  min-width: 84px; max-width: 120px; background: none; border: 0; padding: .2rem; cursor: pointer;
  transition: transform .25s ease;
}
.map-shell.is-overview .ov-item { pointer-events: auto; }
.ov-item:hover, .ov-item:focus-visible { transform: translateY(-5px); outline: none; }
.ov-art { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; }
.ov-art .real-pin-art { flex: none; }
.ov-badge {
  border-radius: 50%; color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  border: 3px solid rgba(255,255,255,.95); box-shadow: 0 10px 24px rgba(10,10,20,.25);
}
.ov-label {
  font-size: .72rem; font-weight: 700; color: var(--ink); text-align: center; line-height: 1.2;
  padding: .22rem .6rem; border-radius: 999px; background: rgba(255,255,255,.85); box-shadow: 0 6px 16px rgba(10,10,20,.15);
}
@media (max-width: 640px) { .ov-art { width: 60px; height: 60px; } .ov-item { min-width: 70px; } .map-overview-row { gap: .5rem .8rem; } }
@media (prefers-reduced-motion: reduce) { #real-map, .map-overview, .ov-item { transition: none; } }

/* Etiqueta de zona con ícono */
.zone-chip { display: inline-flex; align-items: center; gap: .45rem; }
.zone-chip-art { flex: none; }
.zone-chip-label { white-space: nowrap; }

/* Vértices de zona (modo edición) y resultado de búsqueda */
.zone-handle {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #0066FF;
  box-shadow: 0 2px 8px rgba(10,10,20,.35); cursor: grab;
}
.zone-handle:active { cursor: grabbing; }
.zone-handle--mid { width: 11px; height: 11px; border-width: 2px; opacity: .65; cursor: copy; }
.zone-handle--mid:hover { opacity: 1; }
.search-dot {
  width: 18px; height: 18px; border-radius: 50%; background: #FF00A1; border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(255,0,161,.55); animation: search-pulse 1.6s ease-out infinite; pointer-events: none;
}
@keyframes search-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,0,161,.55); } 100% { box-shadow: 0 0 0 22px rgba(255,0,161,0); } }

/* Panel del editor: secciones nuevas */
.map-edit-panel { width: 330px; }
.map-edit-sec { display: flex; flex-direction: column; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.map-edit-selected { padding-top: .6rem; border-top: 1px solid var(--line); }
.map-edit-selected[hidden], .map-edit-sec[hidden] { display: none; }
.map-edit-search { display: flex; gap: .4rem; }
.map-edit-search input, .map-edit-field--block input[type="text"], .map-edit-field--block textarea {
  width: 100%; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); font: inherit; font-size: .82rem; background: #fff; color: var(--ink);
}
.map-edit-search input { flex: 1; min-width: 0; }
.map-edit-search .map-edit-save { padding: .5rem .8rem; }
.map-edit-field--block { display: flex; flex-direction: column; gap: .3rem; }
.map-edit-field--block input[type="color"] { width: 100%; height: 34px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.map-edit-field--block textarea { resize: vertical; }
.ed-results { display: flex; flex-direction: column; gap: .5rem; max-height: 240px; overflow-y: auto; }
.ed-result { padding: .55rem .65rem; border-radius: 12px; background: var(--bg-soft); }
.ed-result-name { font-weight: 700; font-size: .84rem; color: var(--ink); }
.ed-result-sub { font-size: .7rem; color: var(--ink-soft); margin: .1rem 0 .4rem; }
.ed-result-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.ed-result-actions button { padding: .28rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 700; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.ed-result-actions button:hover { background: var(--tjx-blue); color: #fff; border-color: var(--tjx-blue); }
.map-edit-chip--zone { background: var(--c, #5A81FF); }
.map-edit-chip--zone.is-on { outline: 3px solid var(--ink); outline-offset: 1px; }
.ed-icons { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.ed-icon-wrap { position: relative; }
.ed-icon { width: 100%; aspect-ratio: 1; border-radius: 10px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; padding: 4px; border: 2px solid transparent; }
.ed-icon:hover { border-color: var(--tjx-blue); }
.ed-icon img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.ed-icon-del { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; line-height: 18px; text-align: center; cursor: pointer; }
.map-edit-uploadbtn { display: block; text-align: center; cursor: pointer; background: var(--tjx-blue); color: #fff; }
.map-edit-uploadbtn:hover { background: var(--tjx-blue); filter: brightness(1.1); }
.map-edit-danger { color: #c0392b; }
.map-edit-danger[hidden] { display: none; }
.ed-zone-icon { width: 54px; height: 54px; border-radius: 12px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: .66rem; color: var(--ink-soft); text-align: center; }
.ed-zone-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.map-edit-field--block { align-items: stretch; text-align: left; }
.map-edit-field--block input, .map-edit-field--block textarea { grid-column: auto; }

/* Vista ordenada adaptable: mapa.js fija --ov-art y --ov-font según cuántos íconos hay */
.ov-art { width: var(--ov-art, 76px); height: var(--ov-art, 76px); }
.ov-label { font-size: var(--ov-font, .72rem); }
.ov-badge { font-size: calc(var(--ov-art, 76px) * .3); }
.ov-item { min-width: calc(var(--ov-art, 76px) + 8px); max-width: calc(var(--ov-art, 76px) + 44px); }
.map-overview { gap: .6rem; padding-top: clamp(10px, 2.5vh, 28px); padding-bottom: clamp(10px, 2.5vh, 28px); }
.map-overview-row { gap: .5rem 1rem; }

/* Profundidad: mapa.js pone z-index según la posición vertical en pantalla; al pasar el cursor o seleccionar, el ícono sube al frente */
.maplibregl-marker:hover { z-index: 100000 !important; }
.real-pin.is-selected { z-index: 99999 !important; }
.zone-chip { z-index: 1; }

/* El mapa es su propio contexto de apilamiento: los z-index de los pines (por profundidad) nunca salen de aquí,
   así que la ficha, el fondo oscuro, el menú y el editor siempre quedan POR ENCIMA de cualquier pin. */
.map-shell { isolation: isolate; z-index: 0; }

/* Vista ordenada: «Más lugares» en pequeño (sin etiqueta fija; el nombre aparece al pasar el cursor) */
.map-overview-row--mini { gap: 4px; max-width: 1180px; }
.ov-item--mini { min-width: 0; max-width: none; padding: 1px; position: relative; }
.ov-item--mini .ov-art { width: var(--ov-mini, 36px); height: var(--ov-mini, 36px); }
.ov-item--mini .ov-label { display: none; }
.ov-item--mini:hover, .ov-item--mini:focus-visible { transform: translateY(-3px) scale(1.15); z-index: 3; }
.ov-item--mini:hover .ov-label, .ov-item--mini:focus-visible .ov-label {
  display: block; position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  white-space: nowrap; font-size: .7rem; z-index: 5; pointer-events: none;
}
.map-overview { overflow: hidden; }

.map-overview-row--mini { gap: 2px 3px; }


/* =====================================================================
   V6 — vista general con filas deslizables + buscador público + orden de principales
   ===================================================================== */
.map-overview { justify-content: center; gap: 1.1rem; padding-left: 0; padding-right: 0; }
.map-overview-band { width: 100%; align-items: stretch; }
.map-overview-title { align-self: center; }
.ov-scroll { position: relative; width: 100%; }
.map-overview-row {
  display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; gap: .4rem 1.1rem; max-width: none;
  overflow-x: auto; overflow-y: hidden; padding: 6px clamp(40px, 6vw, 72px) 12px;
  scroll-snap-type: x proximity; scrollbar-width: thin; overscroll-behavior-x: contain; touch-action: pan-x;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}
.map-shell.is-overview .map-overview-row { pointer-events: auto; }
.map-overview-row .ov-item { flex: 0 0 auto; scroll-snap-align: start; }
.ov-item.is-featured .ov-label { box-shadow: 0 6px 16px rgba(10,10,20,.15), inset 0 0 0 1.5px rgba(255,197,51,.95); }
.ov-arrow {
  position: absolute; top: 28%; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; pointer-events: none;
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 1.6rem; line-height: 1; padding-bottom: 3px;
  box-shadow: 0 8px 22px rgba(10,10,20,.22); opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.ov-arrow--l { left: 8px; } .ov-arrow--r { right: 8px; }
.map-shell.is-overview .ov-arrow { pointer-events: auto; opacity: 1; }
.map-shell.is-overview .ov-arrow.is-off { opacity: 0; pointer-events: none; }
.ov-arrow:hover { transform: scale(1.08); }
@media (hover: none) { .ov-arrow { display: none; } }

/* Buscador público */
.map-search { position: relative; z-index: 20; max-width: 680px; margin: 0 auto 1.1rem; padding: 0 clamp(1rem, 4vw, 3rem); }
.map-search-box {
  display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem .35rem 1rem; border-radius: 999px;
  background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 14px 36px rgba(10,10,20,.14), inset 0 1px 0 rgba(255,255,255,.9);
}
@supports (backdrop-filter: blur(1px)) { .map-search-box { backdrop-filter: blur(16px) saturate(170%); -webkit-backdrop-filter: blur(16px) saturate(170%); } }
.map-search-box:focus-within { box-shadow: 0 14px 36px rgba(10,10,20,.18), 0 0 0 3px rgba(0,102,255,.35); }
.map-search-ico { font-size: 1.35rem; color: var(--ink-soft); transform: translateY(-1px); }
.map-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; padding: .7rem .4rem; color: var(--ink); }
.map-search-results {
  position: absolute; left: clamp(1rem, 4vw, 3rem); right: clamp(1rem, 4vw, 3rem); top: calc(100% + 8px); margin: 0; padding: .4rem; list-style: none;
  max-height: min(60vh, 420px); overflow-y: auto; border-radius: 22px; background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.95); box-shadow: 0 24px 60px rgba(10,10,20,.25);
}
.map-search-results[hidden] { display: none; }
.map-search-results li { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 14px; cursor: pointer; }
.map-search-results li[data-ms-i]:hover, .map-search-results li.is-active { background: rgba(0,102,255,.1); }
.ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ms-main strong { font-size: .95rem; color: var(--ink); }
.ms-also { font-size: .74rem; color: var(--ink-soft); }
.ms-tag { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.ms-dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.ms-dot--pin { background: var(--tjx-orange, #E0623C); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.ms-empty, .ms-head { cursor: default !important; font-size: .82rem; color: var(--ink-soft); }
.ms-head { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .68rem; }

/* Editor: orden de principales */
.map-edit-tabs { display: flex; gap: .4rem; }
.map-edit-tabs button { flex: 1; padding: .45rem .6rem; border-radius: 10px; font-size: .78rem; font-weight: 700; background: var(--bg-soft); color: var(--ink); }
.map-edit-tabs button.is-on { background: var(--tjx-blue); color: #fff; }
.map-edit-filter { width: 100%; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); font: inherit; font-size: .8rem; background: #fff; }
.ed-order { display: flex; flex-direction: column; gap: .25rem; max-height: 300px; overflow-y: auto; }
.ed-ord-row { display: flex; align-items: center; gap: .35rem; padding: .2rem .3rem; border-radius: 8px; background: var(--bg-soft); }
.ed-ord-name { flex: 1; min-width: 0; font-size: .76rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-ord-row button { width: 26px; height: 26px; border-radius: 8px; font-size: .78rem; background: #fff; color: var(--ink); border: 1px solid var(--line); flex: none; }
.ed-ord-row button:disabled { opacity: .3; cursor: default; }
.ed-ord-star { font-size: 1rem !important; color: #b9b9c4 !important; }
.ed-ord-star.is-on { color: #FFB636 !important; }
.ed-ord-more summary { cursor: pointer; font-size: .74rem; font-weight: 700; color: var(--ink-soft); padding: .3rem 0; }
