@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@350&display=swap');

body,
html {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
  color: #333;
  touch-action: none;
  background-color: rgba(205, 205, 205);
  font-family: 'Segoe UI', Roboto;
}

#logoModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
    flex-direction: column;
}

#logoModal .imagen-contenedor {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#logoModal .imagen-sin-zoom {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  transform-origin: center center;
}

#logoModal .cerrar-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 1001;
}

#logoModal .cerrar-modal:hover,
#logoModal .cerrar-modal:focus {
  color: #bbb;
  text-decoration: none;
}

/**/
/**/

.footer-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 70px;
  padding: 10px 20px;
  flex-direction: row;
  justify-content: space-between;
  z-index: 10;
  color: white;
  box-sizing: border-box;
  display: flex;
}

.logos-left {
  display: flex;
  align-items: center;
  flex-grow: 1;
  justify-content: flex-start;
}

.logos-right {
  display: flex;
  align-items: center;
  flex-grow: 1;
  justify-content: flex-end;
  flex-direction: row;
}

.top-icons {
  display: flex;
  align-items: center;
  flex-grow: 1;
  justify-content: flex-end;
  gap: 10px;
}

.bandera {
  width: 30px;
  height: auto;
}

.logos-left img {
  height: 25px;
  padding-left: 0.2%;
  margin-right: 5px;
}

.marq-logo {
  height: 50px;
  object-fit: contain;
}

/**/
/* Estilos para el overlay superior/inferior */
.top {
  position: fixed;
  /* Lo fijamos en la parte superior */
  width: 100%;
  height: 3%;
  /* Altura de la barra superior para móvil */
  background-color: rgba(255, 255, 255, 0.5);
  /* Color de fondo de la barra superior */
  display: flex;
  /* Usamos flexbox */
  align-items: center;
  /* Centrar verticalmente los elementos */
  justify-content: space-between;
  /* Reparte el espacio */
  z-index: 9995;
  /* Asegura que esté por encima del resto del contenido */
}

.top>a {
  margin-left: 85%;
  white-space: nowrap;
}

.language-selector {
  position: relative;
  /* Para posicionar el desplegable respecto a este contenedor */
  display: inline-block;
  /* Ocupa solo el espacio necesario */
  margin-left: auto;
  /* ESTO ES CLAVE: Empuja el selector de idioma a la derecha */
  z-index: 11;
  /* Asegura que esté por encima de otros elementos */
  height: 100%;
  padding-right: 2%;
  padding-left: 1%;
  width: 1.9%;
}

.current-lang-button {
  background-color: rgba(255, 255, 255, 0);
  /* Fondo del botón actual */
  color: black;
  border-radius: 8px;
  border: none;
  /* Bordes redondeados */
  cursor: pointer;
  font-size: 1em;
  height: 100%;
  /* Ancho mínimo para que se vea bien "ES" o "EN" */
  text-align: center;
  width: 110%;

  display: flex;
  /* Usamos flexbox para alinear el texto y la flecha */
  align-items: center;
  /* Centramos verticalmente */
}

/* Estilo para el texto dentro del botón */
.lang-text {
  margin-right: 8px;
  /* Espacio entre el texto y la flecha */
}

/* Estilo para el icono de la flecha */
.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid black;
  /* La flecha apunta hacia abajo por defecto */
  transition: transform 0.3s ease;
}

/* Estilo para la flecha cuando el menú está abierto */
.dropdown-arrow.open {
  transform: rotate(180deg);
}

.lang-dropdown {
  display: none;
  /* Oculto por defecto */
  position: absolute;
  background-color: rgba(255, 255, 255, 0.5);
  /* Fondo del menú desplegable */
  z-index: 1;
  border-radius: 8px;
  right: 33%;
  /* Alinea el desplegable a la derecha del botón */
  top: 100%;
  /* Coloca el desplegable justo debajo del botón */
  margin-top: 5px;
  /* Pequeño espacio entre botón y desplegable */
  overflow: hidden;
  /* Asegura que los bordes redondeados se vean bien */

}

.lang-dropdown a {
  color: black;
  padding: 10px 12px;
  text-decoration: none;
  display: block;
  text-align: center;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.lang-dropdown a:hover {
  background-color: #575757;
  color: white;
  /* Color al pasar el ratón */
}

.lang-dropdown.show {
  display: block;
  /* Clase para mostrar el desplegable con JavaScript */
}


/* Contenedor de pagina */
.pagina {
  position: fixed;
  top: 50%;
  left: 2%;
  transform: translateY(-50%);
  width: auto;
  height: 150px;
  background-color: rgba(100, 100, 100, 0.7);
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 19px 0;
  z-index: 999;
}


.ui-controls {
  gap: 15px;
  padding: 0 10px;
}

.flecha {
  width: 100%;
  height: 100%;
  border: none;
  color: white;
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flecha img {
  width: 20%;
  height: 20%;
}

.casa img {
  width: 100%;
  height: 100%;

}

.flecha:disabled {
  background-color: #cccccc;
  /* Color cuando el botón está deshabilitado */
  cursor: not-allowed;
}


/* Contenedor de plantas */
.planta-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  overflow: hidden;
  /* para que no se salga el zoom */
}

.planta-container {
  position: relative;
  width: 1920px;
  /* tamaño real del plano base */
  height: 1080px;
}


@keyframes heartbeat360 {
  0% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }

  5% {
    transform: scale(calc(0.85 * var(--inverseScale, 1))) rotateX(180deg);
  }

  10% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }

  15% {
    transform: scale(calc(0.85 * var(--inverseScale, 1))) rotateX(180deg);
  }

  20% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }

  40% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }

  45% {
    transform: scale(calc(0.85 * var(--inverseScale, 1))) rotateX(180deg);
  }

  50% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }

  55% {
    transform: scale(calc(0.85 * var(--inverseScale, 1))) rotateX(180deg);
  }

  62.5% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }

  100% {
    transform: scale(var(--inverseScale, 1)) rotateX(180deg);
  }
}

.heartbeat360 {
  animation: heartbeat360 8s ease-in-out infinite;
  --inverseScale: 1;
}

.planta-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* Que ocupe todo el ancho del contenedor */
  height: 100%;
  /* Que ocupe todo el alto del contenedor */
  object-fit: contain;
  /* Asegura que la imagen mantenga proporción */
  z-index: 1;
}

.planta-container img:nth-child(1) {
  top: 14%;
  left: 1%;
  height: 80%;
  z-index: 1;
}

.planta-container a:nth-child(2)>img {
  top: 48%;
  left: 47.5%;
  height: 18%;
  width: 8%;
  transform: rotatex(180deg);
  z-index: 999;
}

.planta-container a:nth-child(3)>img {
  top: 30%;
  left: 49%;
  height: 10%;
  width: 5%;
  z-index: 999;
}

/* Cuadros de información */
.info-box_2,
.info-box_3 {
  background-color: white;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  text-align: center;
  box-shadow: 0 5px 15px rgba(80, 80, 80, 0.5);
  z-index: 1001;
  position: absolute;
  padding: 4px 6px;
  white-space: nowrap;
}

.info-box_2 h3,
.info-box_3 h3 {
  color: black;
  font-family: 'Segoe UI', Roboto;
  font-weight: 350;
  font-size: 16px;
  margin: 0;
}

/* Posición del info-box */
.info-box_2 {
  top: 49%;
  left: 48%;
}

.info-box_3 {
  top: 29%;
  left: 48%;
}

.planta-container a:nth-child(2):hover .info-box_2,
.planta-container a:nth-child(3):hover .info-box_3 {
  opacity: 1;
  pointer-events: auto;
}

/* Estilos del cartel emergente */
.infobox-popup {
  background-color: white;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  text-align: center;
  box-shadow: 0 5px 15px rgba(80, 80, 80, 0.5);
  z-index: 1001;
  position: absolute;
  padding: 4px 6px;
  white-space: nowrap;

}

.infobox-popup h3 {
  overflow-wrap: break-word;
  white-space: normal;
  margin: 0%;
}

.infobox-overlay {
  z-index: 1000;
}

.infobox-popup {
  z-index: 1001;
}

#mobileOverlay {
  display: none;
  position: fixed;
  flex-direction: column;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(205, 205, 205);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#mobileOverlay .overlay-image {
  width: 22vmin;
  border-radius: 10px;
}

#mobileOverlay p {
  color: #2D2926;
  ;
  font-family: 'Segoe UI', Roboto;
  font-weight: 350;
}

#gif-container {
  position: fixed;
  width: 100%;
  height: 100%;
  display: none;
  /* oculto por defecto */
   z-index: 999;
  /* por encima de todo */
  animation: fadeIn 0.5s ease-in-out;
  overflow: hidden;
    pointer-events: none;
}

#gif-container img {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15%;
  height: auto;
  margin: 0 auto;
  /* centra horizontalmente */
}

/* Animaciones suaves */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}


/* Responsive (móvil) */
@media (max-width: 768px) {

  body,
  html {
    overflow: hidden;
  }

  .planta-wrapper {
    width: 100%;

  }

  .planta-container {
    position: relative;
    width: 1880px;
    height: 832px;
  }


  #mobileOverlay {
    display: flex;
  }

}


@media (max-width: 932px) and (orientation: landscape) {
  .top {
    padding: 5px 0px;
    justify-content: center;
  }

  .language-selector {
    padding-right: 5%;
  }
}

@media (max-width: 768px) {

  .top>a {
    margin-right: 5%;
    margin-left: 45%;
    white-space: nowrap;
  }
}
@media(max-height: 500px){
 #mobileOverlay {
    display: none;
  }
}
@media(max-height: 500px)  or (max-width: 1200px) {

  #gif-container img {
    width: 30%;
  }

  .top>a {
    margin-right: 7%;
    margin-left: 50%;
    white-space: nowrap;
  }

  .lang-dropdown {
    right: 10%;
  }

  .logos-left img {
    height: 20px;
    margin-right: 5px;
  }

  .marq-logo {
    height: 25px;
    object-fit: contain;
  }


  #logoModal .cerrar-modal {
    top: -15px;
  }
#logoModal .imagen-contenedor {
  max-width: 80%;
  max-height: 80%;

}
  .img-container {
    right: 20%;
    display: none;
  }

  .current-lang-button {
    font-size: 1em;
    padding: 0;
    height: 100%;
  }

  .dropdown-arrow {
    border-top-width: 4px;
    border-left-width: 3px;
    border-right-width: 3px;
  }

  .lang-dropdown a {
    font-size: 0.75em;
    padding: 6px 8px;
  }

  .language-selector {
    margin-top: 5px;
  }

  .bottom-footer {

    align-items: center;
    justify-content: center;
    padding: 15px;
    height: auto;
    text-align: center;
  }

  .bottom-footer .creditos,
  .bottom-footer .logo-group {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .bottom-footer .creditos img,
  .bottom-footer .logo-group img {
    height: 40px;
    margin: 5px;
  }

  .popup-content {
    width: 90%;
    height: auto;
  }

  .popup-content img {
    height: auto;
    max-height: 80vh;
    width: 100%;
  }



  .pagina {
    bottom: -10px;
    right: 2%;
    height: 10%;
    left: auto;
    /* Menos margen en móviles */
  }

  .ui-controls {
    padding: 0 0;
    gap: 15px;

  }


  /* Contenedor Planta */
  .planta-wrapper {
    width: 100%;

  }

  .planta-container {
    position: relative;
    width: 1880px;
    height: 832px;
  }

  .planta-container img {
    width: 40%;
    height: 40%;
    object-fit: contain;
  }

  .planta-container img:nth-child(1) {
    top: 9% !important;
    left: 7% !important;
  }

  .planta-container a:nth-child(2)>img {
    top: 51% !important;
    left: 23.7% !important;
    height: 12%;
    width: 7%;
  }

  .planta-container a:nth-child(3)>img {
    top: 32% !important;
    left: 26% !important;
    height: 7%;
    width: 3%;
  }


  /* Posición del info-box */

  .info-box_3 {
    top: 30%;
    left: 32%;
  }


  /* Ajustes footer */

  .footer-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 70px;

  }

  /* Popup */
  .popup-content {
    width: 90%;
    height: auto;
  }

  .popup-content img {
    height: auto;
    max-height: 80vh;
    width: 100%;
  }
}