/* Paleta y configuración base */
:root {
 --verde: #2E7D32;
 --verde-oscuro: #1B5E20;
 --gris: #333333;
 --gris-claro: #666666;
 --fondo: #FDFEFE;
 --blanco: #FFFFFF;
 --sombra: rgba(0, 0, 0, 0.08);
 --radio-borde: 12px;
 --transicion: all 0.3s ease;
 --linea-divisoria: #e0e0e0; /* Color para las líneas divisorias */
}

html {
    scroll-behavior: smooth;
}

/* Reset básico y tipografía global */
body {
 margin: 0;
 font-family: "Inter", sans-serif;
 background: var(--fondo);
 color: var(--gris);
 line-height: 1.6;
}

h1, h2, h3 {
 font-family: "Poppins", sans-serif;
 font-weight: 700;
 color: var(--gris);
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4rem;
    background: var(--blanco);
    box-shadow: 0 4px 12px var(--sombra);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
}
.logo-img {
    height: 80px;
    width: 90px;
}

.header .logo > span {
    color: red;
    font-family: "Poppins", sans-serif;
    gap: 30px;
    font-size: 2.1rem;
    font-weight: 600;
    text-align: right;
    padding-left: 150px;
}

.header .desktop-nav a {
    margin: 0 1rem;
    text-decoration: none;
    color: var(--gris-claro);
    font-weight: 500;
    transition: var(--transicion);
}
.header .desktop-nav a:hover {
    color: var(--verde);
}
.header .desktop-nav a.btn-primary {
    color: var(--blanco);
}
.btn-primary {
    background: var(--verde);
    color: var(--blanco);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transicion);
}
.btn-primary:hover {
    background: var(--verde-oscuro);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* HERO */
.hero {
    position: relative;
    overflow: hidden;
    height: 30vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    color: var(--blanco);
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.hero h1, .hero .subtitle {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    max-width: 800px;
    margin: 0 auto 1rem;
    color: var(--blanco);
}

.hero .subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
}

/* MAPA */
.mapa {
 display: flex;
 padding: 2rem 4rem;
 gap: 2rem;
}
.map-wrapper {
    flex: 1; 
    min-width: 60%; 
    height: 650px; 
    position: relative; 
    border-radius: var(--radio-borde);
    overflow: hidden; 
    box-shadow: 0 8px 24px var(--sombra);
}
#map {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
}
.loader-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}
.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--verde);
    animation: spin 1s ease infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.search-overlay, .legend-overlay {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px var(--sombra);
    border-radius: 8px;
    z-index: 10;
    padding: 15px;
}
.search-overlay {
    bottom: 20px; left: 20px;
    display: flex;
    align-items: center;
}
.search-overlay i {
    color: #555;
    margin-right: 10px;
}
.search-overlay input {
    border: none; outline: none; background: transparent;
    font-family: "Inter", sans-serif;
    width: 200px; font-size: 1rem;
}
.legend-overlay {
    bottom: 90px; left: 20px;
}
.legend-overlay h4 {
    margin: 0 0 10px 0; font-weight: 600;
}
.legend-overlay ul {
    list-style: none; padding: 0; margin: 0;
}
.legend-overlay li {
    display: flex; align-items: center; margin-bottom: 5px;
}
.legend-overlay li:last-child {
    margin-bottom: 0;
}
.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 10px;
}

/* Panel Lateral */
.panel {
    background: var(--blanco);
    padding: 1.5rem;
    border-radius: var(--radio-borde);
    box-shadow: 0 8px 24px var(--sombra);
    width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.panel h2 {
    margin-top: 0;
}
.panel #panel-content {
    flex-grow: 1;
    border-bottom: 1px solid var(--linea-divisoria);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
}
.panel .panel-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: var(--gris-claro);
}
.panel .panel-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.panel-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.panel-detail-item:last-child {
    border-bottom: none;
}
.panel-detail-item span {
    color: var(--gris-claro);
}
.panel-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--linea-divisoria);
}
.panel-description h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gris);
}
.panel-description p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gris-claro);
    line-height: 1.5;
}

/* BENEFICIOS */
.beneficios {
 text-align: center;
 padding: 4rem 2rem;
 background: #F4F6F6;
}
.beneficios h2 {
    margin-bottom: 3rem;
}
.grid {
 display: flex;
 justify-content: center;
 gap: 2rem;
 flex-wrap: wrap;
}
.card {
    background: var(--blanco);
    border-radius: var(--radio-borde);
    width: 220px;
    padding: 2rem;
    box-shadow: 0 8px 24px var(--sombra);
    text-align: center;
    transition: var(--transicion);
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.card .card-icon {
    font-size: 2.5rem;
    color: var(--verde);
    margin-bottom: 1rem;
}
.card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}
.card p {
 margin: 0;
 color: var(--gris-claro);
}

/* CTA */
.cta {
 text-align: center;
 background: var(--verde);
 color: var(--blanco);
 padding: 4rem 2rem;
}
.cta h2 {
    color: var(--blanco);
}
.cta p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* FOOTER */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gris);
    color: var(--blanco);
    padding: 2rem 4rem;
    flex-wrap: wrap;
}
.footer .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 600;
}



/* --- ESTILOS MEJORADOS PARA EL FOOTER --- */

.social-links {
    display: flex;         /* Activa el contenedor flexible */
    align-items: center;   /* ¡Esta es la clave! Alinea todo verticalmente al centro */
    gap: 15px;             /* Espacio entre los elementos (texto e iconos) */
}

.social-links p {
    margin: 0;             /* Elimina cualquier margen extra del párrafo */
}

.social-links a {
    font-size: 1.5rem;     /* Ajusta el tamaño de los iconos si es necesario */
    display: inline-flex;  /* Ayuda a que el icono se alinee correctamente */
    align-items: center;
}






.footer .links a {
    margin: 0 0.75rem;
    text-decoration: none;
    color: #ccc;
    transition: var(--transicion);
}
.footer .links a:hover {
    color: var(--blanco);
}
.footer p {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    color: #aaa;
}

/* MINI-MAPA */
#mini-map-container {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #e9ecef;
}
#mini-map-container .mapboxgl-ctrl-bottom-left,
#mini-map-container .mapboxgl-ctrl-bottom-right {
    display: none;
}

/* POPUP DEL MAPA */
.custom-popup .mapboxgl-popup-content {
    font-family: "Inter", sans-serif;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 240px;
}
.custom-popup .popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gris);
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.custom-popup .popup-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}
.custom-popup .popup-row strong {
    color: var(--gris);
}
.custom-popup .mapboxgl-popup-tip {
    display: none;
}

/* MENÚ MÓVIL */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gris);
    z-index: 101;
}
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--blanco);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}
.mobile-nav.is-active {
    transform: translateX(0);
}
.mobile-nav a {
    text-decoration: none;
    color: var(--gris);
    font-size: 1.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}
.mobile-nav .btn-primary {
    font-size: 1.2rem;
    margin-top: 1rem;
    color: var(--blanco);
}
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 3rem;
    line-height: 1;
    color: var(--gris-claro);
    cursor: pointer;
}

/* DISEÑO RESPONSIVO */

/* --- ESTILOS PARA TABLETS Y PANTALLAS MEDIANAS --- */
@media (max-width: 1100px) {
    .desktop-nav {
        display: none;
    }
    .hamburger-menu {
        display: block;
    }
    
    .header {
        padding: 1rem 2rem;
    }

    .header .logo > span {
        font-size: 1.5rem;
        padding-left: 20px;
    }
    
    .header .desktop-nav a {
        margin: 0 0.8rem;
    }

    .mapa {
        flex-direction: column;
    }
    .map-wrapper {
        flex: none;
    }
    .panel {
        width: auto;
    }

    .beneficios, .cta {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* --- ESTILOS PARA MÓVILES --- */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    .header, .mapa, .footer {
        padding: 1rem 1.5rem;
    }
    .hero {
        height: 30vh;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .header .logo > span {
        display: block;
        font-size: 1.1rem;
        line-height: 1.3;
        padding-left: 0;
        text-align: left;
    }
    .header .logo span .no-wrap {
        white-space: nowrap;
    }
    .map-wrapper {
        height: 500px;
    }
    .grid {
        gap: 1rem;
    }
    .card {
        width: calc(50% - 2rem);
    }
    .logo-img {
        height: 45px;
    }
}

/* --- ESTILOS PARA MÓVILES MUY PEQUEÑOS --- */
@media (max-width: 480px) {
    .card {
        width: 100%;
    }
    .footer {
        justify-content: center;
        text-align: center;
    }
    .footer .links {
        margin-top: 1rem;
    }
}



/* Ajustes para el botón de video en la sección CTA */
.cta .btn-primary {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Espacio entre el ícono y el texto */
}



/* Estilos para los enlaces sociales en el footer */
.footer .social-links {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.footer .social-links a {
    color: #ffffff;
    font-size: 26px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.footer .social-links a:hover {
    transform: scale(1.1);
    color: #f39c12; /* Color de realce al pasar el mouse */
}


/* --- ESTILOS PARA EL MODAL DE VIDEO --- */

.modal-overlay {
    position: fixed; /* Se queda fijo en la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Se asegura de que esté por encima de todo */
}

.modal-content {
    position: relative;
    background-color: var(--blanco);
    padding: 20px;
    border-radius: var(--radio-borde);
    width: 90%;
    max-width: 800px; /* Ancho máximo del video */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close-btn {
    position: absolute;
    top: -15px; /* Lo posiciona un poco fuera, arriba a la derecha */
    right: -15px;
    background: var(--verde);
    color: var(--blanco);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%; /* Botón circular */
    font-size: 1.8rem;
    line-height: 35px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Proporción 16:9 para el video */
    height: 0;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}