/* ================================
   CONFIGURACIÓN GENERAL
================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Servicios: tres columnas con separadores visibles. */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 40px;
}

.service-column {
    min-width: 0;
    padding: 12px 28px;
    overflow-wrap: break-word;
}

.service-column + .service-column {
    border-left: 2px solid #008c3a;
}

.service-column h3 {
    margin-bottom: 18px;
    color: #055a28;
    font-size: clamp(22px, 2.5vw, 28px);
}

@media (max-width: 700px) {
    .services-grid { grid-template-columns: 1fr; }
    .service-column { padding: 26px 0; }
    .service-column + .service-column {
        border-left: 0;
        border-top: 2px solid #008c3a;
    }
}

/* Nosotros: texto a la izquierda e imagen completa a la derecha. */
.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 680px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 56px);
}

.about-text {
    width: 100%;
    max-width: 680px;
    padding-left: clamp(12px, 2vw, 28px);
}

.about-text p + p {
    margin-top: 18px;
}

.brochure-download {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    margin-top: 24px;
    padding: 12px 16px;
    border: 1px solid #055a28;
    border-radius: 8px;
    color: #055a28;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.pdf-badge {
    padding: 10px 6px;
    border-radius: 4px;
    background: #b3261e;
    color: #fff;
    font-size: 13px;
}

.brochure-download svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.brochure-download:hover {
    background: #edf6ef;
}

.brochure-download:focus-visible {
    outline: 2px solid #008c3a;
    outline-offset: 4px;
}

.about-image {
    display: block;
    justify-self: center;
    width: 100%;
    max-width: 340px;
    height: auto;
}

@media (max-width: 700px) {
    .about-layout { grid-template-columns: 1fr; }
    .about-image {
        max-width: 300px;
        margin-inline: auto;
    }
}

/* Contacto */
.contact-grid {
    display: grid;
    grid-template-columns: 0.85fr 1fr 1.35fr 1fr;
    gap: 32px;
    margin-top: 40px;
    align-items: start;
}

.contact-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.contact-column h3 {
    color: #055a28;
    font-size: 18px;
    margin-bottom: 4px;
}

.contact-column address {
    display: flex;
    flex-direction: column;
    font-style: normal;
}

.contact-column a {
    color: #055a28;
    text-underline-offset: 4px;
}

.contact-social { gap: 22px; }

.contact-social-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 600;
}

.contact-social-link svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.contact-social-link[href]:hover { color: #008c3a; }

.contact-column a:focus-visible {
    outline: 2px solid #008c3a;
    outline-offset: 6px;
}

@media (max-width: 950px) {
    .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* Proyectos: una fila por categoría y textos siempre visibles. */
.project-categories {
    display: grid;
    gap: 48px;
}

.project-category h3 {
    width: fit-content;
    margin-bottom: 22px;
    padding-bottom: 12px;
    color: #055a28;
    font-size: clamp(24px, 2.5vw, 30px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.project-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    overflow-wrap: anywhere;
}

.project-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 707 / 381;
    object-fit: cover;
}

.project-caption {
    padding: 16px;
}

.project-caption h4 {
    margin-bottom: 8px;
    color: #234a34;
    font-size: 18px;
    line-height: 1.35;
}

.section-content .project-caption p {
    font-size: 15px;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 550px) {
    .projects-grid { grid-template-columns: 1fr; }
    .project-categories { gap: 36px; }
}

html {
    scroll-behavior: smooth;
}


body {
    font-family: Arial, Helvetica, sans-serif;
    color: #222;
}


/* Evita que los títulos queden ocultos
   detrás del navbar al usar los botones */

section {
    scroll-margin-top: 100px;
}



/* ================================
   PORTADA
================================ */

.hero {
    width: 100%;
    height: 100vh;

    background-image:
        linear-gradient(
            90deg,
            rgba(0, 55, 35, 0.95) 0%,
            rgba(0, 55, 35, 0.78) 20%,
            rgba(0, 35, 25, 0.35) 45%,
            rgba(0, 0, 0, 0.15) 70%,
            rgba(0, 0, 0, 0.25) 100%
        ),
        url("../images/fondo.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    position: relative;
}



/* ================================
   NAVBAR
================================ */

.navbar {

    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding:
        5px
        clamp(15px, 4vw, 60px);

    position: fixed;

    top: 0;
    left: 0;

    background-color: transparent;

    transition:
        background-color 0.35s ease,
        box-shadow 0.35s ease,
        padding 0.35s ease;

    z-index: 1000;
}



/* Navbar cuando pasamos la portada */

.navbar.scrolled {

    background-color: #1b2024;

    box-shadow:
        0 4px 15px
        rgba(0, 0, 0, 0.25);

    padding:
        0
        clamp(15px, 4vw, 60px);
}



/* ================================
   LOGO
================================ */

.logo {
    flex-shrink: 0;
}


.logo a {
    display: block;
}


.logo img {

    width: clamp(140px, 15vw, 200px);

    height: auto;

    display: block;

    transition:
        width 0.35s ease,
        transform 0.35s ease;
}



/* Logo más pequeño después
   de pasar la portada */

.navbar.scrolled .logo img {

    width: clamp(120px, 11vw, 150px);

    transform: translateY(-3px);
}



/* ================================
   MENÚ ESCRITORIO
================================ */

.menu {

    display: flex;

    align-items: center;

    gap: clamp(5px, 1vw, 15px);
}


.menu a {

    background-color:rgba(0, 55, 35, 0.7); /*#055a28;*/

    color: white;

    text-decoration: none;

    border:
        1px solid
        #055a28;

    padding:
        clamp(8px, 0.8vw, 12px)
        clamp(10px, 1.5vw, 22px);

    font-size:
        clamp(12px, 1.1vw, 15px);

    font-weight: 500;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}



/* Hover */

.menu a:hover {

    background-color: white;

    color: black;

    border-color: white;

    transform: translateY(-2px);
}



/* ================================
   BOTÓN MENÚ MÓVIL
================================ */

.menu-toggle {

    display: none;

    background-color: #008c3a;

    color: white;

    border:
        1px solid
        rgba(255, 255, 255, 0.7);

    width: 45px;
    height: 42px;

    font-size: 24px;

    cursor: pointer;

    align-items: center;
    justify-content: center;
}



/* ================================
   MENÚ MÓVIL DESPLEGABLE
================================ */

.mobile-menu {

    display: none;

    position: fixed;

    top: calc(var(--navbar-height, 100px) + 8px);
    max-height: calc(100dvh - var(--navbar-height, 100px) - 20px);
    overflow-y: auto;
    right: 12px;

    width: 210px;

    background-color: #1b2024;

    padding: 10px;

    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.3);

    z-index: 999;
}


.mobile-menu a {

    display: block;

    width: 100%;

    padding: 13px 15px;

    color: white;

    text-decoration: none;

    font-size: 15px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.15);

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}


.mobile-menu a:last-child {
    border-bottom: none;
}


.mobile-menu a:hover {

    background-color: white;

    color: black;
}



/* ================================
   TEXTO PORTADA
================================ */

.hero-content {
    position: absolute;

    top: 50%;
    left: 7%;

    transform: translateY(-50%);

    text-align: left;

    color: white;

    width: 650px;
    max-width: 85%;

    z-index: 2;
}


.hero-content h1 {
    font-size: clamp(36px, 3.5vw, 58px);

    letter-spacing: 0;

    line-height: 1.08;

    margin-bottom: 25px;

    font-weight: 700;
}



.hero-content p {

    font-size:
        clamp(15px, 2vw, 22px);

    letter-spacing:
        clamp(1px, 0.3vw, 3px);

    font-weight: 300;
}



/* ================================
   SECCIONES
================================ */

.content-section {

    width: 100%;

    min-height: 70vh;

    display: flex;

    justify-content: center;

    align-items: center;

    padding:
        clamp(70px, 8vw, 100px)
        clamp(25px, 5vw, 60px);

    background-color: white;
}



/* Fondo alternativo */

.content-section.alternate {
    background-color: #f5f5f5;
}



/* ================================
   CONTENIDO
================================ */

.section-content {

    width: 100%;

    max-width: 1100px;

    text-align: left;
}

/* Márgenes y alineación comunes para los títulos de las secciones. */
#servicios,
#proyectos,
#nosotros,
#contacto {
    padding-inline: clamp(16px, 3vw, 40px);
    align-items: flex-start;
}

#servicios .section-content,
#proyectos .section-content,
#nosotros .section-content,
#contacto .section-content {
    max-width: none;
}

#contacto {
    min-height: 0;
    padding-bottom: 40px;
}

#servicios .section-content p,
#nosotros .section-content p {
    max-width: none;
}



/* ================================
   TÍTULOS
================================ */

.section-content h2 {

    color: #008c3a;

    font-size:
        clamp(36px, 5vw, 48px);

    letter-spacing: 2px;

    margin-bottom: 30px;
}



/* Línea verde */

.section-content h2::after {

    content: "";

    display: block;

    width: 70px;
    height: 3px;

    background-color: #008c3a;

    margin: 15px 0 0;
}



/* ================================
   TEXTOS
================================ */

.section-content p {

    max-width: 750px;

    margin: 0;

    font-size:
        clamp(16px, 2vw, 19px);

    line-height: 1.7;

    color: #555;
}



/* ================================
   TABLETS
================================ */

@media (max-width: 950px) {

    .menu a {

        padding: 9px 10px;

        font-size: 12px;
    }


    .logo img {
        width: 150px;
    }

}



/* ================================
   CELULARES
================================ */

@media (max-width: 700px) {


    /* Ocultar botones normales */

    .menu {
        display: none;
    }


    /* Mostrar hamburguesa */

    .menu-toggle {
        display: flex;
    }


    /* Navbar */

    .navbar {

        padding:
            5px 12px;
    }


    .navbar.scrolled {

        padding:
            2px 12px;
    }


    /* Logo */

    .logo img {

        width: 130px;
    }


    .navbar.scrolled .logo img {

        width: 115px;

        transform: none;
    }


    /* Mostrar menú al pulsar ☰ */

    .mobile-menu.active {
        display: block;
    }


    /* Portada */

    .hero {

        min-height: 100svh;

        background-position: center center;
    }


    .hero-content {

        width: 92%;
    }


    .hero-content h1 {

        font-size: 38px;

        letter-spacing: 3px;
    }


    .hero-content p {

        font-size: 15px;

        letter-spacing: 1.5px;
    }


    /* Secciones */

    .content-section {

        min-height: 60vh;

        padding:
            110px
            25px
            70px;
    }


    .section-content h2 {

        font-size: 34px;
    }


    .section-content p {

        font-size: 17px;
    }

}



/* ================================
   CELULARES PEQUEÑOS
================================ */

@media (max-width: 400px) {

    .logo img {

        width: 115px;
    }


    .navbar.scrolled .logo img {

        width: 105px;
    }


    .menu-toggle {

        width: 41px;
        height: 39px;

        font-size: 21px;
    }


    .hero-content h1 {

        font-size: 32px;

        letter-spacing: 2px;
    }


    .hero-content p {

        font-size: 14px;
    }


    .mobile-menu {

        right: 10px;

        width: 190px;
    }

}
