/* Estilos compartidos: listado de propiedades + visor del recorrido 360 */
:root {
  --azul: #003eff;
  --azul-osc: #0030c4;
  --tinta: #0f172a;
  --texto: #334155;
  --suave: #64748b;
  --linea: #e2e8f0;
  --fondo: #f6f8fb;
  --blanco: #ffffff;
  --verde: #16a34a;
  --wa: #25d366;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }

/* ───────────── Listado ───────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.top-in {
  max-width: 1180px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marca img { width: 34px; height: 34px; object-fit: contain; }
.marca b { color: var(--tinta); font-size: 18px; letter-spacing: -.01em; }
.top .sp { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer;
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.btn-wa { background: var(--wa); color: #fff; }
.btn-azul { background: var(--azul); color: #fff; }
.btn-azul:hover { background: var(--azul-osc); }
.btn svg { width: 18px; height: 18px; flex: none; }

.hero { max-width: 1180px; margin: 0 auto; padding: 36px 16px 8px; }
.hero h1 { margin: 0 0 6px; color: var(--tinta); font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--suave); font-size: 16px; max-width: 640px; }

.filtros {
  max-width: 1180px; margin: 0 auto; padding: 20px 16px 4px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.chip {
  border: 1px solid var(--linea); background: var(--blanco); color: var(--texto);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.buscar {
  flex: 1 1 220px; min-width: 0; border: 1px solid var(--linea); background: var(--blanco);
  border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px; outline: none;
}
.buscar:focus { border-color: var(--azul); }

.grilla {
  max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px;
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.card {
  background: var(--blanco); border-radius: var(--radio); overflow: hidden;
  box-shadow: var(--sombra); text-decoration: none; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,23,42,.06), 0 16px 32px rgba(15,23,42,.12); }
.card-img { position: relative; aspect-ratio: 1200 / 630; background: #dfe5ee; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(15, 23, 42, .78); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.badge.b360 { left: auto; right: 10px; background: var(--azul); }
.badge.vendida { background: #dc2626; }
.badge.reservada { background: #d97706; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.precio { color: var(--tinta); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.card h2 { margin: 0; font-size: 16px; color: var(--tinta); line-height: 1.3; }
.zona { color: var(--suave); font-size: 14px; }
.specs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--texto); }
.specs span { white-space: nowrap; }
.vacio { grid-column: 1 / -1; text-align: center; padding: 60px 16px; color: var(--suave); }
.pie { border-top: 1px solid var(--linea); background: var(--blanco); }
.pie-in { max-width: 1180px; margin: 0 auto; padding: 20px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; color: var(--suave); }

/* ───────────── Visor del recorrido ───────────── */
body.tour { background: #000; overflow: hidden; height: 100dvh; }
#pano { position: fixed; inset: 0; }
.capa { position: fixed; z-index: 5; pointer-events: none; }
.capa > * { pointer-events: auto; }
.t-top { top: 0; left: 0; right: 0; padding: 12px; display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0)); padding-bottom: 36px; }
.t-titulo { color: #fff; min-width: 0; flex: 1; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.t-titulo .volver { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.85); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.t-titulo h1 { margin: 0; font-size: clamp(16px, 2.6vw, 22px); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-titulo .sub { font-size: 14px; opacity: .9; margin-top: 2px; }
.t-titulo .sub b { font-weight: 800; }
.t-logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 5px; flex: none; }
.t-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.t-acciones { right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.ico {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(15, 23, 42, .62); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.ico:hover, .ico[aria-pressed="true"] { background: var(--azul); }
.ico svg { width: 20px; height: 20px; }

.t-bottom { left: 0; right: 0; bottom: 0; padding: 36px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.6)); display: flex; flex-direction: column; gap: 10px; }
.t-escena { color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.6); display: flex; align-items: center; gap: 10px; }
.t-escena .n { opacity: .7; font-weight: 600; font-size: 13px; }
.t-fila { display: flex; gap: 10px; align-items: flex-end; }
.tira { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; padding: 2px; }
.tira::-webkit-scrollbar { display: none; }
.tira button {
  flex: none; width: 112px; border: 2px solid transparent; border-radius: 10px; padding: 0; overflow: hidden;
  background: #111; cursor: pointer; position: relative; color: #fff; text-align: left;
}
.tira button img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; opacity: .85; }
.tira button span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; font-weight: 700;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tira button[aria-current="true"] { border-color: #fff; }
.tira button[aria-current="true"] img { opacity: 1; }
.t-bottom.oculta .tira { display: none; }

/* Panel de información */
.panel {
  position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: #fff; color: var(--texto); transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.35);
}
.panel.abierto { transform: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.panel-head b { color: var(--tinta); }
.panel-cerrar { border: 0; background: var(--fondo); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.panel-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel-body h2 { margin: 0; color: var(--tinta); font-size: 20px; line-height: 1.25; }
.panel-body .precio { font-size: 24px; }
.datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dato { background: var(--fondo); border-radius: 10px; padding: 10px 12px; }
.dato small { display: block; color: var(--suave); font-size: 12px; }
.dato b { color: var(--tinta); font-size: 15px; }
.desc { white-space: pre-line; line-height: 1.55; font-size: 15px; }
.panel-acc { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); }
.panel-acc .btn { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn-linea { background: var(--fondo); color: var(--tinta); }

/* Hotspots (flechas de navegación y notas) */
.hs-ir, .hs-info { cursor: pointer; }
.hs-ir { width: 54px; height: 54px; }
.hs-info { width: 34px; height: 34px; }
.hs-ir .aro {
  width: 100%; height: 100%; border-radius: 50%;
  background: rgba(255,255,255,.22); border: 3px solid #fff; display: grid; place-items: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.45); backdrop-filter: blur(2px); transition: transform .15s ease, background .15s ease;
  animation: latido 2.4s ease-in-out infinite;
}
.hs-ir .giro { display: grid; place-items: center; }
.hs-ir .aro svg { width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.hs-ir:hover .aro { transform: scale(1.12); background: var(--azul); animation: none; }
.hs-ir .lbl, .hs-info .lbl {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap;
  background: rgba(15,23,42,.82); color: #fff; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  pointer-events: none;
}
.hs-info .aro {
  width: 100%; height: 100%; border-radius: 50%; background: #fff; color: var(--azul);
  display: grid; place-items: center; font-weight: 800; font-family: Georgia, serif; font-size: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.hs-info .lbl { display: none; white-space: normal; width: max-content; max-width: 240px; text-align: center; font-weight: 600; }
.hs-info:hover .lbl, .hs-info.ver .lbl { display: block; }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.5), 0 2px 12px rgba(0,0,0,.45); } 50% { box-shadow: 0 0 0 10px rgba(255,255,255,0), 0 2px 12px rgba(0,0,0,.45); } }

.aviso {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); z-index: 30;
  background: rgba(15,23,42,.9); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.aviso.ver { opacity: 1; }
.pnlm-load-box { background: rgba(15,23,42,.8) !important; border-radius: 14px !important; }
.pnlm-load-box p { font-family: "Manrope", system-ui, sans-serif !important; }
.pnlm-lbar-fill { background: var(--azul) !important; }

@media (max-width: 640px) {
  .t-acciones { top: auto; bottom: 150px; transform: none; }
  .tira button { width: 92px; }
  .hs-ir { width: 48px; height: 48px; }
}

/* ───────────── Extras del recorrido ───────────── */
.t-lang {
  flex: none; height: 38px; min-width: 42px; padding: 0 10px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(15, 23, 42, .62); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em; backdrop-filter: blur(6px);
}
.t-lang:hover { background: var(--azul); }
.t-escena { flex-wrap: wrap; }
.pills { display: flex; gap: 6px; margin-left: auto; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: rgba(15, 23, 42, .62); color: #fff; border-radius: 999px; padding: 8px 13px;
  font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); text-shadow: none;
}
.pill:hover, .pill[aria-pressed="true"] { background: var(--azul); }
.pill svg { width: 16px; height: 16px; flex: none; }

/* Plano */
.plano {
  position: fixed; z-index: 6; left: 12px; bottom: 150px; width: 300px; max-height: calc(100dvh - 260px);
  background: rgba(255, 255, 255, .96); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); overflow: hidden;
  display: flex; flex-direction: column;
}
.plano[hidden] { display: none; }
.plano-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px 14px; color: var(--tinta); font-size: 14px; }
.plano-head .x { border: 0; background: var(--fondo); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.plano-img { position: relative; margin: 0 10px 10px; overflow: hidden; }
.plano-img img { width: 100%; display: block; border-radius: 8px; }
.pto {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; padding: 0; cursor: pointer;
  background: #fff; border: 4px solid var(--tinta); box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.pto span {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap;
  background: var(--tinta); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.pto:hover span, .pto.act span { opacity: 1; }
.pto.act { border-color: var(--azul); background: var(--azul); box-shadow: 0 0 0 6px rgba(0, 62, 255, .25); z-index: 1; }

/* Ventanas: galería, video, formulario */
body.con-modal .capa, body.con-modal .plano { visibility: hidden; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 23, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 12px 12px; }
.modal[hidden] { display: none; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; line-height: 1; }
.modal-x:hover { background: rgba(255,255,255,.28); }
.lb { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font-size: 30px; line-height: 1; }
.lb-nav:hover { background: var(--azul); }
.lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
.lb-tira { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding: 10px 2px 2px; scrollbar-width: thin; }
.lb-tira button { flex: none; width: 76px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #111; opacity: .6; }
.lb-tira button[aria-current="true"] { border-color: #fff; opacity: 1; }
.lb-tira img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video { width: min(1000px, 100%); aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.video iframe { width: 100%; height: 100%; border: 0; }
.m-visita .tarjeta { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 20px; color: var(--texto); }
.m-visita h3 { margin: 0 0 14px; color: var(--tinta); }
.m-visita form { display: flex; flex-direction: column; gap: 10px; }
.m-visita label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--tinta); }
.m-visita input, .m-visita textarea { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--linea); border-radius: 10px; }
.m-visita textarea { min-height: 80px; resize: vertical; }
.m-visita input:focus, .m-visita textarea:focus { outline: none; border-color: var(--azul); }
.m-visita .btn { padding: 12px; font-size: 15px; }
.f-estado { font-weight: 700; font-size: 14px; }
.f-estado.ok { color: var(--verde); font-size: 16px; }
.f-estado.error { color: #dc2626; }
.oculto-bot { position: absolute; left: -9999px; }

@media (max-width: 640px) {
  .plano { left: 50%; transform: translateX(-50%); top: 84px; bottom: auto; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 300px); }
  .t-escena { gap: 6px; }
  .pills { margin-left: 0; width: 100%; }
  .t-acciones { bottom: 190px; }
}

/* Cambio día / noche */
#pano { transition: opacity .25s ease; }
#pano.cambiando { opacity: 0; }
.pill.noche { background: rgba(250, 204, 21, .9); color: var(--tinta); }
.pill.noche:hover { background: #facc15; }
