/* ================= VARIABLES Y RESET ================= */
:root {
    /* Colores extraídos del diseño */
    --color-blue-dark: #0A2133; /* Color principal del footer y overlays */
    --color-blue-teal: #0E3C55; /* Variación para gradientes */
    --color-blue-accent: #3FBCC9; /* Azul claro para títulos y acentos */
    --color-text-white: #FFFFFF;
    --color-text-light-grey: #E0E0E0;
    --color-bg-textured: #F4F7F9; /* Fondo de la sección de tarjetas */
    --color-card-text-dark: #1A3A50;

    /* Fuentes */
    --font-main: 'Montserrat', sans-serif;

    /* Tamaños de contenedor */
    --container-width: 1200px;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-text-white);
    overflow-x: hidden; /* Prevenir scroll horizontal no deseado */
}

/* Clase de utilidad para contenedores centrados */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

a {
    text-decoration: none;
    transition: opacity 0.3s ease;
}

ul {
    list-style: none;
}

/* ================= LOADER STYLES ================= */
.site-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-blue-dark); /* Fondo azul oscuro */
    z-index: 9999; /* Por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.site-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-logo {
    width: 250px; /* Ajusta el tamaño del logo */
    height: auto;
    animation: pulseLogo 2s infinite ease-in-out;
}

.loader-text {
    color: var(--color-text-white);
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Animación suave para el logo */
@keyframes pulseLogo {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ================= HEADER / HERO SECTION ================= */
.hero-section {
    position: relative;
    /* ALTO FIJO PARA DESKTOP, SE AJUSTA EN MÓVIL */
    height: 90vh; 
    min-height: 600px;
    display: flex;
    flex-direction: column;
    /* REEMPLAZAR: url('../assets/images/hero-bg.jpg') */
    background-image: url('../images/hero.webp'); /* Placeholder de Unsplash */
    background-size: cover;
    background-position: center;
    color: var(--color-text-white);
    padding-top: 20px;
}

/* Capa azul oscura semitransparente sobre la imagen */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 33, 51, 0.8), rgba(14, 60, 85, 0.6));
    z-index: 1;
}

/* Asegurar que el contenido esté por encima del overlay */
.navbar, .hero-content {
    position: relative;
    z-index: 2;
}

/* Navbar Styling */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.placeholder-logo {
    font-weight: 700;
    font-size: 1.2rem;
    /* Elimina esto cuando pongas tu imagen de logo */
    /* border: 2px solid white;
    padding: 5px 10px;
    border-radius: 50px; */
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--color-text-white);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--color-blue-accent);
}

/* Botón hamburguesa (oculto en desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

/* Hero Content Styling */
.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Espacio inferior para que no pegue al borde */
    padding-bottom: 100px; 
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 60px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-text-box {
    background-color: rgba(10, 33, 51, 0.85); /* Azul oscuro semitransparente */
    padding: 30px;
    max-width: 600px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-light-grey);
    /* Alineado a la izquierda como en el diseño */
    margin-left: 0; 
}

.hero-text-box p {
    margin-bottom: 15px;
}

/* ================= CARDS SECTION ================= */
.cards-section {
    background-color: var(--color-bg-textured);
    padding: 80px 0;
    /* REEMPLAZAR: background-image: url('../assets/images/texture-pattern.png'); */
    background-size: 200px;
    text-align: center;
}

.section-title {
    color: var(--color-blue-accent);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 60px;
    text-transform: uppercase;
}

.cards-grid {
    display: flex;          /* Usamos Flexbox en lugar de Grid */
    flex-wrap: wrap;        /* Permite que los elementos bajen a la siguiente línea */
    justify-content: center; /* ESTA ES LA CLAVE: Centra todo horizontalmente */
    gap: 40px;              /* Espacio entre tarjetas */
    width: 100%;
}

.card-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    
    /* Calculamos el ancho para que quepan 5 por fila aprox en desktop.
       100% / 5 = 20%, le restamos un poco para compensar el gap.
       flex-basis asegura consistencia.
    */
    flex: 0 1 180px; 
    max-width: 180px; /* Evita que crezcan demasiado */
    margin-bottom: 20px;
}

/* Estilos para los círculos */
.card-icon-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--color-blue-dark);
    /* border: 4px solid var(--color-blue-accent); */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    overflow: hidden;
    padding: 0;       /* Quitamos padding si lo hubiera para que llegue al borde */
    position: relative;
}

.card-icon-circle img {
    margin-top: 12px;
    padding: 14px;
    width: 100%;
    height: auto;
    object-fit: cover; /* La magia: llena el espacio sin estirar la imagen */
    display: block;
}

.card-item:hover .card-icon-circle {
    transform: translateY(-5px);
}

/* Colores específicos */
.sisal-color { background-color: #0a2a3d; }
.laguna-color { background-color: #0a2a3d; }
.bocas-color { background-color: #0a2a3d; }
.celestun-color { background-color: #0a2a3d; }
.arrecife-color { background-color: #0a2a3d; }
.copalita-color { background-color: #0a2a3d; }
.agiabampo-color { background-color: #0a2a3d; }

.card-label {
    color: var(--color-card-text-dark);
    font-weight: 800;
    font-size: 0.95rem; /* Ajuste leve para nombres largos */
    line-height: 1.3;
    text-transform: uppercase;
}


/* ================= GEOPORTAL SECTION ================= */
.geoportal-section {
    /* Gradiente radial similar al diseño */
    background: radial-gradient(circle at 50% 120%, var(--color-blue-accent) 0%, var(--color-blue-teal) 30%, var(--color-blue-dark) 70%);
    height: 350px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.geoportal-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.geoportal-content h2 {
    color: var(--color-text-white);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
}

.highlight-blue {
    color: var(--color-blue-accent);
}

/* Estilo del Botón */
.btn-geoportal {
    display: inline-block;
    background-color: var(--color-blue-accent); /* Color cian/azul claro */
    color: var(--color-blue-dark);
    padding: 15px 35px;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 50px; /* Bordes redondeados */
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    white-space: nowrap; /* Evita que el texto del botón se rompa */
}

.btn-geoportal:hover {
    background-color: var(--color-text-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* ================= FOOTER ================= */
.main-footer {
    background-color: var(--color-blue-dark);
    color: var(--color-text-white);
    padding: 80px 0;
    position: relative;
    overflow: hidden; /* Importante para cortar la ola grande */
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 columnas */
    gap: 40px;
    position: relative;
    z-index: 2; /* Contenido sobre la ola */
}

.footer-brand {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-col h5 {
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1rem;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-links-list a {
    color: var(--color-text-light-grey);
    font-size: 0.9rem;
}

.footer-links-list a:hover {
    color: var(--color-blue-accent);
}

.secondary-links a {
    font-size: 0.85rem;
    opacity: 0.9;
}

.copyright-mark {
    margin-top: 30px;
    font-size: 1.5rem;
    color: var(--color-text-light-grey);
}

/* Redes sociales */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 35px;
    height: 35px;
    /* background-color: var(--color-blue-accent); */
    color: var(--color-blue-dark);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    transition: background-color 0.3s;
}

.social-icon:hover {
    /* background-color: var(--color-text-white); */
    /* Increase size slighly and smooth transition */
    transform: scale(1.1);
    transition: transform 0.3s ease;

}

.footer-logo-container {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 330px;
    height: 330px;
    overflow: hidden;
    z-index: 0;
}
.footer-logo {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 350px;
    height: 350px;
    fill: white;
    opacity: 0.8;
}

/* ================= MEDIA QUERIES (VERSION MÓVIL/TABLET) ================= */

/* Tablet y pantallas medianas (hasta 1024px) */
@media screen and (max-width: 1024px) {
    .cards-grid {
        gap: 30px;
    }
    
    .card-item {
        /* En móvil queremos 2 por fila */
        /* calc(50% - gap) asegura que quepan dos */
        flex-basis: calc(50% - 25px); 
        max-width: 160px; 
    }

    .card-icon-circle {
        width: 90px;
        height: 90px;
    }
}


/* Móvil (hasta 768px) */
@media screen and (max-width: 768px) {
    
    /* --- Header Móvil --- */
    .hero-section {
        height: auto; /* Altura automática en móvil */
        min-height: 100vh;
    }

    .mobile-menu-toggle {
        display: flex; /* Mostrar hamburguesa */
        z-index: 101;
    }

    /* Menú de navegación móvil (oculto por defecto) */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Fuera de la pantalla a la derecha */
        width: 70%;
        height: 100vh;
        background-color: var(--color-blue-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease-in-out;
        z-index: 100;
        padding: 40px;
    }

    /* Clase que añade JS para mostrar el menú */
    .nav-links.nav-active {
        right: 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }
    
    /* Animación del botón hamburguesa cuando está activo */
    .mobile-menu-toggle.toggle-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-menu-toggle.toggle-active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.toggle-active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }


    .hero-title {
        font-size: 2.5rem;
        margin-top: 40px;
        margin-bottom: 30px;
    }

    .hero-text-box {
        margin: 0 auto; /* Centrar la caja de texto en móvil */
        width: 100%;
    }

    /* --- Cards Section Móvil --- */
    .section-title {
        font-size: 1.6rem;
    }

    .cards-grid {
        /* 2 columnas en móvil */
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 15px;
    }

    .card-icon-circle {
        width: 100px;
        height: 100px;
    }

    .card-label {
        font-size: 0.9rem;
    }

    /* --- Geoportal Móvil --- */

    .geoportal-content {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .geoportal-content h2 {
        font-size: 2.2rem;
        text-align: center;
    }

    .geoportal-text-wrapper h2 {
        text-align: center; /* Asegurar centrado del texto */
    }

    /* --- Footer Móvil --- */
    .footer-grid {
        grid-template-columns: 1fr; /* 1 sola columna */
        text-align: center;
        gap: 30px;
    }

    .footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-wave-graphic {
        width: 300px;
        height: 300px;
        right: -50px;
        bottom: -50px;
        opacity: 0.05;
    }
}

/* Móvil pequeño (hasta 480px) */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .cards-grid {
        /* 1 columna en móviles muy estrechos si es necesario, pero 2 suele verse bien */
        /* grid-template-columns: 1fr; */
    }
}