html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: sans-serif;
}

a-scene {
  width: 100vw !important;
  height: 100vh !important;
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 0;
}

/* ================= TEXTOS ================= */

.contador-imagenes {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.82);
  color: white;
  padding: 10px 20px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: bold;
  max-width: 50vw;
  text-align: center;
}

.nombre-lugar {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.82);
  color: white;
  padding: 8px 20px;
  border-radius: 15px;
  font-size: 18px;
  font-weight: bold;
  max-width: 50vw;
  text-align: center;
}

/* ================= BOTONES SUPERIORES ================= */

.boton-tour {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: #1636ff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.boton-tour:hover {
  background: #0d1f6b;
}

.boton-fullscreen {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10001;
  background: #ff3b3b;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

.boton-fullscreen:hover {
  background: #a80000;
}

.boton-salir-pantalla {
  position: fixed;
  top: 120px;
  right: 20px;
  z-index: 10001;
  background: #ff9800;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  display: none;
}

.boton-salir-pantalla:hover {
  background: #cc7a00;
}

/* ================= MINI RUTA ================= */

.mini-ruta {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 104px;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 12px;
  padding: 6px;
  z-index: 1003;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mini-ruta:hover {
  transform: scale(1.03);
}

.mini-ruta-header {
  color: white;
  font-size: 0.72rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.mini-ruta img {
  width: 100%;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: rgba(255,255,255,0.08);
}

/* ================= MODAL RUTA ================= */

.modal-ruta {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-ruta.activo {
  display: flex;
}

.modal-ruta-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.modal-ruta-contenido {
  position: relative;
  z-index: 2;
  width: min(92vw, 1000px);
  max-height: 88vh;
  background: rgba(20, 20, 20, 0.96);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.modal-ruta-contenido img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: rgba(255,255,255,0.05);
}

.cerrar-ruta {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: #ff3b3b;
  color: white;
  border: none;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.cerrar-ruta:hover {
  background: #b80000;
}

/* ================= PANEL LUGARES ================= */

.panel-lateral {
  position: fixed;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toggle-panel,
.menu-lugares,
.boton-lugar {
  pointer-events: auto;
}

.toggle-panel {
  background: rgba(0, 0, 0, 0.88);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-lugares {
  width: auto;
  max-width: 92vw;
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.88);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  transform: translateY(0);
  opacity: 1;
  transition: all 0.3s ease;
  justify-content: center;
}

.menu-lugares.oculto {
  transform: translateY(15px);
  opacity: 0;
  pointer-events: none;
}

.titulo-panel {
  width: 100%;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}

.boton-lugar {
  min-width: 120px;
  text-align: center;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: #243dff;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95rem;
}

.boton-lugar:hover {
  background: #10228a;
}

.boton-lugar.active {
  background: #00ff88;
  color: #000;
}

/* ================= ZONAS ================= */

.zonas-inferiores {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
  background: rgba(0, 0, 0, 0.82);
  padding: 14px;
  border-radius: 18px;
  pointer-events: none;
}

.boton-zona {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #ffffff;
  color: #111;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.92rem;
  pointer-events: auto;
}

.boton-zona:hover {
  transform: translateY(-2px);
}

.boton-zona.active {
  background: #00ff88;
  color: #000;
}

/* ================= FLECHAS ================= */

#flecha-nav,
#flecha-atras {
  cursor: pointer;
  will-change: transform, opacity;
  pointer-events: auto;
}

#flecha-nav:hover,
#flecha-atras:hover {
  opacity: 1 !important;
}

#fondo-360 {
  transition: opacity 0.12s ease;
}



/* ================= PANTALLA COMPLETA ================= */

body.modo-pantalla-completa .mini-ruta {
  top: 12px;
  left: 12px;
}

body.modo-pantalla-completa .panel-lateral {
  bottom: 95px;
}

body.modo-pantalla-completa .zonas-inferiores {
  bottom: 20px;
}

/* ================= TABLET / MOVIL ================= */

@media (max-width: 768px) {
  .contador-imagenes {
    top: 12px;
    left: 52%;
    transform: translateX(-50%);
    font-size: 13px;
    padding: 7px 12px;
    max-width: 38vw;
  }

  .nombre-lugar {
    top: 50px;
    left: 52%;
    transform: translateX(-50%);
    font-size: 14px;
    padding: 6px 12px;
    max-width: 42vw;
  }

  .boton-tour {
    top: 12px;
    right: 12px;
    padding: 8px 10px;
    font-size: 0.72rem;
    max-width: 118px;
    line-height: 1.15;
  }

  .boton-fullscreen {
    top: 58px;
    right: 12px;
    padding: 8px 10px;
    font-size: 0.72rem;
    max-width: 118px;
    line-height: 1.15;
  }

  .boton-salir-pantalla {
    top: 104px;
    right: 12px;
    padding: 8px 10px;
    font-size: 0.72rem;
    max-width: 118px;
    line-height: 1.15;
  }

  .mini-ruta {
    top: 12px;
    left: 12px;
    width: 92px;
    padding: 5px;
    border-radius: 10px;
  }

  .mini-ruta-header {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }

  .mini-ruta img {
    height: 48px;
    border-radius: 6px;
  }

  .panel-lateral {
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    gap: 8px;
    width: calc(100vw - 18px);
    justify-content: center;
  }

  .toggle-panel {
    padding: 10px 12px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .menu-lugares {
    max-width: calc(100vw - 70px);
    max-height: 130px;
    padding: 10px;
    gap: 8px;
    border-radius: 14px;
  }

  .titulo-panel {
    font-size: 0.88rem;
    padding-bottom: 6px;
  }

  .boton-lugar {
    min-width: 95px;
    padding: 9px 10px;
    font-size: 0.8rem;
    border-radius: 10px;
  }

  .zonas-inferiores {
    width: calc(100vw - 20px);
    bottom: 10px;
    padding: 10px;
    gap: 8px;
    border-radius: 16px;
  }

  .boton-zona {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .modal-ruta-contenido {
    width: 94vw;
    padding: 12px;
    border-radius: 14px;
  }

  .modal-ruta-contenido img {
    max-height: 74vh;
  }

  .cerrar-ruta {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}

@media (max-width: 950px) and (orientation: landscape) {
  .mini-ruta {
    top: 10px;
    left: 10px;
    width: 88px;
    padding: 5px;
  }

  .mini-ruta img {
    height: 42px;
  }

  .contador-imagenes {
    top: 10px;
    left: 50%;
    max-width: 28vw;
    font-size: 12px;
    padding: 6px 10px;
  }

  .nombre-lugar {
    top: 42px;
    left: 50%;
    max-width: 28vw;
    font-size: 13px;
    padding: 5px 10px;
  }

  .boton-tour {
    top: 10px;
    right: 10px;
    max-width: 112px;
    font-size: 0.68rem;
    padding: 7px 9px;
  }

  .boton-fullscreen,
  .boton-salir-pantalla {
    top: 44px;
    right: 10px;
    max-width: 112px;
    font-size: 0.68rem;
    padding: 7px 9px;
  }

  .panel-lateral {
    bottom: 64px;
    width: calc(100vw - 20px);
  }

  .menu-lugares {
    max-width: calc(100vw - 66px);
    max-height: 84px;
    padding: 8px;
    gap: 6px;
  }

  .titulo-panel {
    font-size: 0.8rem;
    padding-bottom: 4px;
    margin-bottom: 2px;
  }

  .boton-lugar {
    min-width: 84px;
    padding: 7px 8px;
    font-size: 0.72rem;
  }

  .zonas-inferiores {
    bottom: 8px;
    padding: 8px;
    gap: 6px;
  }

  .boton-zona {
    padding: 8px 10px;
    font-size: 0.74rem;
  }
}

.boton-tour {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 9999;
}

.boton-vr {
  position: fixed;
  top: 65px;
  right: 170px;
  z-index: 9999;
  background: #ff3b3b;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
}

.boton-fullscreen {
  position: fixed;
  top: 65px;
  right: 20px;
  z-index: 9999;
}

.boton-salir-vr {
  position: fixed;
  top: 65px;
  right: 170px;
  z-index: 9999;
  background: #ff3b3b;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
}

.boton-salir-pantalla {
  position: fixed;
  top: 65px;
  right: 20px;
  z-index: 9999;
}