/* Laboratorio de diseño · Mapa de Pucón (y el índice del laboratorio).
   Variables --mapa-* del especialista vectorial. Geografía con trazo fijo en px
   (vector-effect: non-scaling-stroke); texto y marcadores en u del viewBox por formato
   (esc = escritorio, baja = escritorio bajo, cel = celular), como definió cartografía v3.
   Rutas activas, marcadores del recorrido y cabeza de trazo: vectorial-v3 (ESTILOS-v3.md). */

@property --pin-anillo { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --poi-pop { syntax: '<number>'; inherits: true; initial-value: 1; }

.pagina-mapa, .mapa-pucon {
  --mapa-papel: #fbf7f3;
  --mapa-tinta: #1f1320;
  --mapa-ciruela: #8a1d6c;
  --mapa-ciruela-profundo: #5c1349;
  --mapa-naranja: #cc6129;
  --mapa-naranja-texto: #9c3f1a;
  --mapa-lavanda: #f4ece6;
  --mapa-agua-relleno: #e3ebed;
  --mapa-agua-borde: #a7bbc1;
  --mapa-rio: #8eaab2;
  --mapa-agua-texto: #4d6a73;
  --mapa-glaciar-borde: #a9bec4;
  --mapa-texto-suave: #6e6069;
  --mapa-texto-medio: #54434f;
  --mapa-linea: rgba(31, 19, 32, .12);
  --mapa-fuente: Inter, system-ui, sans-serif;
  --mapa-salida: cubic-bezier(.22, 1, .36, 1);
  --mapa-transicion: 200ms cubic-bezier(.2, .8, .2, 1);
  --mapa-traza: var(--mapa-naranja-texto);      /* color final de los tramos a pie o en bici (6,3:1) */
  --mapa-cabeza: var(--mapa-naranja);           /* cabeza luminosa, estela y vehículo activo */
  --mapa-pendiente: var(--mapa-texto-suave);    /* marcadores aún no alcanzados */
}

/* ---------- Página ---------- */
.pagina-mapa {
  background: var(--mapa-papel);
  color: var(--mapa-tinta);
  font-family: var(--mapa-fuente);
  padding: clamp(36px, 5vw, 72px) 16px clamp(64px, 8vw, 112px);
  overflow-x: clip;
}
.pagina-mapa__cab { max-width: 1080px; margin: 0 auto clamp(12px, 2vw, 20px); }
.pagina-mapa__eyebrow {
  margin: 0 0 14px; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mapa-naranja-texto);
}
.pagina-mapa__titulo {
  margin: 0; font-size: clamp(2.25rem, 1.3rem + 3.4vw, 3.75rem); font-weight: 800; line-height: 1.02;
  letter-spacing: -.035em; color: var(--mapa-tinta); text-wrap: balance;
}
.pagina-mapa__bajada { margin: 16px 0 0; max-width: 46ch; font-size: 1.0625rem; line-height: 1.55; color: var(--mapa-texto-medio); text-wrap: pretty; }

/* ---------- Hero: el mapa a sangre bajo el menú ---------- */
.pagina-mapa--hero { padding: 0 0 clamp(64px, 8vw, 112px); }
.mapa-pucon {
  --s-f: var(--s-esc, 1); --cab: 66px;
  position: relative; width: 100%; height: calc(100svh - var(--cab)); min-height: 280px; /* el JS lo agranda si el mapa lo pide */
  overflow: hidden; background: var(--mapa-papel); font-family: var(--mapa-fuente);
}
.mapa-pucon[data-formato="baja"] { --s-f: var(--s-baja, 1.35); }
.mapa-pucon[data-formato="cel"] { --s-f: var(--s-cel, 1.3); min-height: 600px; }
/* --zs (mapa.js): al acercar el mapa, pines, marcadores y nombres se compensan en parte. */
.mapa-pucon { --s: calc(var(--s-f) * var(--zs, 1)); }

.mapa-escena { position: absolute; inset: 0; perspective: 1600px; perspective-origin: 50% 100%; }
.mapa-plano { position: absolute; inset: 0; transform-origin: 50% 100%; }

/* Sin JS queda el encuadre fijo de escritorio; el script lo reemplaza antes del primer pintado. */
.mapa {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 3%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 3%, #000 92%, transparent);
  mask-composite: intersect;
}

/* Franja del título: compacta, en una fila, sobre el borde superior del mapa (que sigue debajo). */
.mapa-hero__franja {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 40px;
  padding: 12px clamp(16px, 4vw, 64px) 8px; pointer-events: none;
}
.mapa-hero__franja::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 -28px;
  background: linear-gradient(180deg, rgba(251, 247, 243, .96) 0, rgba(251, 247, 243, .9) calc(100% - 28px), rgba(251, 247, 243, 0) 100%);
}
.mapa-hero__eyebrow { margin: 0 0 4px; font-size: .6875rem; line-height: 1.25; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mapa-naranja-texto); }
.mapa-hero__h1 {
  margin: 0; font-size: clamp(1.75rem, 1rem + 1.5vw, 2.75rem); font-weight: 800; line-height: 1;
  letter-spacing: -.035em; color: var(--mapa-tinta); white-space: nowrap;
}
.mapa-hero__bajada { margin: 0; max-width: 58ch; font-size: .9375rem; line-height: 1.4; color: var(--mapa-texto-medio); text-wrap: pretty; }
@media (max-width: 959px) { .mapa-hero__bajada { flex-basis: 100%; } }
[data-formato="cel"] .mapa-hero__franja { padding: 10px 14px 6px; gap: 4px; }
[data-formato="cel"] .mapa-hero__franja::before { inset: 0 0 -20px; background: linear-gradient(180deg, rgba(251, 247, 243, .96) 0, rgba(251, 247, 243, .9) calc(100% - 20px), rgba(251, 247, 243, 0) 100%); }
[data-formato="cel"] .mapa-hero__eyebrow { margin-bottom: 2px; font-size: .625rem; }
[data-formato="cel"] .mapa-hero__h1 { font-size: 1.625rem; white-space: normal; text-wrap: balance; }
[data-formato="cel"] .mapa-hero__bajada { font-size: .8125rem; line-height: 1.35; }

/* Pie del hero: una fila compacta en el borde inferior; a la derecha queda el botón flotante de WhatsApp. */
.mapa-hero__pie {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 20px;
  padding: 2px calc(clamp(16px, 4vw, 64px) + 72px) 2px clamp(16px, 4vw, 64px);
  background: linear-gradient(rgba(251, 247, 243, 0), rgba(251, 247, 243, .88) 45%);
  pointer-events: none;
}
.mapa-hero__pie a { pointer-events: auto; }
.mapa-leyenda { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 0; padding: 0; list-style: none; font-size: .625rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mapa-texto-suave); }
.mapa-leyenda li { display: inline-flex; align-items: center; gap: 6px; }
.mapa-leyenda svg { color: var(--mapa-ciruela); overflow: visible; flex: none; }
.mapa-hero__bajar {
  justify-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px;
  font-size: .6875rem; font-weight: 600; letter-spacing: .06em; color: var(--mapa-ciruela-profundo); text-decoration: none;
}
.mapa-hero__bajar:hover span { text-decoration: underline; text-underline-offset: 3px; }
.mapa-hero__bajar:focus-visible { outline: 2px solid var(--mapa-ciruela); outline-offset: 2px; border-radius: 6px; }
.mapa-hero__medidas { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: .625rem; color: var(--mapa-texto-suave); }
.mapa-norte { color: var(--mapa-tinta); flex: none; }
.mapa-escala { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mapa-escala__barra { width: var(--escala, 60px); height: 4px; border: 1px solid var(--mapa-tinta); background: linear-gradient(90deg, var(--mapa-tinta) 50%, var(--mapa-papel) 50%); }
.mapa-atribucion { color: #6b5a66; text-decoration: none; white-space: nowrap; }
.mapa-atribucion:hover { text-decoration: underline; }
@media (max-width: 1199px) { .mapa-hero__bajar span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
[data-formato="cel"] .mapa-hero__pie { grid-template-columns: 1fr; padding: 6px 80px 4px 12px; row-gap: 2px; }
[data-formato="cel"] .mapa-leyenda { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: .625rem; justify-content: start; }
[data-formato="cel"] .mapa-hero__bajar { position: absolute; right: 80px; bottom: 0; }
[data-formato="cel"] .mapa-hero__bajar span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Celular: el mapa se desliza con el dedo hacia los lados (dueño, 03-10); el gesto vertical sigue moviendo la página. */
.mapa-deslizar { display: none; }
.mapa-punto.is-fuera.is-fuera-izq { display: none; }
.tiene-activo .mapa-punto.is-fuera { display: none; } /* con un lugar abierto y el mapa acercado, sin indicadores de borde */
[data-formato="cel"].puede-deslizar .mapa-escena { touch-action: pan-y; }
[data-formato="cel"] .mapa-deslizar {
  display: flex; grid-column: 1 / -1; justify-self: center; align-items: center; gap: 6px; margin: 0 0 6px; padding: 5px 12px; /* centrado (auditoría 2, #17) */
  border-radius: 999px; background: rgba(31, 19, 32, .72); color: #fff; font-size: .6875rem; font-weight: 600;
  transition: opacity 300ms ease-out;
}
.mapa-pucon:not(.puede-deslizar) .mapa-deslizar, .ya-deslizo .mapa-deslizar { opacity: 0; }
[data-formato="cel"] .mapa-hero__medidas { grid-column: 1; justify-content: flex-start; gap: 10px; min-height: 28px; }

/* Indicador de borde (celular): un lugar que quedó fuera del encuadre se toca en el borde derecho. */
.mapa-punto__fuera { display: none; }
.mapa-punto.is-fuera {
  left: auto; right: 6px; width: auto; translate: none; z-index: 4;
  display: inline-flex; align-items: center; padding: 0 10px 0 12px; border-radius: 22px;
  background: rgba(251, 247, 243, .94); border: 1px solid rgba(138, 29, 108, .35); box-shadow: 0 6px 16px -8px rgba(31, 19, 32, .35);
}
.mapa-punto.is-fuera .mapa-punto__fuera { display: inline-flex; align-items: center; gap: 4px; font: 700 .6875rem/1 var(--mapa-fuente); letter-spacing: .08em; color: var(--mapa-tinta); }
.mapa-punto.is-fuera svg { color: var(--mapa-ciruela); }
@media (prefers-reduced-motion: no-preference) {
  .mapa-hero__bajar svg { animation: mapa-bajar 2.4s cubic-bezier(.45, 0, .55, 1) 2.5s infinite; }
}
@keyframes mapa-bajar { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(4px); } }
.mapa .f-cel { display: none; }
.mapa .f-baja { display: none; }
[data-formato="baja"] .mapa .f-baja, [data-formato="cel"] .mapa .f-cel { display: inline; }
[data-formato="baja"] .mapa .f-esc, [data-formato="cel"] .mapa .f-esc { display: none; }

/* ---------- Geografía ---------- */
.mapa .papel   { fill: var(--mapa-papel); }
.mapa .agua    { fill: var(--mapa-agua-relleno); stroke: var(--mapa-agua-borde); stroke-width: .75px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa .rio     { fill: none; stroke: var(--mapa-rio); stroke-width: 1.2px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa .glaciar { fill: #fff; fill-opacity: .92; stroke: var(--mapa-glaciar-borde); stroke-width: .75px; stroke-dasharray: 1.5 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mapa .camino  { fill: none; stroke: var(--mapa-tinta); stroke-opacity: .26; stroke-width: 1px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa .camino--principal { stroke-width: 1.5px; stroke-opacity: .3; }
/* Topografía regional: la capa más tenue; se ve el terreno, no se lee como dato. */
.mapa .regional path { fill: none; stroke: #6b5a66; stroke-opacity: .13; stroke-width: .6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* Relieve apilado: cada anillo con un relleno casi invisible (se suman hacia la cumbre) y trazo que se oscurece con la altura. */
.mapa .curva { fill: var(--mapa-ciruela); fill-opacity: .035; stroke: var(--mapa-ciruela); stroke-opacity: var(--o); stroke-width: .6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa .curva--maestra { stroke-width: 1.1px; }
.mapa .curva--sec { stroke-opacity: calc(var(--o) * .75); fill-opacity: .025; }
.mapa .curva-sombra { fill: none; stroke: var(--mapa-ciruela-profundo); stroke-opacity: .12; stroke-width: 1.5px; vector-effect: non-scaling-stroke; transform: translateY(1.5px); }
.mapa [data-cumbre] .curva { transition: stroke-width 600ms var(--mapa-salida), stroke-opacity 600ms var(--mapa-salida); }
.mapa [data-cumbre].is-pulso .curva { stroke-width: 1.8px; stroke-opacity: 1; }

/* ---------- Rutas ---------- */
.mapa .ruta, .mapa .ruta-casing { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa .ruta-casing { stroke: var(--mapa-papel); stroke-width: 4px; stroke-opacity: .85; }
.mapa .ruta { stroke: var(--mapa-ciruela); stroke-opacity: .45; stroke-width: 1.6px; stroke-dasharray: 5 4; transition: stroke-opacity var(--mapa-transicion); }
.mapa .ruta--trekking { stroke-dasharray: none; stroke-width: 1.8px; stroke-opacity: .5; }
.mapa .ruta--mtb { stroke-dasharray: 7 4.5 0 4.5; stroke-width: 1.8px; stroke-opacity: .55; }
.mapa .ruta--ebike { stroke-dasharray: none; stroke-width: 3.4px; stroke-opacity: .45; }
.mapa .ruta-riel { fill: none; stroke: var(--mapa-papel); stroke-width: 1.2px; stroke-linecap: round; stroke-linejoin: round; }
.mapa .ruta-casing--ebike { stroke-width: 6px; }
.mapa-pucon.tiene-activo .ruta { stroke-opacity: .16; }
.mapa-pucon.tiene-activo .ruta.is-activa { stroke-opacity: 0; }

/* Ruta activa: un grupo por tramo. La máscara revela la línea final; encima corren la estela y la cabeza. */
.mapa .ruta-activa { --w: 3; --traza-color: var(--mapa-traza); --traza-dash: none; }
.mapa .ruta-activa[data-modo="vehiculo"] { --w: 2.2; --traza-color: var(--mapa-cabeza); --traza-dash: 6 4.5; }
.mapa .ruta-activa[data-modo="bici"] { --traza-dash: 9 6 0 6; }
.mapa .ruta-activa[data-modo="ebike"] { --w: 5.2; }
.mapa .traza-casing, .mapa .traza-linea, .mapa .traza-riel { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa .traza-casing { stroke: var(--mapa-papel); stroke-opacity: .9; stroke-width: calc((var(--w) + 3.5) * 1px); }
.mapa .traza-linea { stroke: var(--traza-color); stroke-width: calc(var(--w) * 1px); stroke-dasharray: var(--traza-dash); }
.mapa .traza-riel { stroke: var(--mapa-papel); stroke-width: 1.8px; display: none; }
.mapa .ruta-activa[data-modo="ebike"] .traza-riel { display: inline; }
.mapa .revela { fill: none; stroke: #fff; stroke-width: calc(18px * var(--k, 1)); stroke-linecap: butt; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.mapa .estela { fill: none; stroke: var(--mapa-cabeza); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0 2; transition: opacity 700ms ease-out; }
.mapa .estela--larga { stroke-width: calc(var(--w) * var(--k, 1) * 1px); stroke-opacity: .42; }
.mapa .estela--corta { stroke-width: calc((var(--w) + .6) * var(--k, 1) * 1px); stroke-opacity: .9; }
.mapa .estela--brillo { stroke-width: calc((var(--w) + 8) * var(--k, 1) * 1px); stroke-opacity: .14; }
.mapa .cabeza-halo { r: calc(16px * var(--k, 1)); fill: url(#mapa-halo); transition: opacity 700ms ease-out; }
.mapa .cabeza { r: calc(3.4px * var(--k, 1)); fill: #fff; stroke: var(--mapa-cabeza); stroke-width: calc(2.2px * var(--k, 1)); transition: opacity 400ms ease-out; }
.mapa .ruta-activa[data-modo="vehiculo"] .estela, .mapa .ruta-activa[data-modo="vehiculo"] .cabeza-halo { display: none; }
.mapa .ruta-activa[data-modo="vehiculo"] .cabeza { r: calc(4.5px * var(--k, 1)); fill: var(--mapa-cabeza); stroke: #fff; stroke-width: calc(2px * var(--k, 1)); }
.mapa .ruta-activa:not(.is-corriendo) .estela, .mapa .ruta-activa:not(.is-corriendo) .cabeza-halo, .mapa .ruta-activa:not(.is-corriendo) .cabeza { opacity: 0; }
.mapa-pucon.en-sendero .ruta-activa[data-modo="vehiculo"] { opacity: .6; transition: opacity 600ms ease-out; }

/* ---------- Marcadores ---------- */
.mapa .z { transform: translate(calc(var(--ox, 0px) * var(--t)), calc(var(--oy, 0px) * var(--t))); }
.mapa .marca, .mapa .pin { --sc: var(--s); transform: scale(var(--sc)); transform-origin: 0 0; }
.mapa .marca--crater { --sc: calc(var(--s) * 1.3); color: var(--mapa-ciruela-profundo); --crater-fondo: #fff; --crater-lava: var(--mapa-naranja); }
.mapa .marca--volcan { color: var(--mapa-texto-suave); }
.mapa .marca--lanin { --sc: calc(var(--s) * 1.2); color: var(--mapa-texto-medio); }
.mapa-pucon:not([data-formato="esc"]) .pin--crater { display: none; } /* en baja y celular el cráter se toca en su nombre */

/* Marcadores del recorrido: ocultos hasta que su ruta se activa; pendientes en gris, encendidos al pasar la cabeza. */
.mapa .poi, .mapa .etapa {
  --sc: var(--s); color: var(--mapa-pendiente);
  --poi-fondo: var(--mapa-papel); --poi-glifo: currentColor;
  --etapa-fondo: var(--mapa-papel); --etapa-texto: currentColor; --etapa-borde: currentColor;
  transform: scale(calc(var(--sc) * var(--poi-pop))); transform-origin: 0 0;
  opacity: 0; transition: opacity 300ms ease-out, color 200ms;
}
.mapa .poi.is-visible, .mapa .etapa.is-visible { opacity: 1; }
.mapa .poi.is-encendido, .mapa .etapa.is-encendido {
  color: var(--mapa-traza); --poi-fondo: var(--mapa-traza); --poi-glifo: var(--mapa-papel);
  --etapa-fondo: var(--mapa-traza); --etapa-texto: var(--mapa-papel); --etapa-borde: var(--mapa-traza);
}
.mapa .poi--paso circle { fill: var(--poi-fondo); stroke: currentColor; stroke-width: 1.75px; }
@keyframes mapa-encender { 0% { --poi-pop: .7; } 55% { --poi-pop: 1.14; } 100% { --poi-pop: 1; } }
.mapa .marca--partida { color: var(--mapa-ciruela-profundo); }
.mapa .marca-norte { color: var(--mapa-tinta); }

.mapa .pin {
  color: var(--mapa-ciruela); --pin-relleno: var(--mapa-papel);
  transition: transform var(--mapa-transicion), opacity 240ms, color 200ms, --pin-anillo 200ms;
}
.mapa .pin.is-hover { --pin-anillo: 1; transform: scale(calc(var(--s) * 1.16)); }
.mapa .pin.is-activa { color: var(--mapa-naranja); --pin-relleno: var(--mapa-naranja); --pin-nucleo: var(--mapa-papel); --pin-anillo: 0; transform: scale(calc(var(--s) * 1.12)); }
.mapa .pin-insignia { fill: currentColor; stroke: var(--mapa-papel); stroke-width: 1.75px; }
.mapa .pin.is-activa .pin-insignia { fill: var(--mapa-naranja-texto); }
.mapa .pin-insignia-n { fill: var(--mapa-papel); font: 700 9.5px var(--mapa-fuente); }
[data-formato="cel"] .mapa .pin-insignia, [data-formato="cel"] .mapa .pin-insignia-n { display: none; } /* ilegible a esa escala: el número va en la hoja */
.mapa-pucon.tiene-activo .mapa .pin:not(.is-activa) { opacity: .42; }
.mapa-pucon.tiene-activo .mapa .etq--lugar:not(.etq--activa) { opacity: .64; } /* ~4,5:1: se leen aunque no estén activos */

/* ---------- Etiquetas ---------- */
.mapa .etq {
  scale: var(--zs, 1); transform-box: fill-box; transform-origin: 50% 70%;
  font-family: var(--mapa-fuente); font-weight: 700; letter-spacing: .1em; fill: var(--mapa-tinta);
  paint-order: stroke; stroke: var(--mapa-papel); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none;
  transition: fill 200ms, opacity 240ms;
}
[data-formato="cel"] .mapa .etq { stroke-width: 5px; }
.mapa .etq[text-anchor="start"] { transform-origin: 0 70%; }
.mapa .etq[text-anchor="end"] { transform-origin: 100% 70%; }
.mapa .etq--activa { fill: var(--mapa-naranja-texto); }
.mapa .etq--contexto { font-weight: 600; letter-spacing: .16em; fill: var(--mapa-texto-suave); }
.mapa .etq--agua { font-weight: 500; font-style: italic; letter-spacing: .24em; fill: var(--mapa-agua-texto); stroke: var(--mapa-agua-relleno); }
[data-formato="cel"] .mapa .etq--agua { letter-spacing: .12em; }
.mapa .etq--protagonista { font-weight: 800; letter-spacing: .16em; fill: var(--mapa-ciruela-profundo); }
.mapa .etq--partida { font-weight: 800; letter-spacing: .14em; }
.mapa .cota { font-weight: 600; letter-spacing: .08em; font-variant-numeric: tabular-nums; fill: var(--mapa-ciruela-profundo); }
.mapa .etq--lanin, .mapa .cota--lanin { fill: var(--mapa-texto-medio); }
.mapa .etq--lanin { letter-spacing: .16em; }
.mapa .etq--etapa { fill: var(--mapa-traza); letter-spacing: .12em; opacity: 0; }
.mapa-pucon[data-activo="puesco-alto"] .mapa .etq--etapa { opacity: 1; }
.mapa .guia { stroke: var(--mapa-ciruela); stroke-opacity: .7; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.mapa-pucon.tiene-activo .mapa .guia { stroke-opacity: .3; }
/* ---------- Zonas táctiles (botones HTML sobre el SVG) ---------- */
.mapa-punto {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  translate: calc(var(--oxp, 0px) * var(--t)) calc(var(--oyp, 0px) * var(--t));
  margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mapa-punto:focus { outline: none; }
.mapa-punto:focus-visible { outline: 2px solid var(--mapa-ciruela); outline-offset: 2px; }

/* ---------- Ficha del lugar: anclada al pin (escritorio) u hoja inferior (celular) ---------- */
.mapa-ficha {
  position: absolute; z-index: 20; top: 0; left: 0; width: 320px; max-width: calc(100% - 16px);
  padding: 18px 18px 14px; background: #fff; color: var(--mapa-tinta);
  border: 1px solid var(--mapa-linea); border-radius: 14px;
  box-shadow: 0 22px 48px -18px rgba(31, 19, 32, .32), 0 2px 8px rgba(31, 19, 32, .06);
  opacity: 0; transform: translateY(6px) scale(.97); transform-origin: var(--origen, 0 50%);
  transition: opacity 180ms ease-out, transform 260ms var(--mapa-salida);
}
.mapa-ficha.is-abierta { opacity: 1; transform: none; }
.mapa-pucon:not([data-formato="cel"]) .mapa-ficha { max-height: var(--ficha-alto, none); overflow-y: auto; overscroll-behavior: contain; }
.mapa-ficha:focus { outline: none; }
.mapa-ficha:focus-visible { outline: 2px solid var(--mapa-ciruela); outline-offset: 3px; }

[data-formato="cel"] .mapa-ficha {
  position: fixed; top: auto; left: 0 !important; right: 0; bottom: 0; width: auto; max-width: none;
  max-height: 72svh; overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border-width: 1px 0 0;
  box-shadow: 0 -18px 48px -12px rgba(31, 19, 32, .3);
  transform: translateY(100%); opacity: 1; z-index: 120;
  transition: transform 360ms cubic-bezier(.32, .72, 0, 1);
}
[data-formato="cel"] .mapa-ficha::before {
  content: ""; position: absolute; top: 9px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(31, 19, 32, .16);
}
[data-formato="cel"] .mapa-ficha.is-abierta { transform: none; }

/* Tarjeta horizontal (dueño, 03-10): foto, lugar y actividad con su duración, y 3 o 4 datos con ícono. */
.mapa-ficha { display: grid; grid-template-columns: 148px 1fr; width: 580px; padding: 0; overflow: hidden; }
.mapa-ficha[hidden] { display: none; }
.mapa-pucon:not([data-formato="cel"]) .mapa-ficha { overflow-y: auto; }
.mapa-ficha__foto { position: relative; min-height: 100%; background: var(--mapa-lavanda); }
.mapa-ficha__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mapa-ficha__foto--atardecer { background: linear-gradient(160deg, #8a1d6c, #cc6129); }
.mapa-ficha__cuerpo { min-width: 0; padding: 16px 16px 14px 18px; }
.mapa-ficha__cab {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  padding: 0 0 12px; border-bottom: 1px solid var(--mapa-linea); color: inherit; text-decoration: none;
}
.mapa-ficha__cab:focus-visible { outline: 2px solid var(--mapa-ciruela); outline-offset: 2px; border-radius: 6px; }
.mapa-ficha__textos { min-width: 0; display: grid; gap: 2px; }
.mapa-ficha__titulo { font-size: 1.25rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.mapa-ficha__actividad { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .8125rem; font-weight: 600; line-height: 1.25; color: var(--mapa-ciruela); text-wrap: balance; }
.mapa-ficha__duracion {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #f1e6f3; color: var(--mapa-ciruela-profundo); font-size: .8125rem; font-weight: 600; white-space: nowrap;
}
.mapa-ficha__flecha { color: var(--mapa-tinta); transition: transform 200ms var(--mapa-salida); }
.mapa-ficha__cab:hover .mapa-ficha__flecha { transform: translateX(3px); }
.mapa-ficha__datos { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.mapa-ficha__datos li { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 0 6px; text-align: center; font-size: .75rem; line-height: 1.25; color: var(--mapa-texto-suave); }
.mapa-ficha__datos li + li { border-left: 1px solid var(--mapa-linea); }
.mapa-ficha__datos svg { margin-bottom: 4px; color: var(--mapa-naranja-texto); }
.mapa-ficha__datos strong { font-size: .8125rem; font-weight: 700; color: var(--mapa-tinta); text-wrap: balance; hyphens: manual; } /* «Campa-mento»: guion suave en lang/ */
.mapa-ficha__otras { margin: 10px 0 0; font-size: .75rem; color: var(--mapa-texto-suave); }
.mapa-ficha__otras a { color: var(--mapa-ciruela); font-weight: 600; }
.mapa-ficha__cerrar {
  position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .88); color: var(--mapa-tinta); cursor: pointer;
  box-shadow: 0 1px 4px rgba(31, 19, 32, .18);
}
.mapa-ficha__cerrar::after { content: ""; position: absolute; inset: -7px; } /* zona táctil de 44 px */
.mapa-ficha__cerrar:hover { background: #fff; }
.mapa-ficha__cerrar:focus-visible { outline: 2px solid var(--mapa-ciruela); outline-offset: 2px; }

/* Celular: tarjeta flotante abajo, foto chica a la izquierda y los datos en una fila debajo. */
[data-formato="cel"] .mapa-ficha {
  left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 0; max-width: 560px; margin-inline: auto;
  grid-template-columns: 96px 1fr; border-radius: 18px; border-width: 1px;
}
[data-formato="cel"] .mapa-ficha::before { content: none; }
[data-formato="cel"] .mapa-ficha__cuerpo { display: contents; }
[data-formato="cel"] .mapa-ficha__foto { grid-row: 1; min-height: 96px; }
[data-formato="cel"] .mapa-ficha__cab { grid-row: 1; grid-column: 2; gap: 8px; padding: 12px 12px 12px 14px; }
[data-formato="cel"] .mapa-ficha__titulo { font-size: 1.0625rem; }
[data-formato="cel"] .mapa-ficha__duracion { padding: 5px 9px; font-size: .75rem; }
[data-formato="cel"] .mapa-ficha__duracion svg { display: none; }
[data-formato="cel"] .mapa-ficha__datos { grid-column: 1 / -1; margin: 0; padding: 12px 8px; border-top: 1px solid var(--mapa-linea); }
[data-formato="cel"] .mapa-ficha__datos li { padding: 0 4px; font-size: .6875rem; }
[data-formato="cel"] .mapa-ficha__datos svg { width: 22px; height: 22px; }
[data-formato="cel"] .mapa-ficha__datos strong { font-size: .75rem; }
[data-formato="cel"] .mapa-ficha__otras { grid-column: 1 / -1; margin: 0; padding: 0 14px 12px; }
@media (max-width: 360px) { [data-formato="cel"] .mapa-ficha { grid-template-columns: 76px 1fr; } }
/* Con la tarjeta abierta en celular, la leyenda, la brújula y el botón de WhatsApp no asoman bajo ella. */
.mapa-pucon[data-formato="cel"].tiene-activo .mapa-hero__pie { opacity: 0; transition: opacity 200ms; }
body:has(.mapa-pucon[data-formato="cel"].tiene-activo) .whatsapp { opacity: 0; pointer-events: none; transition: opacity 200ms; }

/* Entrada de la tarjeta (dueño, 04-10): sube con un leve rebote y su contenido aparece en cascada
   (foto, títulos, datos uno a uno). Al cerrar, todo sale junto y rápido. */
.mapa-ficha {
  --rebote: cubic-bezier(.2, 1.18, .32, 1);
  transform: translateY(14px) scale(.96);
  transition: opacity 220ms ease-out, transform 480ms var(--rebote);
}
.mapa-ficha:not(.is-abierta) { transition-duration: 160ms, 200ms; transition-timing-function: ease-in; }
.mapa-ficha__foto img, .mapa-ficha__cab, .mapa-ficha__datos li, .mapa-ficha__otras, .mapa-ficha__cerrar {
  opacity: 0; transition: opacity 260ms ease-out, transform 520ms var(--mapa-salida);
}
.mapa-ficha__foto img { transform: scale(1.12); }
.mapa-ficha__cab { transform: translateX(12px); }
.mapa-ficha__datos li { transform: translateY(10px); }
.mapa-ficha__cerrar { transform: scale(.6); }
.mapa-ficha.is-abierta :is(.mapa-ficha__foto img, .mapa-ficha__cab, .mapa-ficha__datos li, .mapa-ficha__otras, .mapa-ficha__cerrar) { opacity: 1; transform: none; }
.mapa-ficha.is-abierta .mapa-ficha__foto img { transition-delay: 60ms; transition-duration: 400ms, 900ms; }
.mapa-ficha.is-abierta .mapa-ficha__cab { transition-delay: 110ms; }
.mapa-ficha.is-abierta .mapa-ficha__datos li { transition-delay: calc(170ms + var(--i, 0) * 55ms); }
.mapa-ficha.is-abierta .mapa-ficha__otras { transition-delay: 380ms; }
.mapa-ficha.is-abierta .mapa-ficha__cerrar { transition-delay: 220ms; transition-timing-function: ease-out, var(--rebote); }
.mapa-ficha:not(.is-abierta) :is(.mapa-ficha__foto img, .mapa-ficha__cab, .mapa-ficha__datos li, .mapa-ficha__otras, .mapa-ficha__cerrar) { transition-duration: 120ms; }

/* Celular: entra desde abajo; se arrastra hacia abajo para cerrarla. Con zoom de pellizco, mapa.js la
   lleva al borde inferior de lo que se ve y la reduce en la misma proporción (--vv-*): no crece ni tapa. */
[data-formato="cel"] .mapa-ficha {
  transform: translateY(calc(100% + 24px)); opacity: 1; touch-action: none;
  transition: transform 560ms var(--rebote);
  translate: var(--vv-x, 0) var(--vv-y, 0); scale: var(--vv-s, 1); transform-origin: 0 100%;
}
[data-formato="cel"] .mapa-ficha:not(.is-abierta) { transition: transform 260ms cubic-bezier(.4, 0, 1, 1); }
[data-formato="cel"] .mapa-ficha.is-abierta { transform: translateY(var(--arrastre, 0px)); }
[data-formato="cel"] .mapa-ficha.is-arrastrando { transition: none; }
.mapa-ficha__tirador { display: none; }
[data-formato="cel"] .mapa-ficha__tirador {
  display: block; position: absolute; z-index: 1; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
  border-radius: 2px; background: rgba(31, 19, 32, .18);
}

/* ---------- La misma información, como lista ---------- */
.mapa-lista { max-width: 1112px; margin: clamp(48px, 7vw, 88px) auto 0; padding: 0 16px; scroll-margin-top: 88px; }
.mapa-lista__titulo { margin: 0 0 20px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.mapa-lista__lugares { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 40px; }
.mapa-lista__lugar { padding: 16px 0 20px; border-top: 1px solid var(--mapa-linea); }
.mapa-lista__lugar h3 { margin: 0 0 4px; font-size: .9375rem; font-weight: 700; line-height: 1.35; }
.mapa-lista__trayecto { margin: 0; font-size: .8125rem; line-height: 1.45; color: var(--mapa-texto-suave); }
.mapa-lista__dias { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .8125rem; line-height: 1.45; color: var(--mapa-texto-suave); }
.mapa-lista__dias strong { color: var(--mapa-traza); }
.mapa-lista__lugar ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: .875rem; line-height: 1.4; }
.mapa-lista__lugar a { color: var(--mapa-ciruela); font-weight: 600; text-decoration: none; text-underline-offset: 3px; }
.mapa-lista__lugar a:hover { text-decoration: underline; }
.mapa-lista__lugar li span { display: block; font-size: .75rem; color: var(--mapa-texto-suave); }
.mapa-lista__nota { margin: 16px 0 0; font-size: .75rem; color: var(--mapa-texto-suave); }

/* ---------- Movimiento: entrada del relieve (solo con JS y sin reducir movimiento) ---------- */
@keyframes mapa-plano { from { transform: rotateX(12deg) scale(1.02); opacity: 0; } 30% { opacity: 1; } to { transform: rotateX(4deg) scale(1.02); } }
@keyframes mapa-subir { from { transform: translateY(var(--h)) scale(var(--sc, 1)); } to { transform: scale(var(--sc, 1)); } }
@keyframes mapa-aparecer { from { transform: translateY(var(--h)) scale(var(--sc, 1)); opacity: 0; } to { transform: scale(var(--sc, 1)); opacity: 1; } }
@keyframes mapa-fundir { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .con-js .mapa-plano { transform: rotateX(4deg) scale(1.02); animation: mapa-plano 1200ms var(--mapa-salida) both; }
  .con-js .relieve .sube, .con-js .glaciar.sube, .con-js .marca.sube { animation: mapa-subir 900ms var(--mapa-salida) both; animation-delay: calc(200ms + var(--i, 4) * 45ms); }
  .con-js .marca--crater.sube { animation-delay: 700ms; }
  .con-js .glaciar.sube { animation-delay: 420ms; }
  .con-js .pin.sube, .con-js .etq--lugar.sube { animation: mapa-aparecer 700ms var(--mapa-salida) both; animation-delay: calc(900ms + var(--i, 0) * 55ms); }
  .con-js .etq--lugar.sube { --sc: 1; }
  .con-js .rutas { animation: mapa-fundir 600ms ease-out 800ms both; }
  .mapa .poi.is-encendido, .mapa .etapa.is-encendido { animation: mapa-encender 420ms cubic-bezier(.22, 1, .36, 1); }
  /* Tras la entrada, el hover y el estado activo vuelven a mandar sobre la escala del pin. */
  .mapa-pucon.entro .sube { animation: none; }
  /* Sección de otra página: entra al verse. La pausa la pide mapa.js (.espera) recién cuando puede quitarla:
     si el script no corre, el mapa entra igual en vez de quedar invisible (auditoría, 06-10). */
  .mapa-pucon[data-seccion].espera:not(.en-vista) * { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .mapa-ficha, [data-formato="cel"] .mapa-ficha, .mapa-ficha *, .mapa .pin, .mapa .ruta, .mapa .etq, .mapa .poi, .mapa .etapa { transition: none !important; }
  .mapa .revela { stroke-dashoffset: 0; }
  .mapa .estela, .mapa .cabeza-halo, .mapa .cabeza { display: none; }
}

/* ---------- Índice del laboratorio ---------- */
.pruebas-indice__lista { list-style: none; max-width: 1080px; margin: 36px auto 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.prueba-tarjeta {
  display: grid; grid-template-rows: auto 1fr; height: 100%; border: 1px solid var(--mapa-linea); border-radius: 16px;
  background: #fff; color: var(--mapa-tinta); text-decoration: none; overflow: hidden;
  transition: border-color 200ms, box-shadow 250ms var(--mapa-salida), transform 250ms var(--mapa-salida);
}
.prueba-tarjeta:hover { border-color: rgba(138, 29, 108, .35); box-shadow: 0 18px 40px -22px rgba(31, 19, 32, .35); transform: translateY(-2px); }
.prueba-tarjeta:focus-visible { outline: 2px solid var(--mapa-ciruela); outline-offset: 3px; }
.prueba-tarjeta__mini { display: block; width: 100%; height: auto; padding: 18px 24px 0; color: var(--mapa-ciruela); background: var(--mapa-papel); border-bottom: 1px solid var(--mapa-linea); }
.prueba-tarjeta__texto { display: grid; gap: 6px; padding: 18px 20px 20px; }
.prueba-tarjeta__titulo { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }
.prueba-tarjeta__desc { font-size: .9rem; line-height: 1.5; color: var(--mapa-texto-medio); }
.prueba-tarjeta__abrir { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: .875rem; font-weight: 600; color: var(--mapa-ciruela); }
@media (prefers-reduced-motion: reduce) { .prueba-tarjeta { transition: none; } .prueba-tarjeta:hover { transform: none; } }
.mapa-pucon:not(.con-js) .mapa-punto { display: none; } /* sin JS no abren nada: la lista de abajo tiene todo */

/* ---------- Como sección de otra página (landing): encabezado del sitio arriba y el mapa a sangre ---------- */
.mapa-seccion.pagina-mapa { padding: var(--space-9, 96px) 0 0; } /* el mismo aire que las otras secciones */
.mapa-seccion .sec-head { margin-bottom: clamp(8px, 2vw, 24px); }
@media (max-width: 600px) { .mapa-seccion.pagina-mapa { padding-top: var(--space-7, 56px); } }

/* Portada: el lugar del mapa mientras llega (sitio.js). Alto de una pantalla, como el mapa, para que la
   página no salte; sin JavaScript queda solo el enlace al catálogo (velocidad, 07-10). */
.mapa-diferido:not(.is-cargado) { min-height: min(100vh, 900px); }
.mapa-diferido__sin-js { text-align: center; padding: 24px 16px 48px; }
html:not(.js) .mapa-diferido { min-height: 0; }
