/* --- VARIABLES Y RESETEO GENERAL --- */
:root {
  --color-primario: #003366;
  --color-secundario: #0000FF;
  --color-alerta: #d9534f;
  --color-fondo: #f8f9fa;
  --color-texto: #333333;
  --fuente-base: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--fuente-base);
  line-height: 1.6;
  color: var(--color-texto);
  background-color: var(--color-fondo);
}

/* --- NAVEGACIÓN --- */
.header-principal {
  background-color: var(--color-primario);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-bar .menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-bar li {
  position: relative;
}

.nav-bar a {
  display: block;
  padding: 14px 18px;
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}

.nav-bar a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.nav-bar .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-primario);
  min-width: 260px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  list-style: none;
}

.nav-bar .submenu .submenu {
  top: 0;
  left: 100%;
}

.nav-bar li:hover > .submenu {
  display: block;
}

.nav-bar .submenu a {
  font-weight: normal;
  font-size: 13px;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- ESTRUCTURA GENERAL --- */
.contenedor-principal {
  max-width: 1040px;
  margin: 20px auto;
  padding: 0 20px;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.banner-header {
  text-align: center;
  margin-bottom: 25px;
}

.img-responsive {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.alerta-destacada {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  padding: 12px 15px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 6px;
  margin-bottom: 25px;
}

/* --- GALERÍA (GRID FLEXIBLE) --- */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.galeria-item {
  background: #fdfdfd;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.galeria-item h2 {
  font-size: 1.2rem;
  color: var(--color-primario);
  margin-bottom: 12px;
}

.galeria-item img, 
.galeria-item video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 4px;
}

/* --- SECCIÓN CONTACTO Y MAPAS --- */
.enlace-mapa-destacado {
  text-align: center;
  margin: 20px 0;
}

.btn-mapa {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--color-primario);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-mapa:hover {
  background-color: var(--color-secundario);
}

.mapas-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.mapas-container iframe {
  width: 100%;
  height: 400px;
  border-radius: 6px;
}

.info-contacto {
  background-color: #f1f3f5;
  padding: 20px;
  border-radius: 6px;
  margin: 30px 0;
}

.info-contacto h2 {
  color: var(--color-primario);
  margin-bottom: 10px;
}

/* --- CARRUSELES CSS --- */
.carrusel-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

/* Carrusel de Logros (8 imágenes) */
.carrusel-logros {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 700px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.carrusel-logros .slider {
  width: 800%;
  height: 100%;
  display: flex;
  animation: animacionLogros 24s infinite;
}

.carrusel-logros .slide {
  width: 12.5%;
  height: 100%;
}

@keyframes animacionLogros {
  0%, 10% { transform: translateX(0); }
12.5%, 22.5% { transform: translateX(-12.5%); }
25%, 35% { transform: translateX(-25%); }
37.5%, 47.5% { transform: translateX(-37.5%); }
50%, 60% { transform: translateX(-50%); }
62.5%, 72.5% { transform: translateX(-62.5%); }
75%, 85% { transform: translateX(-75%); }
87.5%, 97.5% { transform: translateX(-87.5%); }
100% { transform: translateX(0); }
}

/* Carrusel CIJ / Promociones (3 imágenes) */
.carrusel-cij {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 450px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.carrusel-cij .slider {
  width: 300%;
  height: 100%;
  display: flex;
  animation: animacionCIJ 18s infinite;
}

.carrusel-cij .slide {
  width: 33.333%;
  height: 100%;
}

@keyframes animacionCIJ {
  0%, 28% { transform: translateX(0); }
  33.33%, 61% { transform: translateX(-33.333%); }
  66.66%, 94% { transform: translateX(-66.666%); }
  100% { transform: translateX(0); }
}

.slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- PIE DE PÁGINA --- */
.pie-pagina {
  background-color: #e9ecef;
  text-align: center;
  padding: 20px;
  border-top: 2px solid #dee2e6;
  font-size: 0.9rem;
  margin-top: 40px;
}

.pie-pagina p {
  margin: 5px 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .nav-bar .menu {
    flex-direction: column;
  }
  .nav-bar .submenu {
    position: static;
    box-shadow: none;
    padding-left: 15px;
  }
  .carrusel-logros {
    height: 500px;
  }
  .carrusel-cij {
    height: 300px;
  }
}