/* 
 * PALETA DE COLORES FINAL
 * Primario: #1F3A5F (Azul Marino Oscuro)
 * Secundario/Acento: #00A99D (Verde Turquesa)
 * Fondo Alterno: #F4F4F4 (Gris Claro)
 * Texto: #333333
 */

/* ------------------ REAJUSTES BÁSICOS ------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Para asegurar que el scroll a IDs funcione correctamente con el header fijo */
    scroll-margin-top: 70px; 
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #333333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h2, h3 {
    margin-bottom: 20px;
    color: #1F3A5F;
    font-weight: 700;
}

section {
    padding: 80px 0;
    overflow: hidden; 
}

/* ------------------ 1. HEADER Y NAVEGACIÓN ------------------ */
.main-header {
    background-color: #1F3A5F; 
    color: #FFFFFF;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    height: 70px; /* Altura fija para referencia en los ajustes de scroll */
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ESTILOS PARA EL LOGO */
.logo-link {
    display: inline-block;
    height: 40px; 
    line-height: 0; 
}

.logo-img {
    height: 100%; 
    width: auto; 
    max-width: 150px; 
}

/* BOTÓN DE HAMBURGUESA (VISIBLE SOLO EN MÓVIL) */
.menu-toggle {
    display: none; /* Oculto por defecto en desktop */
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

/* NAVEGACIÓN DE ESCRITORIO */
.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li a {
    color: #FFFFFF;
    text-decoration: none;
    padding: 10px 10px;
    display: block;
    transition: background-color 0.3s;
    font-weight: 600;
    font-size: 0.95em; 
}

.main-nav ul li a:hover {
    background-color: #00A99D; 
    border-radius: 4px;
}

/* ------------------ 2. HERO SECTION (CABECERA) ------------------ */
.hero-section {
    /* AJUSTE PARA COMPENSAR EL HEADER FIJO EN EL CONTENIDO INICIAL */
    margin-top: -70px; /* Sube la sección 70px (altura del header) */
    padding-top: 70px; /* Baja el contenido de texto 70px para que se vea */

    height: 85vh; 
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section h2 {
    color: #FFFFFF;
    font-size: 3.5em;
    margin-bottom: 10px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.hero-section h3 {
    color: #FFFFFF;
    font-size: 1.8em;
    margin-bottom: 5px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}


.hero-section p {
    color: #F4F4F4;
    font-size: 1.3em;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    background-color: #00A99D; 
    color: #FFFFFF;
    text-decoration: none;
    padding: 15px 35px;
    border-radius: 50px; 
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background-color: #16c1b3; 
    transform: translateY(-2px);
}

/* ------------------ 3. LA EMPRESA (DOBLE COLUMNA) ------------------ */
.mission-section {
    background-color: #FFFFFF; 
}

.mission-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.mission-content .text-content {
    flex: 1;
}

.mission-content .image-content {
    flex: 1;
}

.mission-content img {
    width: 100%;
    height: auto;
    border-radius: 8px; 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ------------------ 4. SECCIÓN SERVICIOS (TARJETAS) ------------------ */
.services-section {
    background-color: #F4F4F4;
    text-align: center;
}

.service-cards {
    display: flex;
    gap: 20px; 
    margin-top: 40px;
    flex-wrap: wrap;
}

.service-card {
    flex: 1 1 22%; 
    min-width: 200px; 
    text-align: center;
    padding: 30px 15px; 
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

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

.service-card i {
    color: #1F3A5F; 
    margin-bottom: 15px;
}

.service-card h4 {
    color: #00A99D; 
    margin-bottom: 10px;
    font-size: 1.2em;
}

.service-card ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-top: 15px;
    font-size: 0.9em;
}
.service-card ul li {
    margin-bottom: 5px;
}

.service-card img {
    width: 100%;
    height: 120px; 
    object-fit: contain;
    border-radius: 4px;
    margin-top: 10px;
    opacity: 0.9;
}


/* ------------------ 5. INSTALACIONES (BLOQUES DE IMAGEN) ------------------ */
.facilities-section {
    background-color: #FFFFFF;
    text-align: center;
}

.facilities-grid {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.facility-block {
    flex: 1;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(31, 58, 95, 0.75); 
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    padding: 30px;
    transition: background-color 0.3s;
}

.facility-block:hover .block-overlay {
    background-color: rgba(0, 169, 157, 0.85); 
}

.block-overlay h4 {
    color: #FFFFFF;
    margin-bottom: 10px;
}

.block-overlay p {
    font-size: 1em;
}


/* ------------------ 6. LEGISLACIÓN (Fondo de color) ------------------ */
.ambiental-section {
    background-color: #1F3A5F; 
    color: #FFFFFF;
    text-align: center;
}

.ambiental-section h3 {
    color: #00A99D; 
    margin-top: 10px;
    margin-bottom: 30px;
}

.ambiental-content i.fa-balance-scale {
    color: #00A99D;
    padding: 15px;
    border: 3px solid #00A99D;
    border-radius: 50%;
}

.cert-list {
    max-width: 650px;
    margin: 30px auto 0;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.cert-list ul {
    list-style: none;
    padding: 0;
    flex: 1 1 45%; 
    min-width: 280px;
    margin-bottom: 15px;
}

.cert-list li {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1em;
}

.cert-list li i {
    color: #FFFFFF; 
    margin-right: 15px;
    width: 20px;
}

/* 7. SECCIÓN LEGAL (POLÍTICA) - SOLO PARA EL ARCHIVO politica-legal.html */
.legal-section {
    background-color: #F4F4F4;
}

.legal-section h4 {
    color: #1F3A5F;
    border-bottom: 2px solid #00A99D;
    padding-bottom: 5px;
    margin-top: 30px;
    margin-bottom: 15px;
}


/* 8. SITUACIÓN (MAPA Y CONTACTO) ------------------ */
.location-section {
    background-color: #FFFFFF;
}

.location-content {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    align-items: stretch; 
}

.location-map {
    flex: 3; 
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-map iframe {
    display: block; 
}

.location-info {
    flex: 2;
    background-color: #F4F4F4; 
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-info h4 {
    color: #1F3A5F;
    border-left: 5px solid #00A99D;
    padding-left: 15px;
    margin-bottom: 25px;
}

.location-info p {
    margin-bottom: 18px;
}


/* 9. FOOTER ------------------ */
footer {
    background-color: #1F3A5F; 
    color: #D9D9D9;
    padding-top: 50px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    border-bottom: 1px solid #2a415a;
    padding-bottom: 30px;
}

footer h4 {
    color: #FFFFFF;
    margin-bottom: 15px;
    font-size: 1.2em;
}

footer a {
    color: #D9D9D9;
    text-decoration: underline;
}

.footer-grid p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-grid i {
    color: #00A99D;
    margin-right: 10px;
    width: 20px; 
    text-align: center;
}

.footer-copy {
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
}

.social-icons-footer a {
    color: #D9D9D9;
    margin-right: 15px;
    transition: color 0.3s;
}

.social-icons-footer a:hover {
    color: #00A99D; 
}

/* ------------------ BANNER DE COOKIES (LSSI/GDPR) ------------------ 
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1F3A5F; 
    color: #FFFFFF;
    padding: 15px 0;
    z-index: 1001; 
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.cookie-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-banner p {
    margin: 0;
    flex-grow: 1;
    font-size: 0.9em;
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-info-cookie {
    color: #FFFFFF;
    text-decoration: underline;
    font-size: 0.9em;
    transition: color 0.3s;
}

.btn-info-cookie:hover {
    color: #00A99D;
}

.cta-button-cookie {
    background-color: #00A99D; 
    color: #FFFFFF;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap; 
}

.cta-button-cookie:hover {
    background-color: #16c1b3;
}
*/
/* ------------------ BANNER DE COOKIES (LSSI/GDPR) ------------------ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1F3A5F; 
    color: #FFFFFF;
    padding: 15px 0;
    z-index: 1001; 
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    /* **AÑADIDO/CORREGIDO** - Asegura visibilidad por defecto */
    display: flex; 
}

.cookie-banner .container {
    display: flex; /* Se mantiene aquí para el layout interno */
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-banner p {
    margin: 0;
    flex-grow: 1;
    font-size: 0.9em;
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-info-cookie {
    color: #FFFFFF;
    text-decoration: underline;
    font-size: 0.9em;
    transition: color 0.3s;
}

.btn-info-cookie:hover {
    color: #00A99D;
}

.cta-button-cookie {
    background-color: #00A99D; 
    color: #FFFFFF;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap; 
}

.cta-button-cookie:hover {
    background-color: #16c1b3;
}

/* ------------------ MEDIA QUERIES (SOLUCIÓN MENÚ MÓVIL Y SCROLL) ------------------ */
@media (max-width: 992px) {
    
    /* 1. SOLUCIÓN FINAL: Ajuste para que el scroll a cualquier sección no quede tapado por el header fijo */
    section {
        padding-top: 100px; /* Suficiente espacio libre bajo el header */
        margin-top: -70px; /* Sube la sección para que el ID de ancla esté justo debajo del header */
    }
    
    /* La sección Hero necesita un ajuste manual adicional por ser la primera */
    .hero-section {
        margin-top: -70px; 
        padding-top: 100px; /* Empuja el contenido de texto dentro del hero hacia abajo */
        padding-bottom: 80px; /* Asegura que el hero no sea excesivamente alto */
    }

    /* 2. MOSTRAR BOTÓN DE HAMBURGUESA */
    .menu-toggle {
        display: block;
    }

    /* 3. OCULTAR NAVEGACIÓN POR DEFECTO Y APLICAR ESTILOS DE MÓVIL */
    .main-nav {
        /* Estilos para el menú colapsado */
        position: absolute;
        top: 70px; 
        left: 0;
        width: 100%;
        background-color: #1F3A5F;
        box-shadow: 0 4px 5px rgba(0, 0, 0, 0.2);
        max-height: 0; 
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    /* 4. ESTADO ACTIVO (MOSTRADO) */
    .main-nav.active {
        max-height: 500px; 
        padding-bottom: 10px;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .main-nav ul li {
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .main-nav ul li:last-child {
        border-bottom: none;
    }

    .main-nav ul li a {
        padding: 12px 15px; 
    }
    
    /* Adaptabilidad de contenido */
    .mission-content,
    .facilities-grid,
    .location-content,
    .footer-grid {
        flex-direction: column;
    }
    
    .service-cards {
        gap: 30px;
    }
    .service-card {
        flex: 1 1 45%; 
        margin: 0 auto;
    }

    .location-info {
        order: -1; 
        margin-bottom: 30px;
    }

    .cookie-banner .container {
        flex-direction: column;
        text-align: center;
    }
    .cookie-actions {
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    
    /* Header sigue en una sola línea (Logo y Botón) */
    .main-header .container {
        flex-direction: row;
        text-align: left;
    }

    .logo-img {
        max-width: 120px; 
    }
    
    .hero-section {
        height: 60vh;
    }
    
    .hero-section h2 {
        font-size: 2em;
    }

    .service-card {
        flex: 1 1 100%; 
    }
}
