/* ===============================
   ESTILOS GENERALES
   =============================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #F5A390;
  color: #fff;
}

header {
  background: #F5A390;
  text-align: center;
  padding: 20px;
}

nav a {
  color: #fff;
  margin: 0 10px;
  text-decoration: none;
}

/* Secciones */
.seccion {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.seccion.visible {
  display: block;
  opacity: 1;
}

.boton-volver {
  position: absolute;
  top: 10px;
  right: 15px;
  background-color: #fff;
  color: #F5A390;
  border: none;
  border-radius: 5px;
  padding: 8px 15px;
  cursor: pointer;
}
.boton-volver:hover {
  background-color: #ffd8ce;
}

/* ===============================
   ESTRUCTURA UNIFICADA SECCIONES - MEJORADA
   =============================== */
.contenedor-seccion {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px); /* 🔹 Altura más ajustada */
  padding: 20px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.contenedor-seccion .imagen {
  flex: 1;
  max-width: 450px; /* 🔹 Tamaño más reducido */
}

.contenedor-seccion .imagen img {
  width: 100%;
  height: auto;
  max-height: 500px; /* 🔹 Altura máxima */
  object-fit: cover; /* 🔹 Mejor ajuste de imagen */
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.contenedor-seccion .texto {
  flex: 1;
  max-width: 450px; /* 🔹 Mismo ancho que la imagen */
}

.contenedor-seccion .texto h2 {
  font-size: 2em; /* 🔹 Título más pequeño */
  margin-bottom: 20px;
  color: #fff;
}

.contenedor-seccion .texto p {
  font-size: 1.1em; /* 🔹 Texto más compacto */
  line-height: 1.5;
  margin-bottom: 15px;
}

/* Responsive - MEJORADO */
@media (max-width: 768px) {
  .contenedor-seccion {
    flex-direction: column;
    text-align: center;
    gap: 30px;
    min-height: auto; /* 🔹 Altura automática en móvil */
    padding: 60px 20px 40px; /* 🔹 Más padding arriba para el botón volver */
  }
  
  .contenedor-seccion .imagen {
    max-width: 100%;
  }
  
  .contenedor-seccion .imagen img {
    max-height: 300px; /* 🔹 Imagen más pequeña en móvil */
    width: 90%; /* 🔹 Ancho reducido */
  }
  
  .contenedor-seccion .texto {
    max-width: 100%;
  }
  
  .contenedor-seccion .texto h2 {
    font-size: 1.8em; /* 🔹 Título más pequeño en móvil */
  }
  
  .contenedor-seccion .texto p {
    font-size: 1em; /* 🔹 Texto más pequeño en móvil */
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
  .contenedor-seccion {
    padding: 50px 15px 30px;
    gap: 25px;
  }
  
  .contenedor-seccion .imagen img {
    max-height: 250px; /* 🔹 Aún más pequeño en móviles muy pequeños */
    width: 95%;
  }
  
  .contenedor-seccion .texto h2 {
    font-size: 1.6em;
  }
}

/* Galería */
.galeria-cuadros {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  padding: 20px;
}
.obra {
  width: 200px;
  cursor: pointer;
  text-align: center;
}
.obra img {
  width: 100%;
  border-radius: 10px;
}
.obra:hover {
  transform: scale(1.05);
}

/* Modal */
.ventana-obra {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.contenido-obra {
  background: #fff;
  color: #000;
  padding: 40px 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  position: relative;
}

.contenido-obra img {
  width: 80%;
  height: auto;
  max-height: 50vh;
  border-radius: 10px;
  object-fit: contain;
  margin-bottom: 15px;
}

.cerrar {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 20px;
  background: #F5A390;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 10;
}

.cerrar:hover {
  background: #f7b4a3;
}

/* ===============================
   MEJORAS PARA EL MODAL DE OBRAS
   =============================== */

.galeria-modal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.imagen-principal {
  grid-column: 1 / -1;
  text-align: center;
}

.imagen-principal img {
  width: 90%;
  max-width: 500px;
  max-height: 60vh;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.imagen-secundaria img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.imagen-secundaria img:hover {
  transform: scale(1.05);
}

.video-obra video {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  background: #000;
}

.descripcion-obra {
  grid-column: 1 / -1;
  background: #f8f8f8;
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
  text-align: left;
}

.navegacion-obras {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.boton-navegacion {
  background: #F5A390;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.boton-navegacion:hover {
  background: #f7b4a3;
}

.boton-navegacion:disabled {
  background: #cccccc;
  cursor: not-allowed;
}
