/* ===========================================================
   ESPACIADO DEL CONTENIDO BAJO EL HEADER
   =========================================================== */
main.container {
  margin-top: 120px;
}

@media (max-width: 991px) {
  main.container {
    margin-top: 90px;
  }
}

@media (max-width: 576px) {
  main.container {
    margin-top: 80px;
  }
}

/* ===========================================================
   GALERÍA
   =========================================================== */

.gallery-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  position: absolute;
}

.gallery-container img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-container img:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.image-card {
  text-align: center;
  padding: 0.5rem;
}

.image-card img:hover {
  transform: scale(1.05);
  border: 2px solid white;
}

.image-card h3 {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

/* ===========================================================
   MODAL
   =========================================================== */

.image-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  inset: 0;
  width: 100%;
  height: 105vh;
  background-color: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 0 16px;
  overflow: hidden;
}

/* Imagen del modal en escritorio */
.image-modal img {
  max-width: 45%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 8px;
}

/* Imagen full-width en móviles */
@media (max-width: 991px) {
  .image-modal img {
    max-width: 100%;
    width: 100%;
    max-height: 85vh;
    height: auto;
    border-radius: 0;
    padding: 0 10px;
  }
}

/* Título del modal */
.modal-title {
  margin-top: 16px;
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

@media (max-width: 991px) {
  .modal-title {
    margin-top: 8px;
    padding-bottom: 16px;
  }
}

/* Botón cerrar */
.close-modal {
  position: fixed;
  top: 20px;
  right: 40px;
  font-size: 32px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  z-index: 99999;
}

/* Ajustes específicos para móviles en horizontal */
@media (max-height: 500px) and (orientation: landscape) {
  .image-modal img {
    max-height: 70vh;
    max-width: 80%;
  }

  .modal-title {
    font-size: 1.2rem;
    margin-top: 8px;
  }

  .close-modal {
    font-size: 28px;
    top: 8px;
  }
}

/* ===========================================================
   FLECHAS DE NAVEGACIÓN
   =========================================================== */

/* Flechas estilo limpio */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 55px;
  color: white;
  cursor: pointer;
  user-select: none;
  background: none;
  padding: 0;
}

.nav-arrow:hover {
  background-color: rgba(0,0,0,0.3);
}

/* Ubicación */
.left-arrow {
  left: 5%;
}

.right-arrow {
  right: 5%;
}

/* Ocultar flechas en tablets y móviles */
@media (max-width: 768px) {
  .nav-arrow {
    display: none !important;
  }
}

/* ===========================================================
   RESPONSIVE GRID
   =========================================================== */
@media (max-width: 992px) {
  .gallery-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-container {
    grid-template-columns: 1fr;
  }
}
