/* Reset básico */
* {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Añadido para mejor control del modelo de caja */
}

/* Variables CSS para colores principales y formulario */
:root {
    --primary-orange: #ff6600; /* Un tono de naranja principal */
    --text-color-dark: #333; /* Color oscuro para el texto principal */
    --text-color-medium: #666; /* Color medio para texto secundario */
    --button-bg-color: #FFA500; /* Un naranja para el fondo del botón */
    --primary-blue: #003366;
    --background-blue-shape: #2b5585; /* Color específico de la forma azul de la imagen original "Acerca de" (si aplica) */
    --page-background: #fff; /* Color de fondo general de la página */

    /* Variables específicas para el formulario (integradas) */
    --form-border-color: #e0e0e0;
    --input-border-color: #d1d1d1;
    --placeholder-color: #999;
    --light-orange: #FF7A00; /* Color del botón de enviar y bordes */
    --light-orange-hover: #e06a00; /* Hover del botón de enviar */
    --cancel-button-border: #FF7A00; /* Borde del botón cancelar */
    --form-header-text: #333;
    --form-subtitle-text: #666;
}

/* Estilos generales del cuerpo */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif, 'Poppins'; /* Asegúrate de que Poppins esté aquí si lo usas en HTML */
    overflow-x: hidden; /* Oculta solo el desbordamiento horizontal si ocurre */
    overflow-y: scroll; /* Permite el scroll vertical */
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* Apila las secciones verticalmente */
    background-color: var(--page-background); /* Usar la variable */
    position: relative;
}

/* --- CAMBIOS CLAVE PARA EL OVERLAY GRIS OSCURO --- */
/* Creamos una capa pseudo-elemento ::before que cubrirá todo el body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

body.overlay-active::before {
    opacity: 1;
    visibility: visible;
}

/* Opcional: Impedir el scroll del body cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/*----------------------------- NAV BAR ----------------------------------*/
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 10000; /* Asegura que la navbar esté por encima de todo */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 2px solid #ccc;
    height: 70px;
    transition: background-color 0.3s ease, border-bottom 0.3s ease;
}

.logo-container {
    flex: 0 0 auto;
}

.overlay-image { /* Posiblemente no se use con el nuevo CSS del modal, pero se mantiene */
    max-width: 150px;
    height: auto;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    color: var(--primary-orange);
    text-decoration: none;
    padding: 8px 12px;
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    border-radius: 5px;
}

.nav-links a.active {
    color: #ff6600;
}

.nav-links a:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.2);
    color: #003366;
}

.nav-links li.contacto a {
    color: white;
    padding: 8px 15px;
    transition: color 0.3s ease;
}

.navbar.scrolled {
    background-color: #003366;
    border-bottom-color: #001a33;
}

.nav-links li.contacto a:hover {
    background-color: #e67e00;
    color: white;
    transform: none;
}

.contacto {
    background-color: var(--primary-blue);
    border-radius: 25px;
    transition: background-color 0.3s ease;
}

.contacto a {
    color: white;
    padding: 8px 15px;
}

.contacto a:hover {
    background-color: #e67e00;
    color: white;
    transform: none;
}

main {
    margin-top: 70px; /* Asegura que el contenido no se oculte detrás de la navbar */
    background-color: var(--page-background);
}

/* Estilos básicos para el contenedor del desplegable */
.has-dropdown {
    position: relative;
    z-index: 1001; /* Más alto que el overlay, pero por debajo de la navbar */
}

/* --- ANIMACIÓN PARA EL REBOTE --- */
@keyframes bounceInDownFromTop {
    0% {
        opacity: 0;
        transform: translateY(-80px) scale(0.7); /* Empieza 80px arriba, más pequeño (más atrás) */
    }
    60% {
        opacity: 1;
        transform: translateY(10px) scale(1.05); /* Baja más allá del final y se agranda un poco (primer rebote) */
    }
    75% {
        transform: translateY(-5px) scale(0.98); /* Sube ligeramente y se encoge un poco */
    }
    90% {
        transform: translateY(2px) scale(1.01); /* Baja de nuevo y se agranda casi al final */
    }
    100% {
        transform: translateY(0) scale(1); /* Posición y tamaño final */
    }
}


.dropdown-menu {
    display: block;
    visibility: hidden;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 20px 48px 46px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
    top: 100%; /* Posición inicial relativa al padre */
    right: 0;
    left: auto;
    opacity: 0;
    transition: background-color 0.3s ease-in-out;
    border-radius: 5px;
}

.dropdown-menu.show {
    visibility: visible;
    animation: bounceInDownFromTop 0.8s ease forwards;
}

.dropdown-menu.scrolled {
    background-color: var(--primary-blue);
}


/* Estilo para los enlaces del menú desplegable */
.dropdown-menu li a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.dropdown-menu li a:hover {
    background-color: rgba(0,0,0,0.2);
}

.dropdown-menu.scrolled li a {
    color: white;
}

.has-dropdown:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s; /* Elimina el retraso al mostrar */
}

.dropdown-arrow {
    margin-left: 5px;
    font-size: 0.8em;
}

/* Estilos para el botón de hamburguesa */
.hamburger-button {
    display: none; /* Ocultar por defecto en pantallas grandes */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}

.hamburger-icon {
    width: 35px; /* Ajusta el tamaño de tu imagen */
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* --- Media Query para dispositivos móviles y tabletas --- */
@media (max-width: 768px) {
    .navbar {
        justify-content: space-between;
        align-items: center;
        height: 60px;
        padding: 10px 15px;
    }

    /* Oculta el menú de navegación por defecto */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px; /* Alinea el menú debajo del navbar */
        left: 0;
        background-color: var(--primary-blue, #003366);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 10000;
        padding: 0;
    }

    /* Muestra el menú cuando tiene la clase 'active' */
    .nav-links.active {
        display: flex;
    }

    /* Muestra el botón de hamburguesa en pantallas pequeñas */
    .hamburger-button {
        display: block;
    }

    .nav-links li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a {
        color: white; /* Color de los enlaces en el menú móvil */
        text-align: left;
        padding: 15px 20px;
        font-size: 16px;
    }

    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/*--------------------------------- noticia ----------------------------------*/

.container {
    width: 100%;
    max-width: 1000px;
    margin: 70px auto 0 auto; /* Centered horizontally, 70px top margin for navbar */
    padding: 40px;
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 40px;
    font-weight: 600;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    justify-content: center;
    align-items: start;
}

.card {
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.93);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover{
    transform: translateY(-8px);
    box-shadow: 0 15px 30px var(--primary-orange);
}

.gray-card {
    background-color: rgba(92, 75, 75, 0.1);
    color: #333;
}

.white-card {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.orange-card {
    background-color: #ff6600;
    color: #ffffff;
}

.orange-card:hover{
    transform: translateY(-8px);
    box-shadow: 0 15px 30px var(--primary-blue);
}

.card h2 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

.card p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1; /* Allows paragraph to take available space */
}

.button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.gray-button {
    background-color: #ffffff;
    color: #333;
}

.gray-button:hover {
    background-color: var(--primary-blue);
    color: #fff;
}

.orange-button {
    background-color: #ff6600;
    color: #ffffff;
}

.orange-button:hover{
    background-color: #0066ff;
}

.white-button {
    background-color: #ffffff;
    color: #ff6600;
}

.white-button:hover {
    background-color: #f0f0f0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr; /* Stack cards on smaller screens */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }

    .card {
        padding: 25px;
    }

    .card h2 {
        font-size: 1.3em;
    }

    .card p {
        font-size: 0.9em;
    }

    .button {
        padding: 10px 20px;
        font-size: 0.85em;
    }
}

/*--------------------------------- ayuda --------------------------------------*/

.container {
    width: 100%;
    max-width: 1000px;
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 40px;
    font-weight: 600;
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    justify-content: center;
}

.articles-grid .card { /* Targeting cards within the articles-grid */
    padding: 25px; /* Slightly reduced padding */
}

.articles-grid .card h2 {
    font-size: 1.25em; 
}

.articles-grid .card p {
    font-size: 0.9em;
    margin-bottom: 20px;
}

.articles-grid .button {
    padding: 10px 20px; 
    font-size: 0.85em;
}


.card {
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gray-card {
    background-color: #f5f5f5;
    color: #333;
}

.white-card {
    background-color: #ffffff;
    color: #333;
}

.orange-card {
    background-color: #ff6600;
    color: #ffffff;
}

.card h2 {
    font-size: 1.3em; /* Slightly smaller for more cards in a row */
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

.card p {
    font-size: 0.9em; /* Slightly smaller for more cards in a row */
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.button {
    padding: 10px 20px; /* Slightly smaller buttons */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease;
}

.white-button {
    background-color: #ffffff;
    color: #333;
}

.white-button:hover {
    background-color: #e0e0e0;
}

.orange-button {
    background-color: #ff6600;
    color: #ffffff;
}

.orange-button:hover {
    background-color: #e65c00;
}

/* Responsive adjustments */
@media (min-width: 992px) { /* Screens wider than tablets */
    .articles-grid {
        grid-template-columns: repeat(2, 1fr); /* Forces 2 columns on larger screens */
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Two columns on tablets */
    }
    h1 {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .articles-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }
    .card {
        padding: 25px;
    }
    .card h2 {
        font-size: 1.2em;
    }
    .card p {
        font-size: 0.85em;
    }
    .button {
        padding: 8px 18px;
        font-size: 0.8em;
    }
    .articles-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }
    .articles-grid .card { /* Targeting cards within the articles-grid */
        padding: 20px; /* Further reduced padding for mobile */
    }
    .articles-grid .card h2 {
        font-size: 1.1em;
    }
    .articles-grid .card p {
        font-size: 0.8em;
    }
    .articles-grid .button {
        padding: 8px 15px;
        font-size: 0.75em;
    }
}

/*----------------------------- PIE DE PÁGINA ----------------------------------*/
footer {
    background-color: var(--primary-blue); /* Usar variable para el color */
    color: #ffffff;
    padding: 20px;
    text-align: center;
    margin-top: 50px; /* Margen para separar del contenido superior */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
    padding: 0 20px;
}

/* Define las columnas del pie de página */
.footer-content .logo,
.footer-content .contact-info, /* Se mantiene, aunque el .contact-info-container es el nuevo para la sección principal */
.footer-content .quick-links {
    flex: 1;
    min-width: 280px;
    max-width: 33%;
    text-align: left;
    padding: 0 10px;
}

.footer-content .logo p {
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 10px;
}

.contact-info p {
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* --- CAMBIOS AQUÍ para Enlaces Rápidos --- */
.quick-links {
    /* El padre de los enlaces ahora será un flex container */
    display: flex;
    flex-direction: row; /* Asegura que los ítems se coloquen en fila */
    flex-wrap: wrap; /* Permite que los enlaces se envuelvan si no hay suficiente espacio horizontal */
    gap: 10px; /* Espacio entre los enlaces */
}

.quick-links p { /* Estilo para el título "Enlaces Rápidos:" */
    width: 100%; /* Asegura que el título ocupe su propia línea */
    margin-bottom: 10px; /* Espacio después del título */
    font-weight: bold; /* Hacer el título más visible */
    text-align: left; /* Asegura que el título se alinee con los enlaces */
}

.quick-links a {
    display: inline-block; /* O puedes quitarlo y se comportarán como inline, pero inline-block permite padding/margin vertical */
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 2px 5px; /* Pequeño padding para los enlaces si son inline-block */
    border-radius: 3px; /* Pequeños bordes redondeados */
}

.quick-links a:hover {
    transform: translateX(-8px);
    color: var(--primary-orange); /* Usar variable */
}

/* --- FIN CAMBIOS para Enlaces Rápidos --- */
.sco {
    margin-top: 10px;
    display: flex;
    list-style: none;
    padding: 0;
}

.sco li {
    margin-right: 15px;
}

.sco li a {
    color: #ccc;
    font-size: 2em;
    transition: color 0.3s ease;
}

.sco li a:hover {
    color: var(--primary-orange); /* Usar variable */
}

/* Estilos para el texto de copyright del footer */
.footer-copyright-text {
    margin-top: 20px;
    font-size: 0.9em; /* Aproximadamente 14.4px si el font-size base es 16px */
    color: #ffffff; /* Texto blanco para todo el párrafo */
}

/* Estilos para los enlaces dentro del texto de copyright */
.footer-copyright-text a {
    color: #ffffff; /* Por defecto, los enlaces también serán blancos */
    text-decoration: none; /* Elimina el subrayado por defecto si no lo quieres */
    transition: color 0.3s ease; /* Transición suave para el cambio de color */
}

/* Estilo cuando el mouse pasa por encima del enlace */
.footer-copyright-text a:hover {
    color: var(--primary-orange, #FF6600); /* Naranja cuando el mouse pasa por encima */
    /* Usamos una variable CSS si la tienes definida, o un color hexadecimal directo */
}

/* Estilo para la línea divisoria del footer */
footer > div:nth-of-type(2) { /* Selecciona el segundo div directo dentro del footer */
    border-bottom: 1px solid #ffffff;
    margin-top: 20px;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------
   Reglas integradas desde `Empresas/style.css`
   (navbar overlay, dropdown animation, hamburger y footer móvil)
   Añadidas para mantener consistencia visual entre páginas.
-------------------------------------------------- */

/* Overlay global (capa oscura cuando se activa overlay-active) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

body.overlay-active::before {
    opacity: 1;
    visibility: visible;
}

/* Dropdown animation (copiado) */
@keyframes bounceInDownFromTop {
    0% { opacity: 0; transform: translateY(-80px) scale(0.7); }
    60% { opacity: 1; transform: translateY(10px) scale(1.05); }
    75% { transform: translateY(-5px) scale(0.98); }
    90% { transform: translateY(2px) scale(1.01); }
    100% { transform: translateY(0) scale(1); }
}

.dropdown-menu.show {
    visibility: visible;
    animation: bounceInDownFromTop 0.8s ease forwards;
}

.dropdown-menu.scrolled { background-color: var(--primary-blue); }

/* Hamburger base (copiado) */
.hamburger-button { display: none; background: none; border: none; cursor: pointer; padding: 0; z-index: 10001; }
.hamburger-icon { width: 35px; height: auto; display: block; transition: transform 0.3s ease; }

/* Mobile nav & submenu behavior (copiado) */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; width: 100%; position: absolute; top: 60px; left: 0; background-color: var(--primary-blue, #003366); box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 10000; padding: 0; }
    .nav-links.active { display: flex; }
    .hamburger-button { display: block; }
    .nav-links a { color: white; text-align: left; padding: 15px 20px; font-size: 16px; }

    /* Submenú escondido por defecto en móvil y expande con max-height */
    .nav-links .dropdown-menu {
        background-color: var(--primary-blue) !important;
        box-shadow: none !important;
        position: static !important;
        width: 100% !important;
        left: 0 !important;
        top: auto !important;
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.22s ease-in-out;
    }
    .nav-links .dropdown-menu li a { color: #ffffff !important; padding: 12px 16px !important; display: block !important; text-align: left !important; }
    .nav-links .dropdown-menu li a:hover { background-color: rgba(255,255,255,0.06) !important; color: #ffffff !important; }
    .has-dropdown.open > .dropdown-menu, .has-dropdown.active > .dropdown-menu, .nav-links .dropdown-menu.show { display: block !important; max-height: 1000px !important; overflow: visible !important; }

    /* Footer móvil: apilado y centrado (copiado de Empresas) */
    footer { padding: 24px 16px; text-align: center; }
    .footer-content { flex-direction: column; align-items: center; gap: 12px; padding: 0 10px; }
    .footer-content .logo, .footer-content .contact-info, .footer-content .quick-links { flex: none; min-width: auto; max-width: 100%; text-align: center; padding: 6px 0; }
    .footer-content .logo img { max-width: 180px; height: auto; margin: 0 auto; display: block; }
    .quick-links { flex-direction: column; align-items: center; }
    .quick-links a { display: block; padding: 6px 0; }
    .contact-info p, .footer-copyright-text { font-size: 0.95em; line-height: 1.4; }
    footer > div:nth-of-type(2) { width: 90%; margin-top: 12px; }
}

/* Overrides finales: forzar menú móvil con fondo azul y texto blanco */
@media (max-width: 768px) {
    /* Panel principal del menú */
    .nav-links,
    .nav-links.active {
        background-color: var(--primary-blue, #003366) !important;
        color: #ffffff !important;
    }

    /* Enlaces del menú (incluye submenú) */
    .nav-links a,
    .nav-links li a,
    .nav-links .dropdown-menu li a {
        color: #ffffff !important;
    }

    /* Submenú: fondo siempre azul en móvil */
    .nav-links .dropdown-menu {
        background-color: var(--primary-blue, #003366) !important;
        box-shadow: none !important;
    }

    /* Asegura que los estados hover/active mantengan texto blanco */
    .nav-links a:hover,
    .nav-links .dropdown-menu li a:hover {
        color: #ffffff !important;
        background-color: rgba(255,255,255,0.06) !important;
    }
}
