/* Definición de Variables */
:root {
    --verde-principal: #059669; 
    --verde-claro: #f0fdf4; 
    --verde-acento: #a7f3d0; 
    --verde-titulo-seccion: #004d40;
}

/* Estilos Generales */
/* 1. Aplicar fuentes globales */
body { 
    font-family: 'Open Sans', sans-serif; /* Letra para el texto normal */
    font-size: 16px;
    letter-spacing: 0.01em; /* Un poco de aire entre letras */
    color: #2d3748; /* Un gris muy oscuro es más legible que el negro puro */
}

/* 2. Títulos con Montserrat (más impacto) */
h1, h2, h3, .button, nav ul li a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: none; /* Puedes usar uppercase si quieres un look más corporativo */
}

/* 3. Mejorar la lectura del Banner principal */
#inicio h1 {
    font-size: 4em;
    line-height: 1.1;
    letter-spacing: -0.02em; /* Títulos grandes se ven mejor más juntos */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Mejora el contraste sobre la imagen */
}

/* 4. Mejorar legibilidad en servicios y párrafos */
.service-card p {
    line-height: 1.7; /* Más espacio entre líneas ayuda a leer textos largos */
    font-size: 15px;
    color: #4a5568;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

/* 5. Estilo de los enlaces del menú */
nav ul li a {
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

/* 6. Formulario */
label {
    font-size: 0.9rem;
    color: var(--verde-titulo-seccion);
    margin-bottom: 5px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Encabezado Principal */
header {
    background-color: var(--verde-principal); 
    color: white;
    padding: 15px 0;
    position: sticky; 
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo { 
    max-width: 100px; 
    display: block; 
}

/* Navegación */
nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: flex-end; 
    gap: 30px;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: white; 
    font-weight: bold;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--verde-acento); 
}

/* Sección Héroe */
#inicio {
    padding: 80px 20px;
    text-align: center;
    background: url('encabezado1.png') no-repeat center center/cover; 
    color: white;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

#inicio::before { 
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7); 
    z-index: 1;
}

#inicio h1 {
    font-size: 3.5em; 
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

#inicio p {
    position: relative;
    z-index: 2;
}

/* Botones */
.button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background-color: var(--verde-principal); 
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s;
    position: relative; 
    z-index: 2;
}

.button:hover {
    background-color: #047857; 
}

/* Secciones y Títulos */
section {
    padding: 60px 0;
}

section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: var(--verde-titulo-seccion); 
}

#inicio, #servicios, #proyectos, #contacto {
    scroll-margin-top: 80px; 
}

#servicios { background-color: #ffffff; }
#proyectos { background-color: #e0f2f1; }

/* Grid de Servicios */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
}

.service-card {
    width: 28%;
    min-width: 250px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background-color: #f9f9f9;
    text-align: left;
}

.service-card h3 {
    color: #00796b;
    margin-top: 0;
}

.service-card p {
    text-align: justify;
}

.cta-text {
    text-align: center;
    margin-top: 50px;
    font-size: 1.2em;
    color: #333;
}

/* Proyectos */
.sub-project-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--verde-titulo-seccion);
}

.project-gallery {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.project-item {
    width: 23%;
    min-width: 150px;
    text-align: center;
}

.project-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.project-item p {
    font-size: 0.9em;
    margin-top: 5px;
}

.banner-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Contacto */
.contact-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
}

#contacto-info {
    flex: 1;
    padding: 20px;
    max-width: 400px;
}

#contacto-info h3 {
    color: var(--verde-titulo-seccion);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.contact-form {
    background-color: #ffffff; 
    padding: 30px; 
    border-radius: 8px; 
    max-width: 500px;
    flex: 1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cert-logo {
    width: 23%;
    min-width: 150px;
    text-align: center;
}

.cert-logo img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Formularios */
label { font-weight: bold; display: block; margin-top: 10px; }
input, textarea { 
    width: 100%; 
    padding: 10px; 
    margin-bottom: 15px; 
    box-sizing: border-box; 
    border: 1px solid #ccc;
    border-radius: 4px;
}

input[type="submit"] { 
    background-color: var(--verde-principal); 
    color: white; 
    border: none; 
    cursor: pointer; 
    padding: 12px;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

input[type="submit"]:hover { 
    background-color: #047857; 
}

/* Pie de página */
footer {
    padding: 20px 0;
    text-align: center;
    background-color: var(--verde-principal); 
    color: var(--verde-acento); 
}

/* Scroll Suave */
html {
    scroll-behavior: smooth;
}

/* Alertas */
.alert {
    padding: 15px;
    margin-top: 10px;
    border-radius: 4px;
}
.alert-success { background-color: #d1e7dd; color: #0f5132; }
.alert-danger { background-color: #f8d7da; color: #842029; }

/* --- ESTILOS RESPONSIVE --- */
/* --- Estilos del Botón Hamburguesa (Oculto en Desktop) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
}

/* --- Media Query para Móviles (Ajustar la que ya tienes) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex; /* Mostrar botón en móviles */
    }

    #main-nav {
        display: none; /* Ocultar menú original */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--verde-principal);
        padding: 20px 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    #main-nav.active {
        display: block; /* Se muestra cuando tiene la clase .active */
    }

    nav ul {
        flex-direction: column;
        gap: 20px;
    }

    /* Animación del botón (se convierte en X) */
    .menu-toggle.open span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.open span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

@media (max-width: 768px) {
    /* Ajustes del Header */
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    nav ul {
        justify-content: center;
        padding: 0;
        gap: 15px;
        flex-wrap: wrap; /* Permite que el menú baje si no hay espacio */
    }

    /* Ajuste del Título Principal */
    #inicio h1 {
        font-size: 2.2em; /* Texto más pequeño en móviles */
    }

    /* Grid de Servicios a 1 columna */
    .service-card {
        width: 100%; /* Ocupa todo el ancho */
        margin-bottom: 15px;
    }

    /* Galería de Proyectos a 2 columnas */
    .project-item {
        width: 45%; 
    }

    /* Contacto en vertical */
    .contact-wrapper {
        flex-direction: column;
        align-items: center;
    }

    #contacto-info, .contact-form {
        max-width: 100%;
        width: 100%;
        padding: 10px;
    }

    /* Formulario: inputs al 100% */
    .contact-form {
        box-shadow: none; /* Menos carga visual en móvil */
        border: 1px solid #e0e0e0;
    }
}

@media (max-width: 480px) {
    /* Proyectos a 1 columna en celulares pequeños */
    .project-item {
        width: 100%;
    }
    
    #inicio h1 {
        font-size: 1.8em;
    }
}