:root {
  --marino: #1d2144;
  --marino-90: rgba(29, 33, 68, .9);
  --marino-60: rgba(29, 33, 68, .6);
  --blanco: #ffffff;
  --gris: #eef0f4;
  --texto: #1d2144;
  --texto-suave: #5b607a;
  --verde-wa: #25d366;
  --sombra: 0 6px 24px rgba(10, 12, 30, .25);
  --radio: 999px;
  --fuente: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--marino); color: var(--blanco); font-family: var(--fuente); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- Portada ---------- */
.portada { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--marino); }
.portada-fondo, .portada-fondo .slide { position: absolute; inset: 0; }
.portada-fondo .slide { background-size: cover; background-position: center; opacity: 0; transform: scale(1.04); transition: opacity 1.6s ease, transform 8s ease; }
.portada-fondo .slide.visible { opacity: 1; transform: scale(1); }
.portada-velo { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,17,40,.35) 0%, rgba(15,17,40,.15) 40%, rgba(15,17,40,.7) 100%); }
.portada-contenido { position: relative; text-align: center; padding: 24px 16px; max-width: 720px; }
.portada-logo { width: min(380px, 72vw); height: auto; margin-bottom: 18px; filter: drop-shadow(0 2px 10px rgba(0,0,0,.35)); }
.portada-marca { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 18px; height: 42px; width: auto; filter: brightness(0) invert(1) drop-shadow(0 1px 6px rgba(0,0,0,.35)); z-index: 1; }
.solo-lectores { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.portada h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 600; letter-spacing: -.5px; margin: 18px 0 6px; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.portada-sub { margin: 0 0 28px; font-size: clamp(15px, 2.2vw, 19px); opacity: .95; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.portada-botones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.portada-aviso { display: inline-block; margin: 22px auto 0; padding: 7px 14px; max-width: 520px; border-radius: 999px; background: rgba(15,17,40,.55); font-size: 13px; line-height: 1.4; text-shadow: 0 1px 6px rgba(0,0,0,.4); }

.btn { border: 0; border-radius: var(--radio); padding: 14px 30px; font-size: 16px; font-weight: 600; cursor: pointer; min-width: 170px; transition: transform .15s ease, background .2s ease, color .2s ease; }
.btn:active { transform: scale(.97); }
.btn-claro { background: var(--blanco); color: var(--marino); box-shadow: var(--sombra); }
.btn-claro:hover { background: var(--gris); }
.btn-borde { background: rgba(255,255,255,.08); color: var(--blanco); border: 1.5px solid rgba(255,255,255,.85); backdrop-filter: blur(4px); }
.btn-borde:hover { background: rgba(255,255,255,.2); }
.btn-oscuro { background: var(--marino); color: var(--blanco); }
.btn-oscuro:hover { background: #2a2f5c; }

/* ---------- Tour ---------- */
.tour { position: fixed; inset: 0; background: #000; }
#pano { position: absolute; inset: 0; }
.pnlm-container { background: #000 !important; }
.pnlm-load-box { background: var(--marino-90) !important; border-radius: 12px !important; }
.pnlm-panorama-info, .pnlm-about-msg { display: none !important; }

.barra-sup { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 12px 12px; z-index: 5; pointer-events: none; }
.barra-sup .grupo { display: flex; gap: 8px; pointer-events: auto; }
.titulo-escena { pointer-events: none; padding: 8px 16px; border-radius: var(--radio); background: var(--marino-60); backdrop-filter: blur(6px); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; border-radius: var(--radio); background: var(--marino-90); color: var(--blanco); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--sombra); }
.chip:hover { background: #2a2f5c; }
.chip.activo { background: var(--blanco); color: var(--marino); }
.chip-ico { width: 38px; padding: 0; justify-content: center; }
.chip-claro { background: var(--gris); color: var(--marino); box-shadow: none; }
.chip-claro:hover { background: #dde0e8; }
.chip-claro.activo { background: var(--marino); color: var(--blanco); }

.minimapa { position: absolute; top: 64px; right: 12px; width: min(300px, 42vw); background: var(--marino-90); border-radius: 14px; padding: 8px; z-index: 4; box-shadow: var(--sombra); }
.minimapa-cab { font-size: 13px; font-weight: 600; padding: 2px 4px 6px; }
.minimapa-plano, .planos-vista { position: relative; }
.minimapa-plano img, .planos-vista img { display: block; width: 100%; height: auto; border-radius: 8px; }
.punto { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--blanco); border: 3px solid var(--marino); cursor: pointer; padding: 0; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.punto:hover { transform: scale(1.2); }
.punto.actual { background: #ff5a4e; border-color: var(--blanco); width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.cono { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; pointer-events: none; background: conic-gradient(from 60deg, rgba(255,90,78,.55) 0deg 60deg, transparent 60deg 360deg); border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 60%, transparent 62%); mask: radial-gradient(circle, #000 60%, transparent 62%); }

.ayuda { position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: var(--radio); background: var(--marino-60); font-size: 13px; white-space: nowrap; z-index: 3; pointer-events: none; transition: opacity .6s ease; }

.tira { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); overflow-x: auto; background: linear-gradient(180deg, transparent, rgba(10,12,30,.75)); z-index: 4; scrollbar-width: thin; }
.miniatura { flex: 0 0 auto; width: 128px; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--marino); color: var(--blanco); padding: 0; cursor: pointer; text-align: left; }
.miniatura img { display: block; width: 100%; height: 64px; object-fit: cover; }
.miniatura span { display: block; font-size: 11.5px; font-weight: 600; padding: 4px 6px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miniatura.actual { border-color: var(--blanco); }
.miniatura:hover img { filter: brightness(1.1); }

.whatsapp { position: absolute; right: 14px; bottom: 112px; width: 54px; height: 54px; border-radius: 50%; background: var(--verde-wa); display: grid; place-items: center; box-shadow: var(--sombra); z-index: 5; }

.menu { position: absolute; top: 0; left: 0; bottom: 0; width: min(330px, 86vw); background: var(--blanco); color: var(--texto); z-index: 10; padding: 16px; overflow-y: auto; box-shadow: var(--sombra); }
.menu-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.menu-cab img { height: 38px; }
.menu h3 { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--texto-suave); margin: 18px 0 8px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; background: transparent; border-radius: 10px; font-size: 15px; color: var(--texto); cursor: pointer; }
.menu-item:hover { background: var(--gris); }
.menu-item.actual { background: var(--marino); color: var(--blanco); }
.menu-aviso { font-size: 12px; color: var(--texto-suave); margin-top: 22px; }

.cerrar { border: 0; background: var(--gris); color: var(--marino); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }

/* Flechas en el piso (hotspots) */
.hs-flecha { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(255,255,255,.22); border: 2.5px solid rgba(255,255,255,.95); box-shadow: 0 0 0 6px rgba(255,255,255,.12), 0 4px 14px rgba(0,0,0,.35); cursor: pointer; }
.hs-flecha::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; border-top: 4px solid #fff; border-left: 4px solid #fff; transform: translate(-50%, -30%) rotate(45deg); }
.hs-flecha:hover { background: rgba(255,255,255,.4); }
.hs-flecha .hs-etiqueta { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); white-space: nowrap; padding: 5px 11px; border-radius: 999px; background: var(--marino-90); color: #fff; font: 600 13px var(--fuente); pointer-events: none; }
.hs-escalera { background: rgba(29,33,68,.55); }

/* Modales */
.modal { position: fixed; inset: 0; background: rgba(10,12,30,.55); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal-caja { position: relative; background: var(--blanco); color: var(--texto); border-radius: 18px; padding: 22px 22px 20px; width: min(380px, 100%); text-align: center; box-shadow: var(--sombra); max-height: 100%; overflow: auto; }
.modal-ancha { width: min(860px, 100%); }
.modal-caja .cerrar { position: absolute; top: 12px; right: 12px; }
.modal-logo { height: 40px; margin-top: 4px; }
.modal-caja h2 { font-size: 17px; margin: 10px 0 14px; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border: 1px solid #e3e5ee; border-radius: 12px; margin: 0 auto 10px; width: 266px; }
.qr img, .qr canvas { width: 240px; height: 240px; }
.qr-url { font-size: 12px; color: var(--texto-suave); word-break: break-all; margin: 0 0 14px; }
.planos-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.planos-nota { font-size: 13px; color: var(--texto-suave); margin: 10px 0 0; }

.cargando { position: fixed; inset: 0; background: var(--marino); display: grid; place-content: center; justify-items: center; gap: 14px; z-index: 30; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .chip .txt { display: none; }
  #btnMenu { width: 38px; padding: 0; justify-content: center; }
  .titulo-escena { font-size: 13px; padding: 7px 12px; max-width: 34vw; }
  .minimapa { top: auto; bottom: 112px; left: 12px; right: auto; width: 46vw; }
  .ayuda { bottom: 104px; font-size: 12px; white-space: normal; text-align: center; width: calc(100% - 32px); }
  .whatsapp { bottom: 170px; }
  .miniatura { width: 108px; }
  .miniatura img { height: 56px; }
  #btnPlano { display: none; }
}
@media (max-width: 420px) {
  .barra-sup .grupo { gap: 6px; }
  .chip { height: 34px; padding: 0 10px; }
  .chip-ico, #btnMenu { width: 34px; }
  .titulo-escena { display: none; }
}
