/* Estilos Generales */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
    background-color: #fff;
    overflow-x: hidden; /* <-- LA SOLUCIÓN CLAVE: Evita el scroll horizontal */
    width: 100%;
}

/* --- Encabezado y Video --- */
.header {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
    background-color: #000;
}

#video-fondo {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: 1;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* --- Barra de Navegación --- */
.navbar {
    position: absolute;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000; /* Z-index base para la navbar */
    height: 70px;
    padding: 0;
    overflow: visible; 
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- LOGO + TITULOS RESPONSIVE --- */
.logo-titulos {
  position: absolute;
  top: 100px;           /* Deja espacio debajo del menú */
  left: 50%;            /* Centra horizontalmente, lo ajustaremos para desktop */
  transform: translateX(-50%); /* Ajuste para centrar, lo ajustaremos para desktop */
  display: flex;
  flex-direction: row;  /* logo y títulos en fila por defecto */
  align-items: center; /* Alinea ítems al centro verticalmente */
  gap: 60px;            /* separación entre logo y títulos */
  z-index: 3;           /* encima del video y overlay */
  color: #fff;
  width: fit-content;   /* Ajusta el ancho al contenido */
  max-width: 90%;       /* Para evitar desbordamiento en anchos intermedios */
  justify-content: center; /* Centra el contenido si hay espacio extra, lo ajustaremos para desktop */
}

/* *** MODIFICACIONES PARA ALINEAR A LA IZQUIERDA EN DESKTOP *** */
@media (min-width: 961px) { /* Aplica solo para pantallas mayores a 960px (desktop) */
  .logo-titulos {
    left: 2rem; /* Alinea a la izquierda, ajusta según el padding de la navbar */
    transform: translateX(0); /* Quita el centrado */
    justify-content: flex-start; /* Alinea el contenido a la izquierda */
    width: auto; /* Permite que el ancho se adapte al contenido en lugar de ser 'fit-content' que puede centrarlo */
    max-width: calc(100% - 4rem); /* Ajusta si es necesario por el padding */
  }

  .titulos {
    text-align: left; /* Asegura que el texto dentro de los títulos esté a la izquierda */
  }
}
/* *************************************************************** */

.logo-image img {
  width: 230px;         /* tamaño del logo en desktop */
  height: auto;
}

.titulos {
  max-width: 600px;
  text-align: left; /* Ya estaba aquí, pero lo mantenemos explícito */
}

/* Estilos del Menú de Escritorio */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 5px;
    text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.8);
    transition: color 0.3s ease-in-out;
}

.nav-menu a:hover {
    color: #cccccc;
}

/* --- Menú de Hamburguesa (Base) --- */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

/* --- ESTILOS RESPONSIVE (Móvil y Tablet) --- */
@media (max-width: 960px) {
    /* Corrige el problema de "recorte" del menú al abrirse */
    .header.menu-open {
        overflow: visible;
    }

    /* Permite que la barra de navegación crezca al abrir el menú */
    .header.menu-open .navbar {
        height: auto;
        z-index: 1002; 
    }

    /* Ajusta la altura de la barra y el logo para móviles */
    .navbar {
        height: 80px; 
    }
    .logo-image {
        height: auto; 
        width: auto;  
    }

    /* Estilos del menú desplegable */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: rgba(20, 20, 20, 0.95);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: left 0.3s ease;
        justify-content: center;
        gap: 30px;
        z-index: 1001; 
        padding: 0; 
    }

    .nav-menu.active {
        left: 0; 
        z-index: 1001; 
    }
    
    .nav-menu li {
        padding: 10px 0;
    }
    
    .nav-menu a {
        font-size: 1.2rem;
    }

    /* Estilos del botón de hamburguesa */
    .hamburger {
        display: block; 
        z-index: 1001;
    }

    /* Animación de la hamburguesa a "X" */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Ajustes específicos para logo y títulos en móvil/tablet */
    .logo-titulos {
        position: relative; 
        top: 90px;          
        left: auto;         
        transform: none;    
        flex-direction: column; 
        align-items: center; 
        gap: 20px;
        margin: 20px auto; 
        width: auto; 
        max-width: 95%; 
    }

    .logo-image img {
        width: 150px; 
    }

    .titulos {
        max-width: 90%; 
        text-align: center; 
        padding: 0 10px; 
    }

    .titulos h1 {
        font-size: 1.8rem; 
        margin: 0.2em 0;
    }

    .titulos p {
        font-size: 0.9rem; 
    }
}

/* --- Secciones de contenido y footer --- */
.content-section { 
    padding: 4rem 2rem; 
    background-color: #f4f4f4; 
    box-sizing: border-box; 
}

.footer { 
    background-color: #333; 
    color: white; 
    padding: 3rem 2rem; 
    box-sizing: border-box; 
}

.footer-container { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    max-width: 1200px; 
    margin: 0 auto; 
}

.footer-contact, .footer-map { 
    flex: 1; 
    min-width: 300px; 
    margin: 1rem; 
}

.footer-contact h3, .footer-map h3 { 
    border-bottom: 2px solid #fff; 
    padding-bottom: 10px; 
    margin-bottom: 15px; 
}

.footer-contact a { 
    color: #4da6ff; 
    text-decoration: none; 
}

.footer-contact a:hover { 
    text-decoration: underline; 
}

@media (max-width: 768px) {
    .footer-container { 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
    }
}

body {
  font-family: 'Montserrat', sans-serif;
  color: #fff; 
}

/* Estilos de los títulos dentro del logo-titulos */
.titulos h1 {
  font-weight: 700;     
  font-size: 2.5rem;    
  margin: 0.3em 0;
  color: white; 
}

.titulos p {
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.4;
  color: white; 
}

.titulos .verde {
  color: #7CFC00;   
  font-weight: 600;
}

/* --- Submenú desplegable por clic --- */
.dropdown {
  position: relative;
}

.dropdown > a {
  cursor: pointer;
  user-select: none;
}

.dropdown-menu {
  display: block;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: rgba(20, 20, 20, 0.95);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-width: 160px;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
  z-index: 1005; 
}

.dropdown-menu li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.dropdown-menu li:last-child { border-bottom: none; }

.dropdown-menu a {
  display: block;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
}
.dropdown-menu a:hover {
  background: rgba(255,255,255,0.1);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- En móvil (menú hamburguesa) --- */
@media (max-width: 960px) {
  .dropdown-menu {
    position: static; 
    background: transparent;
    min-width: auto;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    z-index: auto; 
  }

  .dropdown.open .dropdown-menu {
    max-height: 400px; 
  }

  .dropdown-menu a {
    padding: 12px 0;
  }
}

/* Estilos para la cuadrícula de tarjetas (del index.html) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  padding: 10px;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  background: #fff;
  border: none;
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.3s ease, filter 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-28px);
  filter: brightness(0.95);
}

.card img {
  display: block;
  margin: 0 auto;
}

.card h3,
.card p {
  margin: 0;
}

.card h3 a,
.card p a {
  text-decoration: none;
  color: inherit;
}

main.content-section {
  background-color: #FFF;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 100px 40px;
  box-sizing: border-box;
}

.card-body {
  padding: 15px 20px;
  text-align: center;
}

.card-body h3 {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2a2aad;
  margin: 10px 0;
}

.card-body p {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
}

/* Ajustes para la cuadrícula de tarjetas en diferentes tamaños de pantalla */
@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1199px) and (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}