:root {
    --primary-color: #5a7d5a; /* Verde principal inspirado en el logo */
    --secondary-color: #a1b5a1; /* Verde más claro para acentos */
    --dark-color: #333333;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --font-family: 'Poppins', sans-serif;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.bg-light {
    background-color: var(--light-color);
}

/* --- HEADER Y NAVBAR --- */
.header {
    background-color: var(--white-color);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    min-height: 152px; 
    transition: min-height 0.3s ease-in-out;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    transition: padding 0.3s ease-in-out;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-img {
    height: 120px;
    margin-right: 10px;
    transition: height 0.3s ease-in-out;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: all 0.3s ease-in-out;
}

/* --- SECCIÓN HERO (INICIO) --- */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white-color);
    position: relative;
    background-image: url('../img/Patio-canto.jpeg');
    background-size: cover;
    background-position: center;
    overflow: hidden; /* Oculta las diapositivas que están fuera de la vista */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Detrás del texto del hero */
}

.carousel-slide {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out; /* La animación del deslizamiento */
}

.slide {
    min-width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra todo el espacio sin deformarse */
}

/* Posicionamos el contenido del hero por encima del carrusel */
.hero-content {
    z-index: 2; /* Por encima del overlay y el carrusel */
}

/* Flechas de navegación */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.prev-btn {
    left: 2rem;
}

.next-btn {
    right: 2rem;
}

/* Puntos indicadores */
.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: white;
}

/* --- SECCIÓN NOSOTROS --- */
.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

/* --- SECCIÓN SERVICIOS --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white-color);
    padding: 2rem;
    text-align: center;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* --- SECCIÓN GALERIA --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.05);
}

/* --- SECCION SUCURSALES --- */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; /* Espacio entre las tarjetas */
}

.location-card {
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    overflow: hidden; /* Esencial para que el mapa no se salga de los bordes redondeados */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.location-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.location-card iframe {
    /* El mapa no tendrá borde y ocupará todo el ancho de la tarjeta */
    width: 100%;
    border: 0;
}

.location-info {
    padding: 1.5rem;
}

.location-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.location-info p {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre el ícono y el texto de la dirección */
    font-size: 1rem;
    color: #555;
}

.location-info .btn-location {
    margin-top: 1rem; /* Añade un espacio entre la dirección y el botón */
    display: inline-flex; /* Permite alinear el ícono y el texto correctamente */
    align-items: center;
    gap: 8px; /* Espacio entre el texto "Cómo llegar" y el ícono */
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

/* --- SECCIÓN CONTACTO --- */
.contact-content {
    display: flex;
    gap: 3rem;
}

.contact-info, .contact-form {
    flex: 1;
}

.contact-info p {
    margin-bottom: 1rem;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 10px;
}

.contact-form {
    display: flex;
    flex-direction: column;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
}

.contact-form button {
    align-self: flex-start;
    cursor: pointer;
}

/* --- CAPTCHA --- */
.form-group-captcha {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Para que se ajuste en pantallas pequeñas */
}

.form-group-captcha label {
    font-weight: 600;
    color: var(--dark-color);
}

.form-group-captcha input {
    width: 100px; /* Ancho fijo para el campo del resultado */
    margin-bottom: 0; /* Quitamos el margen inferior que tienen los otros inputs */
}

/* --- FOOTER --- */
.footer {
    background-color: var(--dark-color);
    color: var(--white-color);
    padding-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
}

.footer-logo p {
    margin-left: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-social a {
    color: var(--white-color);
    font-size: 1.5rem;
    margin-left: 1.5rem;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    background-color: #222;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
}

.whatsapp-flotante {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 25px;
    right: 25px;
    background-color: #25D366; /* Color oficial de WhatsApp */
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 35px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 1000; /* Asegura que esté por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease; /* Mantenemos la transición para el hover */
}

.whatsapp-flotante:hover {
    transform: scale(1.1); /* Efecto al pasar el mouse */
}


.header.scrolled {
    min-height: 80px; /* Altura del navbar pequeño (50px logo + 32px padding) */
}
/* Estilos para cuando el header tiene la clase .scrolled */
.header.scrolled .navbar {
    padding: 0.5rem 2rem; /* Reducimos el padding vertical para achicar la barra */
}

.header.scrolled .logo-img {
    height: 50px; /* Reducimos la altura del logo */
}

/* --- ESTILOS PARA LA SECCIÓN DE GALERIA CON CARRUSELES --- */
.installations-carousel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem; /* Mantenemos el espacio entre las tarjetas */
}

/* La tarjeta ahora es solo el marco del carrusel, sin paddings ni fondo */
.installation-carousel {
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    overflow: hidden; /* Muy importante para que las imágenes respeten el borde redondeado */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.installation-carousel:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Hacemos que el contenedor del carrusel ocupe toda la tarjeta */
.installation-carousel .carousel-container {
    position: relative;
    width: 100%;
    height: 350px; /* Puedes ajustar esta altura si lo deseas */
}

/* Ajustamos las flechas para que se vean bien en las tarjetas */
.installation-carousel .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.installation-carousel .prev-btn {
    left: 1rem;
}

.installation-carousel .next-btn {
    right: 1rem;
}

/* Ajustamos los puntos */
.installation-carousel .carousel-dots {
    bottom: 1rem;
}

@media (max-width: 768px) {

    /* 1. Arreglo principal: Las grillas se convierten a una sola columna */
    .installations-carousel-grid,
    .locations-grid {
        grid-template-columns: 1fr; /* ¡La solución al desbordamiento! */
    }

    /* 2. Ajustes de tipografía para mejor lectura en pantallas pequeñas */
    .hero-title {
        font-size: 2rem; /* Reducimos el título principal */
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem; /* Reducimos los títulos de sección */
        margin-bottom: 2rem;
    }

    /* 3. Reducir espaciados para un look más compacto */
    .container {
        padding: 2.5rem 1.5rem;
    }

    .about-content, .contact-content {
        flex-direction: column;
        gap: 2rem;
    }

    /* 4. Ajustar el carrusel principal para que no sea tan grande */
    .header {
        min-height: auto; /* Dejamos que la altura sea automática en móvil */
    }
    .header.scrolled {
        min-height: auto;
    }
    .logo-img {
        height: 60px; /* Un tamaño fijo y razonable para el logo en móvil */
    }
    .header.scrolled .logo-img {
        height: 50px; /* Un poco más pequeño al hacer scroll */
    }

    /* 5. Ajustar las flechas del carrusel principal para que no estorben */
    .hero .prev-btn {
        left: 1rem;
    }
    .hero .next-btn {
        right: 1rem;
    }
    
    /* 6. Ajustes para el menú de hamburguesa (ya lo tenías, pero lo incluyo para unificar) */
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px; /* Ajustar si la altura del navbar cambia */
        flex-direction: column;
        background-color: var(--white-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        padding: 1.5rem 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

/* Media query para pantallas muy pequeñas, para asegurar que las grillas no se rompan */
@media (max-width: 420px) {
    .installations-carousel-grid,
    .locations-grid {
        /* Forzamos un ancho mínimo un poco más pequeño si es necesario */
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Estilos para los mensajes de estado del formulario */
#form-status p {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 5px;
    text-align: center;
}
#form-status .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
#form-status .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}