/* 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: #f0f0f0; /* 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);
    }
}

/*----------------------------- INCIO --------------------------------------------*/

.hero-section {
    width: 100%;
    max-width: 100%; /* Adjust as needed */
    height: 450px; /* Adjust height as needed */
    background-image: url('img/e62959f1e88b14271095866757214a872eb544b6.jpg'); /* Replace with your image path */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align content to the left */
    color: white; /* Default text color for the hero */
    position: relative;
    margin-top: 70px; 
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* Dark overlay for better text readability, adjust opacity as needed */
}

.hero-content {
    position: relative; /* Position relative to allow z-index for content over overlay */
    z-index: 1; /* Ensure content is above the overlay */
    padding: 20px;
    text-align: left;
    margin-left: 5%; /* Adjust margin from the left as seen in the image */
}

.hero-content h1 {
    font-size: 2.5em; /* Adjust font size as needed */
    margin: 0;
    color: #ffffff; /* White color for the first line */
    font-weight: normal; /* Less bold for the first line */
}

.hero-content h2 {
    font-size: 3.5em; /* Adjust font size as needed, larger for the second line */
    margin: 0;
    color: #ffffff; /* White color for the second line */
    font-weight: bold; /* Bold for the second line */
    line-height: 1.2;
}
.text-section {
    display: flex;
    justify-content: center;
    padding: 60px 20px; /* Add more padding top/bottom */
}

.text-container {
    text-align: center;
    max-width: 800px; /* Adjust as needed */
    margin: 0 auto; /* Center the container horizontally */
}

.section-title {
    font-size: 2.2em; /* Adjust as needed */
    color: #E65100; /* Darker orange to match the image more closely */
    margin-bottom: 15px;
    font-weight: bold;
}

/* Note: The image shows "mueven" as a slightly different shade.
   If you want to apply a specific color to "mueven", you'd wrap it in a span in HTML:
   <h2 class="section-title">Soluciones que <span class="highlight">mueven</span> sectores clave</h2>
   And then add this CSS:
   .section-title .highlight { color: #FF9800; }
   For this example, I'll keep the entire title in one color for simplicity,
   as the difference is subtle and might be a render artifact.
*/
.section-description {
    font-size: 1em; /* Adjust as needed */
    color: #666; /* Medium grey for the description */
    line-height: 1.6;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .hero-content {
        margin-left: 5%;
        max-width: 90%;
    }
    .hero-content h1 {
        font-size: 2em;
    }
    .hero-content h2 {
        font-size: 3em;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 350px;
    }
    .hero-content h1 {
        font-size: 1.8em;
    }
    .hero-content h2 {
        font-size: 2.5em;
    }
    .section-title {
        font-size: 1.8em;
    }
    .section-description {
        font-size: 0.9em;
    }
    .text-section {
        padding: 40px 15px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 300px;
    }
    .hero-content {
        padding: 15px;
        margin-left: 3%;
    }
    .hero-content h1 {
        font-size: 1.5em;
    }
    .hero-content h2 {
        font-size: 2em;
    }
    .section-title {
        font-size: 1.5em;
    }
    .section-description {
        font-size: 0.85em;
    }
    .text-section {
        padding: 30px 10px;
    }
}

/*-------------------------------- FOTOS ---------------------------------------*/

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns, equal width */
    grid-template-rows: repeat(3, auto); /* 3 rows, height determined by content */
    gap: 20px; /* Space between grid items */
    max-width: 100%; /* Max width of the grid */
    width: 100%;
}

.grid-item {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden; /* Ensures image corners are rounded */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: relative; /* For overlay text */
    height: 426px; /* Made image blocks smaller */
}

.grid-item .background-image {
    width: 100%;
    height: 100%; /* Make image fill the item */
    object-fit: cover; /* Cover the area without distorting aspect ratio */
    display: block; /* Remove extra space below image */
}

.item-1 .background-image { object-position: 0% 0%; } /* Top-left part of the composite image */
.item-2 .background-image { object-position: 60% 0%; } /* Middle-top part - adjusted */
.item-3 .background-image { object-position: 90% 40%; } /* Top-right part - adjusted */
.item-4 .background-image { object-position: 0% 50%; } /* Middle-left part */
.item-6 .background-image { object-position: 0% 100%; } /* Bottom-left part - adjusted */
.item-7 .background-image { object-position: 100% 100%; } /* Bottom-right part - adjusted */


.overlay-text {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent background for readability */
    padding: 5px 10px;
    border-radius: 5px;
}

/* Align inline SVG icons before paragraph text inside overlay cards */
.overlay-text p {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #ffffff;
}
.overlay-text .overlay-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Blue Card Styling */
.blue-card {
    background:linear-gradient(90deg, #07477D 35.1%, #0D81E3 100%);
    grid-column: span 2; /* Spans 2 columns */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Align text to the left */
    padding: 30px; /* Kept padding for good content spacing */
    color: white;
    text-align: left; /* Ensure text is left-aligned within padding */
    min-height: 220px; /* Ensure blue card is at least the height of image blocks */
}

.blue-card-text {
    font-size: 1.3em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.blue-card-text .highlight {
    font-weight: bold;
    color: var(--primary-orange); /* Gold/yellow color for highlight */
}

.blue-card-button {
    display: inline-block;
    background-color: var(--primary-orange); /* Orange button */
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.blue-card-button:hover {
    background-color: #e68900;
}

/* Specific Grid Placements (if needed for complex layouts, but gap and span often suffice) */
.item-1 { grid-area: 1 / 1 / 2 / 2; }
.item-2 { grid-area: 1 / 2 / 2 / 3; }
.item-3 { grid-area: 1 / 3 / 2 / 4; }
.item-4 { grid-area: 2 / 1 / 3 / 2; }
.item-5 { grid-area: 2 / 2 / 3 / 4; } /* This is the blue card that spans 2 columns */
.item-6 { grid-area: 3 / 1 / 4 / 2; }
.item-7 { grid-area: 3 / 2 / 3 / 2; } /* Placed in the bottom right, leaving item-8 empty in the grid */


/* Responsive adjustments */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
    .blue-card {
        grid-column: span 2; /* Still spans 2 columns */
    }
    .item-1, .item-2, .item-3, .item-4, .item-6, .item-7 {
        grid-area: auto; /* Reset grid area for 2-column layout */
    }
    .grid-item {
        height: 180px; /* Adjust height for medium screens */
    }
    .blue-card {
        min-height: 180px; /* Adjust min-height for medium screens */
    }
        /* Footer */
    footer {
        padding: 30px 15px;
        margin-top: 30px;
    }

    .footer-content {
        flex-direction: column; /* Apila las columnas del footer */
        align-items: center; /* Centra los elementos */
        max-width: 90%; /* Ajusta el ancho máximo */
        padding: 0;
    }

    .footer-content .logo,
    .footer-content .contact-info,
    .footer-content .quick-links {
        max-width: 100%; /* Ocupa todo el ancho */
        text-align: center; /* Centra el texto */
        padding: 0;
        margin-bottom: 20px; /* Espacio entre secciones del footer */
    }

    .sco {
        justify-content: center; /* Centra los iconos sociales */
    }

    .quick-links p { /* El título de "Enlaces Rápidos" */
        text-align: center; /* Centra el título */
    }

    .quick-links a {
        display: block; /* Cada enlace en su propia línea */
        margin-bottom: 5px; /* Espacio entre enlaces */
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr; /* Single column on small screens */
    }
    .blue-card {
        grid-column: span 1; /* Spans 1 column */
    }
    .grid-item {
        height: 160px; /* Further reduce height for small screens */
    }
    .blue-card {
        min-height: 160px; /* Adjust min-height for small screens */
        padding: 20px;
    }
    .blue-card-text {
        font-size: 1.1em;
    }
    .blue-card-button {
        font-size: 0.9em;
        padding: 10px 20px;
    }
        /* Footer */
    footer {
        padding: 20px 10px;
    }

    .footer-content .logo img {
        width: 200px; /* Reduce el tamaño del logo en el footer */
        height: auto;
    }

    .contact-info p,
    .footer-content .logo p,
    .quick-links a {
        font-size: 0.8em; /* Fuente más pequeña para el texto del footer */
    }

    .sco li a {
        font-size: 1.5em; /* Iconos sociales un poco más pequeños */
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .grid-item {
        height: 140px; /* Further reduce height for very small screens */
    }
    .blue-card {
        min-height: 140px; /* Adjust min-height for very small screens */
        padding: 15px;
    }
    .blue-card-text {
        font-size: 1em;
    }
    .blue-card-button {
        font-size: 0.85em;
        padding: 8px 15px;
    }
        /* Footer */
    .footer-content .logo img {
        width: 150px;
    }

    .contact-info p,
    .footer-content .logo p,
    .quick-links a {
        font-size: 0.75em;
    }

    .sco li a {
        font-size: 1.3em;
        margin-right: 8px;
    }
}

/*----------------------------- 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,
.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: 15px; /* Increased space below each paragraph */
    font-size: 1em; /* Adjusted to a more standard base size for body text */
    line-height: 1.1em; /* Added for better readability with increased line spacing */
}

.contact-info p strong {
    font-size: 1.2em; /* Makes the "Contacto:" heading larger than the rest of the paragraph text */
    color: white; /* Use your primary orange color to make it stand out */
    display: block; /* Makes "Contacto:" take its own line */
    margin-bottom: 2px; /* Adds a little space below the bolded heading */
}

.contact-info {
    padding-top: 10px; /* Add some top padding if it's too close to the element above */
    padding-bottom: 10px; /* Add some bottom padding if it's too close to the element below */
}

/* --- CAMBIOS AQUÍ para Enlaces Rápidos --- */
.quick-links {
    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 {
    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 */
}

/* --- Fuerza menú móvil: fondo azul y texto blanco (override específico) --- */
@media (max-width: 768px) {
    /* Panel móvil completo */
    .nav-links {
        background-color: var(--primary-blue) !important;
        color: #ffffff !important;
    }

    /* Enlaces del menú */
    .nav-links a,
    .nav-links a:visited,
    .nav-links a:active {
        color: #ffffff !important;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    }

    /* Submenú: fondo azul y texto blanco. Oculto por defecto en mobile. */
    .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; /* oculto por defecto */
        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;
    }

    /* Mostrar submenú solo cuando se agrega la clase de abierto/activo */
    .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;
    }
}