/* Plano interactivo (escena de entrada + mapa de parcelas). Lo usan masterplan.html y la landing.
   Usa los tokens de color de base.css o landing.css. */
/* ---------- escena: entrada y plano en el mismo lugar ---------- */
.escena { position: relative; height: 260vh; background: var(--plano-fondo, var(--claro)); }
.ancla { position: absolute; left: 0; bottom: 0; width: 1px; height: 100vh; height: 100svh; pointer-events: none; }
.nube { position: absolute; top: -20%; width: 120%; height: 140%; object-fit: cover; pointer-events: none; will-change: transform, opacity; opacity: .9; z-index: 4;
  -webkit-mask-image: linear-gradient(90deg, #0000, #000 22%, #000 78%, #0000); mask-image: linear-gradient(90deg, #0000, #000 22%, #000 78%, #0000); }
.nube--izq { left: -55%; }
.nube--der { right: -55%; transform: scaleX(-1); }
.entrada__txt { position: absolute; inset: 0; z-index: 5; pointer-events: none; display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px;
  background: radial-gradient(ellipse 38% 30% at 50% 50%, #10181a8c, #10181a00); }
.entrada__txt h1, .entrada__txt h2 { font-size: clamp(48px, 7vw, 108px); }
.entrada__pista { font-size: 15px; color: #fff; max-width: 16em; text-shadow: 0 1px 10px #000c, 0 0 2px #0008; }
/* indicación de deslizar: línea + mano que baja + píldora blanca */
.deslizar { display: grid; justify-items: center; margin-top: 10px; }
.deslizar__linea { width: 1px; height: 64px; background: linear-gradient(#fff0, #ffffffd9); }
.deslizar__mano { width: 44px; height: 44px; margin: -26px 0 12px 16px; color: #fff; filter: drop-shadow(0 2px 6px #0009); animation: mano 1.9s var(--curva) infinite; }
@keyframes mano { 0% { transform: translateY(-10px); opacity: 0; } 18% { opacity: 1; } 70% { transform: translateY(14px); opacity: 1; } 100% { transform: translateY(18px); opacity: 0; } }
.deslizar__txt { background: #fff; color: var(--tinta); font-size: 15px; font-weight: 500; padding: 11px 26px; border-radius: var(--radio-boton); box-shadow: 0 8px 24px -8px #000a; }
.plano.intro .visor, .plano.intro .visor *, .plano.intro .panel, .plano.intro .zoom { pointer-events: none !important; }
.plano.intro { cursor: pointer; }
.plano:not(.intro) .entrada__txt, .plano:not(.intro) .nube { visibility: hidden; }

/* ---------- plano interactivo ---------- */
.plano { color: var(--papel); position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: var(--plano-fondo, var(--claro)); }
.visor { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; }
.visor.libre { touch-action: none; }
.aviso { position: absolute; left: 50%; bottom: 28px; translate: -50% 0; z-index: 4; margin: 0; background: #10181ae6; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 99px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.aviso.visible { opacity: 1; }
.visor.arrastrando { cursor: grabbing; }
.mapa { width: 100%; height: 100%; display: block; }
.mapa__perimetro { fill: none; stroke: #fff; stroke-width: 3; stroke-opacity: .7; }
.capa--caminos path { fill: var(--camino-relleno); fill-rule: evenodd; stroke: var(--camino-borde); stroke-width: 1; vector-effect: non-scaling-stroke; }
.capa--cauces path { fill: none; stroke: var(--cauce); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.capa--cauces path.halo { stroke: var(--cauce-borde); stroke-width: 11; }
/* rótulos de cauces (estilo píldora: punto en círculo + nombre) */
.rotulos { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.rotulo { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; translate: -17px -50%; }
.rotulo__punto { width: 34px; height: 34px; border-radius: 50%; background: #10181aa6; backdrop-filter: blur(6px); display: grid; place-items: center; flex: none; }
.rotulo__punto i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--cauce); }
.rotulo__txt { background: #10181aa6; backdrop-filter: blur(6px); color: #fff; font-size: 14px; font-weight: 500; padding: 8px 16px; border-radius: 99px; white-space: nowrap; }
.rotulos.oculta { display: none; }
.lote { fill: transparent; stroke: #fff; stroke-opacity: .45; stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; transition: stroke-opacity .25s, stroke-width .25s, fill .25s; outline: none; }
@media (hover: hover) and (pointer: fine) { .visor:not(.quieto) .lote:hover { stroke-opacity: 1; stroke-width: 2.5; } }
.lote:focus-visible { stroke-opacity: 1; stroke-width: 2.5; }
.lote.activo { stroke-opacity: 1; stroke-width: 3; fill: #ffffff1f; }
.lote.apagado { pointer-events: none; stroke-opacity: .15; }

/* marcas de estado: punto de color con el número (de lejos, solo el punto) */
.pines { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 99px; background: #101814b3; backdrop-filter: blur(4px); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; translate: -50% -50%; transition: opacity .3s, padding .3s; }
.pin i { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #ffffffd9; }
.pin[data-estado="disponible"] i { background: var(--disponible); box-shadow: 0 0 0 3px var(--disponible-anillo); }
.pin[data-estado="vendida"] i { background: var(--vendida); }
.pin[data-estado="vendida"] { opacity: .8; }
.pin[data-estado="reservada"] i { background: var(--reservada); box-shadow: 0 0 0 2px #fff; }
.pin[data-estado="proxima_etapa"] i { background: transparent; box-shadow: inset 0 0 0 2px var(--proxima); }
.pin[data-estado="proxima_etapa"] { opacity: .75; }
.pin.opaco { opacity: .25; }
.pin[data-estado="bloqueada"] i { background: var(--bloqueada); }
.pin:hover { background: #101814; }
.pin.apagado { opacity: .12; pointer-events: none; }
.pines.lejos .pin, .pines.sin-numeros .pin { padding: 3px; gap: 0; }
.pines.lejos .pin span, .pines.sin-numeros .pin span { display: none; }
.capa.oculta { display: none; }

.globo { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; background: var(--papel); color: var(--tinta); font-size: 12px; padding: 7px 12px; border-radius: var(--radio-boton); white-space: nowrap; box-shadow: 0 8px 24px -8px #0008; transform: translate(-50%, calc(-100% - 14px)); }
.globo b { font-weight: 600; }

.panel { position: absolute; left: var(--margen); top: 76px; z-index: 5; width: 270px; background: #10181ae6; backdrop-filter: blur(10px); padding: 22px; border-radius: var(--radio-caja); display: grid; gap: 16px; }
.panel h2 { font-size: 30px; }
.panel__resumen { font-size: 12px; color: var(--papel-suave); }
.panel__resumen b { color: var(--papel); font-weight: 600; }
.filtros { display: grid; gap: 6px; }
.filtro { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 9px 14px; border: 1px solid #ffffff26; border-radius: var(--radio-boton); text-align: left; transition: opacity .3s, border-color .3s; }
.filtro i { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.filtro[data-estado="disponible"] i { background: var(--disponible); border-radius: 50%; box-shadow: 0 0 0 2px var(--disponible-anillo); }
.filtro[data-estado="vendida"] i { background: var(--vendida); border-radius: 50%; }
.filtro[data-estado="reservada"] i { background: var(--reservada); border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.filtro[data-estado="proxima_etapa"] i { background: transparent; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--proxima); }
.filtro[data-estado="bloqueada"] i { background: repeating-linear-gradient(45deg, var(--bloqueada) 0 2px, transparent 2px 4px); border: 1px solid var(--bloqueada); }
.filtro b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.filtro[aria-pressed="false"] { opacity: .4; }
.filtro:hover { border-color: #ffffff66; }
.capas { display: grid; gap: 8px; font-size: 12px; color: var(--papel-suave); border-top: 1px solid #ffffff1f; padding-top: 14px; }
.capas label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.capas input { accent-color: var(--acento); width: 15px; height: 15px; }

.zoom { position: absolute; right: var(--margen); bottom: var(--margen); z-index: 5; display: grid; gap: 4px; }
.zoom button { width: 40px; height: 40px; border-radius: 50%; background: #10181ae6; font-size: 18px; transition: background-color .3s; }
.zoom button:hover { background: #26343a; }

.ficha { position: absolute; right: var(--margen); top: 76px; z-index: 6; width: 300px; background: var(--papel); color: var(--tinta); padding: 24px; border-radius: var(--radio-caja); display: grid; gap: 14px; box-shadow: 0 24px 60px -24px #000c; }
.ficha[hidden] { display: none; }
.ficha__cerrar { position: absolute; right: 10px; top: 8px; width: 32px; height: 32px; font-size: 22px; color: var(--tinta); }
.ficha__titulo { font-size: 40px; }
.ficha__estado { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ficha__estado::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.ficha__estado[data-estado="disponible"] { color: var(--disponible-texto); }
.ficha__estado[data-estado="disponible"]::before { background: #fff; box-shadow: 0 0 0 3px var(--disponible-anillo); }
.ficha__estado[data-estado="vendida"] { color: var(--vendida-texto); }
.ficha__estado[data-estado="reservada"] { color: var(--reservada-texto); }
.ficha__estado[data-estado="reservada"]::before { background: var(--reservada); }
.ficha__estado[data-estado="proxima_etapa"] { color: var(--proxima-texto); }
.ficha__estado[data-estado="proxima_etapa"]::before { background: transparent; box-shadow: inset 0 0 0 2px var(--proxima-texto); }
.ficha__entorno { font-size: 15px; line-height: 1.4; }
.ficha__etapa { font-size: 12px; font-weight: 600; color: var(--disponible-texto); background: #e2b25c26; padding: 6px 12px; border-radius: var(--radio-boton); justify-self: start; }
.ficha__rasgos { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ficha__rasgos li { font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: #14261f0f; }
.ficha__rasgos li[data-rasgo="vertiente"], .ficha__rasgos li[data-rasgo="estero"] { background: #2ba6de1f; color: #0b4a6b; }
.ficha__rasgos li[data-rasgo="vistas"] { background: #e2b25c2e; color: #6e4f12; }
.ficha__mensaje { font-size: 13px; color: #14261fcc; line-height: 1.45; }

/* contador: escasez */
.contador { font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.contador b { color: var(--disponible-anillo); font-weight: 600; }

/* chips de capas (vertientes, estero, vista) */
.capas__titulo { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--papel-suave); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* chip como los rótulos del mapa: círculo con punto + texto blanco */
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; padding: 4px 14px 4px 4px; border-radius: var(--radio-boton); background: #ffffff0f; border: 1px solid #ffffff2e; color: #ffffffbf; transition: background-color .3s, border-color .3s, color .3s, transform .2s var(--curva-sale); }
.chip i { position: relative; width: 24px; height: 24px; border-radius: 50%; background: #0000004d; flex: none; transition: background-color .3s; }
.chip i::after { content: ""; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; border-radius: 50%; background: #ffffff59; transition: background-color .3s, box-shadow .3s, transform .3s var(--curva-sale); }
.chip:hover { border-color: #ffffff80; color: #fff; }
.chip:hover i::after { background: #ffffffb3; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: #ffffff2b; border-color: #fff; color: #fff; }
.chip[aria-pressed="true"] i { background: #fff; }                        /* activo: círculo blanco sólido, sin halo */
.chip[aria-pressed="true"] i::after { background: #101814; transform: scale(1.1); }
/* invitación: dos "respiros" al aparecer el panel (no se repite) */
.chips.invita .chip:not([aria-pressed="true"]) i::after { animation: respira 1.6s ease-in-out 2; }
.chips.invita .chip:nth-child(2) i::after { animation-delay: .2s; }
.chips.invita .chip:nth-child(3) i::after { animation-delay: .4s; }
@keyframes respira { 50% { background: #fff; box-shadow: 0 0 0 5px #ffffff26, 0 0 12px 2px #ffffff80; } }

/* parcelas resaltadas por un chip */
.lote.destacada { stroke: #fff; stroke-opacity: 1; stroke-width: 2.5; fill: #2ba6de2e; }
.capa--cauces path[data-tipo].foco:not(.halo) { stroke-width: 8; }
.ficha__estado[data-estado="bloqueada"] { color: #5b6168; }
.ficha__datos { font-size: 13px; }
.ficha__datos div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #14261f1f; }
.ficha__datos dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.ficha__cta { white-space: nowrap; background: var(--boton); color: #fff; justify-content: center; font-size: 14px; font-weight: 500; padding: 13px 22px; }
.ficha__cta:hover { background: var(--boton-hover); }
.ficha__cta[aria-disabled="true"] { background: #14261f33; color: #14261f99; pointer-events: none; }
.ficha__nota { font-size: 11px; color: #14261f99; }

/* =========================================================
   TEMA CLARO del plano (fondo crema): panel y zoom como tarjetas blancas.
   Las marcas y rótulos siguen oscuros porque van sobre la foto.
   ========================================================= */
.panel { background: #fffffff2; color: var(--tinta); box-shadow: 0 20px 50px -24px #1e2b2259; }
.panel__resumen { color: var(--tinta-suave, #1e2b22bf); }
.panel__resumen b { color: var(--tinta); }
.contador b { color: var(--disponible-texto); }
.filtro { border-color: #1e2b2226; }
.filtro:hover { border-color: #1e2b2266; }
.filtro[data-estado="disponible"] i { background: #fff; }
.filtro[data-estado="proxima_etapa"] i { box-shadow: inset 0 0 0 2px #5b6168; }
.capas { color: var(--tinta-suave, #1e2b22bf); border-top-color: #1e2b221f; }
.capas__titulo { color: var(--tinta-suave, #1e2b22bf); }
.chip { background: #1e2b220a; border-color: #1e2b222e; color: #1e2b22cc; }
.chip i { background: #1e2b2214; }
.chip i::after { background: #1e2b2259; }
.chip:hover { border-color: #1e2b2280; color: var(--tinta); }
.chip:hover i::after { background: #1e2b22b3; }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.chip[aria-pressed="true"] i { background: #fff; }
.chip[aria-pressed="true"] i::after { background: var(--tinta); }
@keyframes respira { 50% { background: var(--tinta); box-shadow: 0 0 0 5px #1e2b221f; } }
.zoom button { background: #fff; color: var(--tinta); box-shadow: 0 6px 18px -8px #1e2b2266; }
.zoom button:hover { background: var(--claro); }
.ficha { box-shadow: 0 24px 60px -24px #1e2b2280; }

@media (max-width: 767px) {
  .panel { top: 64px; left: 12px; right: 12px; width: auto; padding: 14px; gap: 10px; }
  .panel .ceja, .panel__resumen, .capas > label, .capas__titulo { display: none; }
  .contador { font-size: 16px; }
  .capas { border: 0; padding: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; }
  .chip { padding: 3px 12px 3px 3px; font-size: 11.5px; white-space: nowrap; }
  .chip i { width: 22px; height: 22px; }
  .filtros { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .filtro { flex: none; white-space: nowrap; font-size: 11px; padding: 7px 11px; gap: 6px; }
  .filtro b { margin-left: 0; }
  .ficha { left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .ficha__titulo { font-size: 32px; }
  .zoom { bottom: auto; top: 230px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .escena { height: auto; }
  .plano { position: relative; }
  .entrada__txt { display: none; }
  .nube { display: none; }
  .deslizar__mano { animation: none; }
  .lote, .pin { transition: none; }
  .chips.invita .chip i::after { animation: none !important; }
}
