html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fill-viewport {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.fill-viewport.landscape-left {
  left: env(safe-area-inset-left);
}

.fill-viewport.landscape-right {
  right: env(safe-area-inset-right);
}

#viewer {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  z-index: 1;
  overflow: hidden;
}

#preloadContainer {
  z-index: 5;
  opacity: 0;
  background-color: rgba(255, 255, 255, 0.21);
  transition: opacity 0.8s;
  -webkit-transition: opacity 0.5s;
  -moz-transition: opacity 0.5s;
  -o-transition: opacity 0.5s;
}

.header {
  position: fixed;
  width: 100vw;
  padding-top: 0px;
  padding-bottom: 0;
  z-index: 2;
  top: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.775), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.8s;
}

.header-img {
  width: 150px;
  margin-left: 40px;
}

.header-nav {
  width: fit-content;
  margin-right: 60px;
  display: flex;
  align-items: end;
  gap: 2rem;
  overflow: hidden;
}

.header-nav-links {
  text-decoration: none;
  background-color: transparent;
  color: white;
  cursor: pointer;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 16px;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 768px) {
  #viewer {
    min-height: 100dvh;
  }

  .header {
    flex-direction: column;
    align-items: baseline;
    gap: 0.5rem;
/*    background-color: #F7931E; */
  }

  .header-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .header-nav-links {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }
}

[id="86"] {
  z-index: 5 !important;
}

.PopupPanoramaOverlay,
.zoomImagePopupPanorama,
.closeButtonPopupPanorama {
  z-index: 200 !important;
  position: relative;
}

/* === MODAL BASE === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.modal-content {
  margin: auto;
  width: 80%;
  height: 100vh;
  display: flex;
  gap: 5px;
  flex-direction: column;
  justify-content: center;
  align-items: end;
}

.modal-content iframe {
  height: 80vh;
}

.close {
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover,
.close:focus {
  color: rgb(252, 252, 252);
  text-decoration: none;
  cursor: pointer;
}

/* === MODAL GALERÍA (3 COLUMNAS) === */
#galleryModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.545);
  overflow-y: auto;
  padding-top: 100px;
}

#galleryModal .modal-content {
  margin: 3% auto;
  padding: 40px 20px;
  width: 90%;
  max-width: 600px;
  height: auto;
  min-height: 80vh;
  border-radius: 12px;
  justify-content: flex-start;
  align-items: center;
}

.close-gallery {
  position: fixed;
  top: 0;
  right: 20px;
  font-size: 40px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 10;
}

.close-gallery:hover,
.close-gallery:focus {
  color: #d40000;
}

.gallery {
  position: relative;
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0;
}

.gallery img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.4);
  border-color: #fff;
}

/* === MODAL SLIDER === */
#sliderModal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

.slider-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.slider {
  height: 100%;
  display: flex;
  overflow: hidden;
  position: relative;
  justify-content: center;
  align-items: center;
}

.slide {
  min-width: 100%;
  transition: transform 0.5s ease-in-out;
  display: none;
  justify-content: center;
  align-items: center;
}

.slide.active {
  display: flex;
}

.slide img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.close-slider {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.3s;
}

.close-slider:hover {
  color: #d40000;
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  font-size: 40px;
  color: white;
  padding: 16px;
  margin-top: -22px;
  user-select: none;
  z-index: 10000;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  transition: all 0.3s;
}

.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
  color: #d40000;
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* === RESPONSIVE === */
@media screen and (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .gallery img {
    height: 220px;
  }

  .header-img {
    width: 170px;
    margin-left: 20px;
  }

  .header-nav {
    margin-right: 30px;
    gap: 1.5rem;
  }

  .header-nav-links {
    font-size: 14px;
  }
}

@media screen and (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery img {
    height: 180px;
  }

  #galleryModal .modal-content {
    width: 95%;
    padding: 30px 15px;
  }

  .close-gallery {
    font-size: 32px;
  }

  .prev,
  .next {
    font-size: 30px;
    padding: 12px;
  }

  .close-slider {
    font-size: 32px;
    right: 20px;
  }

  .header-nav {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
  }

  .header-nav-links {
    padding: 9px;
    font-size: 15pt;
  }
}

@media screen and (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gallery img {
    height: 200px;
  }

  #galleryModal .modal-content {
    width: 98%;
    padding: 20px 10px;
    margin: 1% auto;
  }

  .close-gallery {
    font-size: 28px;
  }

  .prev,
  .next {
    font-size: 24px;
    padding: 10px;
  }

  .prev {
    left: 10px;
  }

  .next {
    right: 10px;
  }

  .close-slider {
    font-size: 28px;
    right: 15px;
    top: 15px;
  }
}

/* Ocultar el boton en escritorio */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
}

/* Mostrar el boton y ocultar el menu en moviles */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 45pt;
  }

  .header-nav {
    display: none;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.85);
    position: absolute;
    top: 120px;
    right: 0;
    left:0;
    width: 100%;
    text-align: center;
  }

  .header-nav.active {
    display: flex;
  }

  .header-nav-links {
    padding: 15px;
    color: #fff;
  }
}

.footer-contenedor {
  position: absolute;
  z-index: 2;
  bottom: 0;
  width: 100%;
  height: 150px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.botones-izquierda {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    width: fit-content;
    padding-top: 25px;
    padding-left: 20px;
}


.boton-rojo div, .boton-verde div, .boton-gris div {
    display: flex;
    align-items: center;
    padding: 8px;
}

.botones-izquierda img {
    width: 35px;
}

.botones-izquierda span {
    color: white;
    font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
    font-size: 10pt;
}

.botones-derecha {
    padding-right: 20px;
}

.botones-derecha img {
    width: 80px;
}

@media (max-width: 768px) {
  .footer-contenedor {
      height: 200px;
    }
    
  .botones-izquierda {
      display: flex;
      flex-direction: column;
      padding-left: 20px;
    }
    
  .botones-derecha {
      padding-top: 55px;
    }
}
