/* --- Variables & Reset --- */
:root {
    --primary-color: #0D47A1; /* Azul Oscuro */
    --secondary-color: #1976D2; /* Azul Medio */
    --accent-color: #E3F2FD; /* Azul muy claro para fondos */
    --text-color: #333333;
    --white: #FFFFFF;
    --gray-light: #f4f4f4;
    --font-main: 'Poppins', sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Utilidades --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
/* Corrección para centrar botones del Hero */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Esto centra horizontalmente el contenido */
    justify-content: center;
    width: 100%;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center; /* Asegura que los botones estén al centro */
    width: 100%;
    margin-top: 30px;
}

/* Corrección para las Tarjetas (Servicios) */
/* Agrega esto para que el texto y botón dentro de las cards se centren */

/* Asegura que el botón no se estire */
.card .btn {
    margin-top: auto; /* Empuja el botón al final si hay diferencias de texto */
    min-width: 150px; /* Tamaño mínimo para uniformidad */
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover { background-color: var(--secondary-color); transform: translateY(-2px); }

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover { background-color: var(--white); color: var(--primary-color); }

.section-padding { padding: 80px 0; }
.text-center { text-align: center; }

h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* --- Header & Nav --- */
/* --- Header & Nav CORREGIDO --- */
/* --- HEADER Y NAVEGACIÓN (BLOQUE CORREGIDO) --- */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 90px;
    /* Usamos flex para centrar todo el contenido del header verticalmente */
    display: flex;
    align-items: center; 
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center; /* CLAVE: Esto centra verticalmente Logo, Menú y Botón */
    width: 100%;
    height: 100%; /* Asegura que use toda la altura disponible */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    flex: 1; /* Empuja hacia la izquierda */
}

/* Menú Centrado */
nav {
    flex: 2; /* Toma el espacio central */
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center; /* Asegura que los textos del menú estén centrados */
    margin: 0; /* Quita márgenes por defecto */
}

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.nav-links a.active { color: var(--secondary-color); font-weight: 700; }

/* --- CORRECCIÓN DEL BOTÓN --- */
/* Apuntamos específicamente al botón que está DENTRO del header */
header .btn-primary {
    display: inline-flex !important; /* Flexbox interno para centrar el texto */
    justify-content: center !important; /* Centra texto horizontalmente */
    align-items: center !important; /* Centra texto verticalmente */
    
    height: 45px !important; /* Altura fija para que no se estire ni se aplaste */
    padding: 0 30px !important; /* Relleno a los lados */
    
    /* Reseteos importantes */
    line-height: normal !important; 
    margin-left: auto; /* Lo empuja a la derecha del todo */
    white-space: nowrap; /* Evita que el texto se parta en dos líneas */
    
    /* Aseguramos que no se estire con el flex del padre */
    align-self: center !important; 
    flex: none; /* Evita que crezca o se encoja */
}

.menu-toggle { display: none; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .menu-toggle { 
        display: block; 
        font-size: 1.5rem; 
        cursor: pointer; 
        color: var(--primary-color);
    }
    
    /* Ocultamos el botón grande en móvil para que no estorbe */
    header .btn-primary { display: none !important; }

    .nav-links {
        position: absolute;
        top: 90px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        display: none; 
        text-align: center;
    }
    
    .nav-links.active { display: flex; }
}

/* --- Responsive Mobile Ajustado --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .navbar .btn { display: none; } /* Ocultamos el botón grande en móvil si quieres, o lo movemos al menú */

    .nav-links {
        position: absolute;
        top: 90px; /* Altura del header */
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        display: none; 
        text-align: center;
    }
    
    .nav-links.active { display: flex; }
}
/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(13, 71, 161, 0.8), rgba(25, 118, 210, 0.6)), url('https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    height: 90vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-buttons { margin-top: 30px; display: flex; gap: 20px; justify-content: center; }

/* --- Cards (Servicios / Features) --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-top: 4px solid var(--secondary-color);
     display: flex;
    flex-direction: column;
    align-items: center; /* Centra los elementos (img, botón) */
    text-align: center;  /* Centra el texto */
    height: 100%;
}

.card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.card h3 { margin: 15px 0; color: var(--primary-color); }
.icon { font-size: 2.5rem; color: var(--secondary-color); margin-bottom: 15px; }

/* --- Footer --- */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 250px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.1); }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer h4 { margin-bottom: 20px; color: var(--accent-color); }
.social-icons a { color: var(--white); margin-right: 15px; font-size: 1.2rem; }

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        display: none; /* JS toggleará esto */
    }
    .nav-links.active { display: flex; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; }
}
/* --- NUEVA CLASE PARA DIVIDIR SECCIONES (Nosotros / Contacto) --- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr; /* PC: 2 Columnas */
    gap: 40px;
    align-items: start; /* Alinea al inicio para que no se estiren raro */
}

/* --- AJUSTES RESPONSIVOS (MÓVIL) --- */
@media (max-width: 768px) {
    /* Forzar 1 sola columna en móviles */
    .split-layout {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    /* Ajustar textos grandes en móvil */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    /* Que el mapa y el formulario no se salgan */
    iframe, form { width: 100% !important; }
}