body {
  font-family: "Poppins", sans-serif;
  scroll-behavior: smooth;
  background-color: #f8fafc;
}

.font-title {
  font-family: "Montserrat", sans-serif;
}

/* Estilos para el menú desplegable */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #4059aa;
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  visibility: visible;
}

.dropdown-content a {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s;
}

.dropdown-content a:hover {
  background-color: #1e3a8a;
}

.dropdown::after {
  content: "";
  position: absolute;
  height: 20px;
  width: 100%;
  bottom: -20px;
  left: 0;
}

/* Efecto de subrayado para los elementos del menú */
.nav-link {
  position: relative;
  padding: 0.5rem 0;
  color: #1e40af;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #1e40af;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover {
  color: #dc2626;
}

.nav-link:hover::after {
  width: 100%;
}

/* Animaciones para elementos */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
  opacity: 1;
  transform: translateY(0);
}

/* Estilos para el carrusel principal */
.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 400px; /* Altura reducida del carrusel */
  margin-top: 10px; /* Espacio arriba del carrusel */
}

.carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto; /*esto lo agregue para que funcione el slide y botones*/
}

.carousel-item.active {
  opacity: 1;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 50; /*esto lo agregue para que funcione el slide y botones*/
  transition: background-color 0.3s ease;
}

.carousel-control:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-indicator.active {
  background-color: white;
}

/* Estilos para las tarjetas de niveles */
.level-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.level-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Nuevos estilos para las tarjetas de niveles con colores distintos */
.level-inicial:hover .level-button {
  background-color: #db2777;
}

.level-inicial:hover * {
  color: #db2777 !important;
}

.level-primario:hover .level-button {
  background-color: #1e3a8a;
}

.level-primario:hover * {
  color: #1e3a8a !important;
}

.level-secundario:hover .level-button {
  background-color: #b91c1c;
}

.level-secundario:hover * {
  color: #b91c1c !important;
}

.level-terciario:hover .level-button {
  background-color: #4c1d95;
}

.level-terciario:hover * {
  color: #4c1d95 !important;
}

/* Estilos para los botones de nivel */
.level-button {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Estilos para la sección institucional mejorada */
.institution-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 1rem;
  overflow: hidden;
}

.institution-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.institution-icon {
  transition: transform 0.3s ease;
}

.institution-card:hover .institution-icon {
  transform: scale(1.1);
}

.value-pill {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.value-pill:hover {
  transform: translateY(-3px);
  background-color: #1e40af;
  color: white;
}

/* Estilos para los encabezados de nivel en las imágenes */
.level-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 24px; /* Altura reducida a la mitad */
}

.level-header-text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s ease;
}

.level-card:hover .level-header-text {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Estilos específicos para los títulos de nivel */
.level-title {
  font-size: 1rem;
  font-weight: bold;
  color: white;
}

/* Estilos para el carrusel de instalaciones */
.facilities-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 20px 0;
}

.facilities-container {
  display: flex;
  transition: transform 0.5s ease;
  padding: 0 40px; /* Añadido padding para evitar superposición con los botones */
}

.facility-card {
  flex: 0 0 calc(25% - 20px); /* Ajustado para mostrar exactamente 4 tarjetas */
  margin: 0 10px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.facility-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.facility-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(30, 64, 175, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.facility-control:hover {
  background-color: rgba(30, 64, 175, 1);
}

.facility-prev {
  left: 10px;
}

.facility-next {
  right: 10px;
}

/* Estilos para el + en la galeria instalaciones */
.facility-card.no-hover:hover {
  transform: none;
  box-shadow: none;
}

.facility-card.no-shadow {
  box-shadow: none !important;
}

/* Estilos para la galería modal - REDISEÑADA */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow: hidden;
}

.gallery-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 90%;
  max-height: 600px;
  margin: 2% auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: rgba(15, 23, 42, 0.7);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.gallery-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 1010;
  width: 40px;
  height: 40px;
  background-color: rgba(220, 38, 38, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.gallery-close:hover {
  background-color: rgba(220, 38, 38, 1);
}

.gallery-main {
  width: 100%;
  height: 75%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.gallery-image-container {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.gallery-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(30, 64, 175, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  z-index: 1005;
}

.gallery-control:hover {
  background-color: rgba(30, 64, 175, 1);
}

.gallery-prev {
  left: 15px;
}

.gallery-next {
  right: 15px;
}

.gallery-thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 20%;
  overflow-x: auto;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.gallery-thumbnail {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border: 3px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-thumbnail:hover {
  transform: scale(1.05);
}

.gallery-thumbnail.active {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.gallery-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
  padding: 5px 0;
}

/* Scrollbar personalizado para las miniaturas */
.gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.7);
  border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 1);
}

/* Estilos para el formulario de contacto */
.contact-input {
  transition: border-color 0.3s ease;
}

.contact-input:focus {
  border-color: #1e40af;
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.contact-button {
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.contact-button:hover {
  background-color: #1e3a8a;
  transform: translateY(-2px);
}

.contact-button:active {
  transform: translateY(0);
}

/* Responsive para el carrusel de instalaciones */
@media (max-width: 1280px) {
  .facility-card {
    flex: 0 0 calc(33.333% - 20px);
  }
}

@media (max-width: 1024px) {
  .facility-card {
    flex: 0 0 calc(33.333% - 20px);
  }

  .gallery-content {
    width: 95%;
    height: 90%;
  }
}

@media (max-width: 768px) {
  .facility-card {
    flex: 0 0 calc(50% - 20px);
  }

  .gallery-content {
    width: 95%;
    height: 85%;
    margin: 5% auto;
  }

  .gallery-thumbnail {
    width: 70px;
    height: 50px;
  }
}

@media (max-width: 640px) {
  .facility-card {
    flex: 0 0 calc(100% - 20px);
  }

  .gallery-content {
    width: 95%;
    height: 80%;
    margin: 10% auto;
  }

  .gallery-thumbnail {
    width: 60px;
    height: 45px;
  }
}

/* Carrusel: controles discretos en móvil (sin moverlos) */
@media (max-width: 768px) {
  .carousel-control {
    /* mismas posiciones: centro vertical, costados */
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);

    /* más chicos y con menos contraste */
    width: 28px;
    height: 28px;
    font-size: 14px; /* si usás <i> / SVG dentro */
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    background-color: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.85);
    opacity: 0.35;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    z-index: 5; /* por si hay overlays */
  }
  .carousel-control-prev {
    left: 10px;
  }
  .carousel-control-next {
    right: 10px;
  }

  .carousel-control:active,
  .carousel-control:focus {
    opacity: 0.6;
    background-color: rgba(0, 0, 0, 0.35);
    outline: none;
  }
}

/* en desktop: solo se notan al hover */
@media (hover: hover) {
  .carousel-control {
    opacity: 0.2;
  }
  .carousel:hover .carousel-control {
    opacity: 0.6;
  }
}

/* --- FIX: flechas del carrusel no clickean en el slide 1 móvil --- */

/* Asegurá stacking y clics en las flechas */
.carousel {
  position: relative;
}
.carousel-control {
  z-index: 999 !important; /* por encima de cualquier overlay */
  pointer-events: auto !important; /* el tap SIEMPRE llega a la flecha */
}

/* Las capas que cubren todo el slide NO deben capturar taps */
.carousel .carousel-item > .absolute.inset-0 {
  pointer-events: none !important; /* imagen, capa oscura, overlays de texto */
}

/* Si tu CTA está dentro de un contenedor con pointer-events desactivado,
        garantizamos que el botón siga siendo clickeable */
.carousel .carousel-item a,
.carousel .carousel-item button {
  pointer-events: auto;
}

/* (Tu estilo "sutil" en móvil, sin cambiar la posición) */
@media (max-width: 768px) {
  .carousel-control {
    width: 28px;
    height: 28px;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.85);
    opacity: 0.35;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background-color 0.2s;
  }
  .carousel-control-prev {
    left: 10px;
  }
  .carousel-control-next {
    right: 10px;
  }
}
@media (hover: hover) {
  .carousel-control {
    opacity: 0.2;
  }
  .carousel:hover .carousel-control {
    opacity: 0.6;
  }
}

/* Cuando el menú móvil está abierto, que el carrusel no interfiera */
.menu-open .carousel-control,
.menu-open .carousel-indicators {
  opacity: 0 !important; /* se vuelven imperceptibles */
  pointer-events: none !important; /* no capturan taps detrás del menú */
}

/* ===== Instalaciones: carrusel de fotos (sin tarjetas) ===== */
.facility-photo {
  position: relative;
  border: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 18px;
  cursor: pointer;
  background: #fff;
  transform: translateZ(0);
  outline: none;
}

.facility-photo img {
  width: 100%;
  height: 230px; /* ajustá si querés más alto */
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.facility-photo:hover img {
  transform: scale(1.06);
}

.facility-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.facility-photo:hover .facility-photo-overlay {
  opacity: 1;
}

.facility-photo-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  transform: translateY(6px);
  transition: transform 0.35s ease;
}

.facility-photo:hover .facility-photo-zoom {
  transform: translateY(0);
}

.facility-photo-zoom i {
  color: #1e3a8a;
  font-size: 16px;
}

/* ===============================
   GALERÍA · LIGHTBOX PURO
================================ */

.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.gallery-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  user-select: none;

  /* ✅ para que la imagen reciba gestos (pinch/zoom) */
  pointer-events: auto;

  /* ✅ ayuda a que el navegador permita pinch en la imagen */
  touch-action: pinch-zoom;
}

.gallery-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 22px;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.gallery-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 36px;
  line-height: 1;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-arrow.left {
  left: 24px;
}
.gallery-arrow.right {
  right: 24px;
}

.gallery-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

@media (max-width: 640px) {
  .gallery-arrow {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }
  .gallery-image {
    max-width: 94vw;
    max-height: 78vh;
  }
}

/* Swipe/drag fluido en carrusel instalaciones */
.facilities-carousel {
  touch-action: pan-y; /* permite scroll vertical, y swipe horizontal dentro */
}

#facilities-container {
  will-change: transform;
  transition: transform 0.25s ease;
  cursor: grab;
}

#facilities-container.is-dragging {
  transition: none;
  cursor: grabbing;
}

/* Para swipe en el lightbox sin bloquear scroll */
.gallery-modal {
  touch-action: pan-y;
}

/* Bloquea el scroll cuando el modal está abierto */
body.no-scroll {
  overflow: hidden;
}


