html { height:100%; }
body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
.control{
    display: block;
    position: absolute;
    top: 0;
    margin: 10px;
    min-width: 150px;
}
.control>a{
    display: block;

    background-color: #1a181b;
    padding: 10px 20px;
    user-select: none;
    cursor: pointer;
    color: #ffffff;
    text-decoration: none;
    text-align: center;

    opacity: 0.5;
    transition: all 300ms ease 0ms;
}
.control>a:hover{
    opacity: 1;
}
.control>div{
    background-color: #1a181b;
    padding: 10px 20px;
    text-align: center;
}

.control>a::before{
    font-size: 24px;
    line-height: 1em;
    content: "<";
    opacity: 0;
    position: absolute;
    margin-left: 0;
    transition: all .2s;
    text-transform: none;
    font-feature-settings: "kern" off;
    font-variant: none;
    font-style: normal;
    font-weight: 400;
    text-shadow: none;
    color: #fff;
    transform: translateY(-3px);
}
.control>a:hover::before{
    opacity: 1;
    margin-left: -25px;
}




/* MODALES */
/* CSS Minimalista para scannability */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none; /* Oculto por defecto */
  justify-content: center;
  align-items: center;
  z-index: 3000; /* Por encima de KRpano */
}

.modal-content {
  background: black;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  position: relative;
  border-radius: 8px;
}
 .modal-window {
  position: relative;
  display: flex;
  flex-direction: column;
  /* width: 90vw; */
  width: calc(100vw - 40px);
  height: 85vh;
  background: #000;
  overflow: hidden;
}

 .modal-window.infoAuto{
    width: unset;
    height: unset;
 }

.modal-wrapper {
  display: flex;
  height: 100%;
  width: 100%;
}

.modal-stage {
  flex-grow: 1;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-window.infoAuto .modal-stage {
    height: 50vh;
    min-height: 300px;
    width: 50vw;
    min-width: 300px;
}

/* Panel lateral derecho */
.info-panel {
  position: absolute;
  /* right: -400px; Oculto por defecto */
  right: -500px; /* Oculto por defecto */
  top: 0;
  /* width: 350px; */
  width: 450px;
  height: 100%;
  /* background: rgba(255, 255, 255, 0.95); */
  background: rgba(0, 0, 0, 0.95);
  transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  padding: 40px 20px;
  z-index: 10;
  color: #FFF;

  box-sizing: border-box;
}
.modal-window.infoAuto .info-panel{
    width: 100%;
    padding-top: 60px;
}

.info-panel.is-active {
  right: 0;
}

/* Botón inferior */
.btn-info-toggle {
  /* position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 25px;
  border: none;
  border-radius: 50px;
  cursor: pointer; */
  /* display: none; Se activa por JS */
}

.btn-close-modal{
    z-index: 10;
}

.img-fluid {
  /* Magia para contener */
  max-width: 100%;  /* No más ancha que el div */
  max-height: 100%; /* No más alta que el div */
  
  /* Mantener proporción sin deformar */
  width: auto;
  height: auto;
  
  /* Opción moderna extra (asegura que se comporte como "contain") */
  object-fit: contain; 
}

.btn-info-toggle {
    /* ... tus estilos anteriores ... */
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    display: none; /* JS cambiará esto a block */
}

/* Cuando JS lo pone en display: block, podemos animarlo */
#btn-info-toggle[style*="display: block"] {
    animation: fadeIn 0.4s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}


/* Contenedor del ítem UI */
.ui-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px;
}

/* Clase base para botones posicionados */
.ui-pos {
    position: absolute;
    z-index: 100; /* Aseguramos que estén sobre el Stage */
    --distance: 10px;
}

/* Variaciones de posición */
.pos-top-left     { top: var(--distance); left: var(--distance); transform: translateX(0) !important; }
.pos-top-center   { top: var(--distance); left: 50%; transform: translateX(-50%); }
.pos-top-right    { top: var(--distance); right: var(--distance); transform: translateX(0) !important; }

.pos-bottom-left  { bottom: var(--distance); left: var(--distance); transform: translateX(0) !important; }
.pos-bottom-center { bottom: var(--distance); left: 50%; transform: translateX(-50%); }
.pos-bottom-right { bottom: var(--distance); right: var(--distance); transform: translateX(0) !important; }

.pos-center-right { top: 50%; right: var(--distance); transform: translateY(-50%); }
.pos-center-left  { top: 50%; left: var(--distance); transform: translateY(-50%); }

.ui-text{
    color: white;
}

/* Estado del icono PNG */
.ui-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    /* Estado Normal: Desaturado y con contraste */
    filter: saturate(0) contrast(2);
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* --- INTERACCIONES --- */

/* Hover sobre el contenedor */
.ui-item:hover .ui-icon {
    /* Estado Hover: Recupera color original y contraste normal */
    filter: saturate(1) contrast(1);
    /* Escala contenida para no romper el layout */
    transform: scale(1.15);
}

/* Feedback táctil / click */
.ui-item:active {
    transform: scale(0.95);
}

/* Modificador para el botón del modal (manteniendo posición) */
.btn-info-toggle {
    /* position: absolute;
    bottom: 20px;
    left: 50%; */
    /* transform: translateX(-50%); *//* Base para el centrado */
    z-index: 100;
}

/* Ajuste del hover específico para el botón centrado para no perder el translateX */
.btn-info-toggle:hover {
    /* transform: translateX(-50%) scale(1.05); */
    scale: 1.05;
}


.btn-close-panel{
    font-size: 20px;
    color: white;
}
.modal-window.infoAuto #modal-info-panel .btn-close-panel{
    display: none;
}


.info-content {
    height: 100%;
    overflow-y: auto; /* Scroll vertical si el texto es largo */
    padding-right: 15px; /* Espacio para que el scroll no tape el texto */
    scrollbar-width: thin; /* Scroll fino en Firefox */
    scrollbar-color: #666 #eee;
}

.info-content .modal-title{
    font-family: 'Rubik-Bold', sans-serif;
    font-size: 30px;
    margin: 20px 0 10px 0;
    text-transform: uppercase;
    line-height: 1.1;
}

/* Estilos específicos para el HTML inyectado */
.modal-text-body p {
    margin-bottom: 1.2em;
    line-height: 1.6;
    font-size: 20px;
}

.modal-text-body h4 {
    margin: 1.5em 0 0.5em 0;
    color: #000;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.modal-text-body ul {
    padding-left: 20px;
    margin-bottom: 1.2em;
}

.modal-text-body li {
    margin-bottom: 0.5em;
}

.modal-text-body a {
    color: #0066cc;
    text-decoration: underline;
}


.iframe-stage {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    /* Evita que el iframe capture el scroll de la página si no es necesario */
    overflow: hidden; 
}

/* Opcional: Un pequeño loader mientras el iframe carga */
.modal-stage.is-loading::before {
    content: "Cargando contenido...";
    position: absolute;
    color: white;
    font-family: sans-serif;
    font-size: 12px;
}

@media (max-width: 768px){
    .info-panel{
        right: -400px; /* Oculto por defecto */
        width: 350px;
    }
}
@media (max-width: 650px){
    .info-panel{
        right: -350px; /* Oculto por defecto */
        width: 300px;
    }
}
@media (max-width: 576px){
    .modal-window{
        position: unset;
    }
    .modal-wrapper{
        flex-direction: column;
    }
    .modal-stage{
        max-height: 50vh;
    }
    .modal-window.infoAuto .modal-stage{
        height: 0;
        min-height: unset;
    }
    .info-panel{
        width: 100%;
        position: relative;
        right: -100%;
        height: 70%;
    }
    .modal-window.infoAuto .info-panel{
        height: 100vh;
    }
    .info-panel  .btn-close-panel{
        display: none;
    }
}





/* Posicionamiento del panel flotante sobre krpano */
.sidebar {
  position: fixed; /* 👈 Cambiado de absolute a fixed */
  top: 300px;       /* Despegado 20px del borde superior */
  left: 20px;      /* Despegado 20px del borde izquierdo */
  bottom: 100px;    /* Despegado 20px del borde inferior, controlando su altura automáticamente */
  width: 280px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); /* Sombra un poco más intensa para separarlo del tour */
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1; /* 👈 Un z-index alto para asegurar que krpano nunca lo tape */
  display: flex;
  flex-direction: column;
}

/* Estado colapsado: se esconde hacia la izquierda */
.sidebar.collapsed {
  transform: translateX(-300px); /* Se mueve fuera de la pantalla + margen */
}

/* Contenido interno */
.sidebar-content {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}

.sidebar h3 {
  margin-top: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
  font-family: sans-serif;
}

/* Contenedor de botones */
.btn-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

/* Botón de Toggle (permanece visible incluso colapsado) */
.toggle-btn {
  position: absolute;
  right: -40px;
  top: 20px;
  width: 40px;
  height: 40px;
  background: rgba(20, 20, 20, 0.85);
  border: none;
  color: white;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  box-shadow: 4px 0 12px rgba(0,0,0,0.2);
  transition: background 0.3s;
}

.toggle-btn:hover {
  background: rgba(40, 40, 40, 0.95);
}





/* Estilo base de los botones de zona */
.zone-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: sans-serif;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
}

/* Efecto al pasar el ratón por encima */
.zone-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateX(4px); /* Desplazamiento interactivo */
}

/* Estado Activo: Cuando representa la zona en la que está el usuario */
.zone-btn.active {
  background: #ab6526; /* Azul tecnológico, puedes cambiarlo por tu color de marca */
  border-color: #cf782d;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(171, 101, 38, 0.4);
  transform: translateX(4px);
}