* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow: hidden;
  background-color: #000;
}

#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* =========================================================================
   BARRA DE TÍTULO SUPERIOR
   ========================================================================= */
#titleBar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: rgba(50, 50, 50, 0.8);
  color: #fff;
  line-height: 40px;
  padding: 0 15px;
  z-index: 10;
  text-align: center;
  font-weight: bold;
}

#sceneListToggle {
  display: none !important;
}

/* =========================================================================
   MENÚ DE ESCENAS (CARRUSEL INFERIOR)
   ========================================================================= */
#sceneList {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 130px;
  background-color: rgba(30, 30, 30, 0.85);
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #888 #333;
}

#sceneList::-webkit-scrollbar {
  height: 8px;
}
#sceneList::-webkit-scrollbar-track {
  background: #333;
}
#sceneList::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.scenes {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100px;
}

.scene {
  display: block;
  width: 160px;
  height: 100px;
  margin-right: 15px;
  background-color: #222;
  
  /* Ajuste preciso para la tira vertical de Marzipano */
  background-size: 100% auto; 
  background-position: center -350px; /* -350px encuadra la 3ra cara del cubo. Otras opciones para probar: -30px, -190px, -510px, -670px */
  background-repeat: no-repeat;
  
  border: 2px solid transparent;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s;
  flex-shrink: 0;
  overflow: hidden;
}

.scene:hover {
  border-color: #fff;
}

.scene img.thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene .text {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  text-align: center;
  padding: 6px 4px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

/* =========================================================================
   PUNTOS INTERACTIVOS (HOTSPOTS) DE INFORMACIÓN Y ENLACES
   ========================================================================= */
.link-hotspot {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  opacity: 0.8;
  transition: opacity 0.2s;
  cursor: pointer;
  position: relative;
}

.link-hotspot:hover {
  opacity: 1;
}

.link-hotspot-icon {
  width: 100%;
  height: 100%;
  background-image: url('img/link.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.link-hotspot-tooltip {
  position: absolute;
  top: 100%; 
  left: 50%;
  transform: translateX(-50%);
  margin-top: 5px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  box-shadow: 0px 2px 5px rgba(0,0,0,0.5);
}

.info-hotspot {
  line-height: 1.2;
  border-radius: 5px;
  transition: opacity 0.2s 0.2s;
}

.info-hotspot .info-hotspot-header {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: rgb(104, 104, 104);
  cursor: pointer;
  transition: width 0.2s ease-in-out, border-radius 0.2s ease-in-out;
  display: flex;
  align-items: center;
}

.info-hotspot .info-hotspot-icon-wrapper {
  width: 40px;
  height: 40px;
}

.info-hotspot .info-hotspot-icon {
  width: 90%;
  height: 90%;
  margin: 5%;
  background-image: url('img/info.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.info-hotspot .info-hotspot-title-wrapper {
  width: 0;
  height: 40px;
  padding: 0;
  overflow: hidden;
  transition: width 0.2s ease-in-out, padding 0.2s ease-in-out;
}

.info-hotspot .info-hotspot-title {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  height: 40px;
  line-height: 40px;
}

.info-hotspot .info-hotspot-close-wrapper {
  width: 0;
  height: 40px;
  padding: 0;
  overflow: hidden;
  transition: width 0.2s ease-in-out, padding 0.2s ease-in-out;
}

.info-hotspot .info-hotspot-close-icon {
  width: 70%;
  height: 70%;
  margin: 15%;
  background-image: url('img/close.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.info-hotspot.visible .info-hotspot-header {
  width: 500px; 
  border-radius: 5px 5px 0 0;
}

.info-hotspot.visible .info-hotspot-title-wrapper {
  width: 420px;
  padding: 0 10px;
}

.info-hotspot.visible .info-hotspot-close-wrapper {
  width: 40px;
}

.info-hotspot .info-hotspot-text {
  width: 500px; 
  padding: 15px;
  background-color: rgba(50, 50, 50, 0.95);
  color: #fff;
  border-radius: 0 0 5px 5px;
  display: none;
  overflow-y: visible;
  max-height: none; 
}

.info-hotspot.visible .info-hotspot-text {
  display: block;
}

/* =========================================================================
   ASIGNACIÓN DE MINIATURAS (FRENTE DE CADA ESCENA)
   ========================================================================= */
.scene[data-id="0-locomotora-patria-de-frente"] { background-image: url('tiles/0-locomotora-patria-de-frente/preview.jpg'); }
.scene[data-id="1-reservado-c14"] { background-image: url('tiles/1-reservado-c14/preview.jpg'); }
.scene[data-id="2-locomotora-1567-de-frente"] { background-image: url('tiles/2-locomotora-1567-de-frente/preview.jpg'); }
.scene[data-id="3-locomotora-1567"] { background-image: url('tiles/3-locomotora-1567/preview.jpg'); }
.scene[data-id="4-salida-a-trenes"] { background-image: url('tiles/4-salida-a-trenes/preview.jpg'); }
.scene[data-id="5-coche-oficial-4"] { background-image: url('tiles/5-coche-oficial-4/preview.jpg'); }
.scene[data-id="6-interior-coche-oficial"] { background-image: url('tiles/6-interior-coche-oficial/preview.jpg'); }
.scene[data-id="7-interior-2-coche-04"] { background-image: url('tiles/7-interior-2-coche-04/preview.jpg'); }
.scene[data-id="8-camarote-"] { background-image: url('tiles/8-camarote-/preview.jpg'); }
.scene[data-id="9-saln-principal"] { background-image: url('tiles/9-saln-principal/preview.jpg'); }
.scene[data-id="10-coche-presidencial"] { background-image: url('tiles/10-coche-presidencial/preview.jpg'); }
.scene[data-id="11-coche-presidencial-2"] { background-image: url('tiles/11-coche-presidencial-2/preview.jpg'); }
.scene[data-id="12-comedor-coche-presidencial"] { background-image: url('tiles/12-comedor-coche-presidencial/preview.jpg'); }
.scene[data-id="13-pasillo-2-coche-presidencial"] { background-image: url('tiles/13-pasillo-2-coche-presidencial/preview.jpg'); }
.scene[data-id="14-habitacin-presidencial"] { background-image: url('tiles/14-habitacin-presidencial/preview.jpg'); }
.scene[data-id="15-bao-habitacin-presidencial"] { background-image: url('tiles/15-bao-habitacin-presidencial/preview.jpg'); }
.scene[data-id="16-fin-coche-presidencial"] { background-image: url('tiles/16-fin-coche-presidencial/preview.jpg'); }
.scene[data-id="17-bajada-del-coche-presidencial"] { background-image: url('tiles/17-bajada-del-coche-presidencial/preview.jpg'); }
.scene[data-id="18-anden-final-del-recorrido"] { background-image: url('tiles/18-anden-final-del-recorrido/preview.jpg'); }