/* ==========================================================================
   1. VARIABLES GLOBALES Y CONFIGURACIÓN BASE
   ========================================================================== */
@import "variables.css";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

/* COMPENSACIÓN PRECISA PARA TUS 466px DE BANNER + BARRA DE MENÚ */
body {
    background-color: var(--color-blanco);
    color: var(--color-oscuro);
    line-height: 1.6;
    padding-top: 512px; /* 466px del banner + 46px de la barra de navegación */
    transition: padding-top 0.4s ease; /* Transición suave al ocultarse el banner */
}

/* Cuando el usuario baja la página, el cuerpo sube para ajustarse solo al menú fijo */
body.scrolled {
    padding-top: 70px; 
}

main {
    display: block;
    width: 100%; 
}


/* ==========================================================================
   2. CABECERA FLOTANTE CON EFECTO DE OCULTADO SUTIL
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- FILA SUPERIOR: BANNER (Con tus 466px fijos) --- */
#banner-superior {
    background-color: var(--color-principal);
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    max-height: 466px; /* Tu altura real configurada aquí */
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#banner-superior img {
    max-width: 100%; 
    width: 100%;       
    height: 466px; /* Forza la altura exacta para evitar saltos en la carga */
    object-fit: cover; /* Evita que la imagen se distorsione */
    display: block;
}

/* ESTADO SCROLLED: Colapsa el banner por completo */
header.scrolled #banner-superior {
    max-height: 0;
    opacity: 0;
    pointer-events: none; 
    border-bottom: none;
}

/* --- FILA INFERIOR: BARRA DE NAVEGACIÓN Y CONTACTOS --- */
.nav-bar-contacto {
    background-color: var(--color-principal); 
    padding: 12px 40px;
    height: 46px; /* Altura fija para cuadrar las matemáticas del body */
}

.nav-bar-container {
    max-width: 100%; 
    margin: 0 auto;
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

/* IZQUIERDA: Correo y Teléfono Móvil (Solo Informativo) */
.contacto-izquierda {
    display: flex;
    gap: 20px;
}

.contacto-izquierda .contacto-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-blanco);
    font-size: 14px;
    font-weight: 500;
    cursor: default; /* Indica al usuario que es solo texto legible, no interactivo */
}

.contacto-izquierda svg {
    width: 15px;
    height: 15px;
    fill: var(--color-blanco);
}

/* CENTRO: Menú de Navegación Centrado */
#menu-central {
    display: flex;
    gap: 10px;
}

#menu-central a {
    text-decoration: none;
    color: var(--color-blanco);
    font-weight: 600;
    font-size: 15px;
    padding: 4px 18px; /* Ajustado ligeramente el padding vertical */
    border-radius: 4px;
    transition: all 0.3s ease;
}

#menu-central a:hover {
    background-color: var(--color-fondo-claro);
    color: var(--color-principal);
}

/* DERECHA: Iconos de Redes con Círculo de Fondo Claro (#ebfefe) */
.redes-derecha {
    display: flex;
    gap: 12px;
}

.redes-derecha a {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-fondo-claro); 
    width: 28px; /* Tamaño optimizado para encajar en los 46px de alto */
    height: 28px;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

.redes-derecha svg {
    width: 14px;
    height: 14px;
    fill: var(--color-principal); 
}

.redes-derecha a:hover {
    transform: scale(1.1);
    background-color: var(--color-blanco);
}


/* ==========================================================================
   3. MAQUETACIÓN GLOBAL AL 100% DE LA PÁGINA (DOS COLUMNAS EXTENDIDAS)
   ========================================================================= */
.main-layout-container {
    width: 100%; 
    max-width: 100%; 
    padding: 40px; 
    display: flex;
    gap: 40px; 
}

.columna-contenido {
    flex: 75%;
}

.columna-redes {
    flex: 25%;
    background-color: var(--color-gris-fondo); 
    padding: 20px 10px;
    border-radius: 8px;
    border: 1px solid rgba(65, 130, 208, 0.1);
    align-self: flex-start; 
    justify-content: center;
    width: 100%;
    overflow: hidden; /* <-- AGREGA ESTA LÍNEA OBLIGATORIA */
}


.sidebar-title {
    font-size: 20px;
    color: var(--color-oscuro);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.sidebar-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: var(--color-principal);
    margin: 8px auto 0;
}

.widget-contenedor {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    background-color: var(--color-blanco);
    padding: 0px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
}

/* Ajuste específico para centrar el iFrame de Facebook de forma estable */
.widget-contenedor iframe {
    display: block;
    margin: 0 auto;
    background-color: var(--color-blanco);
}

/* Enlace visual de respaldo alternativo para el Widget */
.fb-fallback-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #3b5998; /* Azul oficial de Facebook */
    color: var(--color-blanco);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    margin: 0 auto 15px auto;
    max-width: 340px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.fb-fallback-link:hover {
    background-color: #2d4373;
}

.fb-fallback-link svg {
    width: 14px;
    height: 14px;
    fill: var(--color-blanco);
}


/* ==========================================================================
   4. BLOQUES INTERNOS Y BOTONES DE ACCIÓN (WHATSAPP, HERO Y SERVICIOS)
   ========================================================================== */

/* --- BOTÓN DE WHATSAPP --- */
.whatsapp-container-seccion {
    display: flex;
    justify-content: center;
    padding: 10px 0 30px 0;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: var(--color-principal);
    color: var(--color-fondo-claro);
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(65, 130, 208, 0.3);
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background-color: var(--color-oscuro);
    color: var(--color-blanco);
    transform: translateY(-3px);
}

.btn-whatsapp svg {
    width: 22px;
    height: 22px;
    fill: var(--color-fondo-claro);
}

.btn-whatsapp:hover svg {
    fill: var(--color-blanco);
}

/* --- SECCIÓN INICIO / HERO --- */
.hero {
    background: linear-gradient(135deg, var(--color-fondo-claro) 0%, #ffffff 100%);
    padding: 60px 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid rgba(65, 130, 208, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.hero-content {
    max-width: 800px;
}

.hero-subtitle {
    color: var(--color-principal);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.hero h1 {
    font-size: 42px;
    color: var(--color-oscuro);
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero p {
    font-size: 18px;
    color: var(--color-gris-texto);
    margin-bottom: 30px;
}

.hero .btn {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-principal);
    color: var(--color-blanco);
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(65, 130, 208, 0.25);
    transition: all 0.3s ease;
}

.hero .btn:hover {
    background-color: var(--color-oscuro);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 41, 59, 0.2);
}

/* --- SECCIÓN QUIÉNES SOMOS --- */
.about {
    padding: 20px 0;
    text-align: left; 
}

.section-title {
    font-size: 32px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    color: var(--color-oscuro);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--color-principal);
    margin: 12px 0 0 0; 
    border-radius: 2px;
}

.about p {
    margin-top: 25px;
    font-size: 17px;
    color: var(--color-gris-texto);
}

/* --- SECCIÓN SERVICIOS Y REJILLA --- */
.services {
    padding: 40px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* --- TARJETAS DE SERVICIO --- */
.service-card {
    background-color: var(--color-blanco);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--color-principal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(65, 130, 208, 0.08);
    border-color: rgba(65, 130, 208, 0.3);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card h3 {
    font-size: 20px;color: var(--color-oscuro);
    margin-bottom: 12px;
    font-weight: 700;
}

.service-card p {
    font-size: 15px;
    color: var(--color-gris-texto);
    line-height: 1.6;
}


/* SECCIÓN DE CONTACTO Y FORMULARIO */
.contact-section {
    padding: 40px 0;
    margin-top: 20px;
}

.contact-subtitle {
    font-size: 16px;
    color: var(--color-gris-texto);
    margin-bottom: 30px;
}

.contact-grid {
    display: flex;
    gap: 30px;
}

/* --- COLUMNA DE DATOS DIRECTOS --- */
.contact-info-cards {
    flex: 40%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--color-gris-fondo);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.info-card-icon {
    font-size: 26px;
    background-color: var(--color-blanco);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.info-card-text h4 {
    font-size: 15px;
    color: var(--color-oscuro);
    margin-bottom: 2px;
}

.info-card-text p {
    font-size: 14px;
    color: var(--color-gris-texto);
    margin-top: 0 !important;
}

/* --- COLUMNA DEL FORMULARIO --- */
.contact-form-container {
    flex: 60%;
    background-color: var(--color-blanco);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-oscuro);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--color-oscuro);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-principal);
    box-shadow: 0 0 0 3px rgba(65, 130, 208, 0.15);
}

/* --- BOTÓN DE ENVIAR --- */
.btn-submit {
    background-color: var(--color-principal);
    color: var(--color-blanco);
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(65, 130, 208, 0.2);
    transition: background-color 0.2s, transform 0.2s;
    margin-top: 5px;
}

.btn-submit:hover {
    background-color: var(--color-oscuro);
    transform: translateY(-1px);
}

/* --- ADAPTACIÓN RESPONSIVA PARA MÓVILES --- */
@media (max-width: 992px) {
    .contact-grid {
        flex-direction: column;
        gap: 25px;
    }
    .contact-form-container {
        padding: 20px 15px;
    }
}

/* ==========================================================================
   5. PIE DE PÁGINA INSTITUCIONAL (FOOTER OPERATIVO)
   ========================================================================== */
footer {
    background-color: var(--color-oscuro);
    color: var(--color-blanco);
    padding: 60px 40px 30px 40px;
    margin-top: 40px;
    width: 100%;
}

.footer-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 40px;
}

.footer-columna {
    flex: 1;
}

.footer-columna h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-blanco);
    position: relative;
}

.footer-logo {
    color: var(--color-fondo-claro) !important;
    font-size: 20px !important;
}

.footer-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
}

/* Enlaces Internos del Footer */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-fondo-claro);
}

/* Datos de Atención */
.footer-horario,
.footer-zona {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 15px;
    line-height: 1.5;
}

.footer-horario strong,
.footer-zona strong {
    color: var(--color-blanco);
}

/* Fila Inferior del Footer */
.footer-bottom {
    text-align: center;
    padding-top: 40px;
}

.footer-bottom p {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 5px;
}

.phone-link {
    color: var(--color-fondo-claro);
    font-size: 32px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    transition: color 0.3s, transform 0.2s;
}

.phone-link svg {
    width: 28px;
    height: 28px;
    fill: var(--color-fondo-claro);
    transition: fill 0.3s;
}

.phone-link:hover {
    color: var(--color-blanco);
    transform: scale(1.02);
}

.phone-link:hover svg {
    fill: var(--color-blanco);
}

.copyright {
    margin-top: 30px;
    font-size: 13px;
    color: #64748b;
}

/* --- ADAPTACIÓN DEL FOOTER A MÓVILES --- */
@media (max-width: 992px) {
    footer {
        padding: 40px 20px 20px 20px;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 30px;
        text-align: center;
        padding-bottom: 30px;
    }
    
    .phone-link {
        font-size: 26px;
    }
}

/* ==========================================================================
6. RESPONSIVO (OPTIMIZACIÓN ADAPTATIVA PARA TABLETS Y SMARTPHONES)
========================================================================== */
@media (max-width: 992px) {
    
    /* Reducción proporcional del banner superior en dispositivos móviles */
    #banner-superior {
        max-height: 180px;
    }
    
    #banner-superior img {
        height: 180px;
    }
    
    /* Compensación de espacio inicial en body dinámico vía script */
    body {
        padding-top: 320px;
    }
    
    body.scrolled {
        padding-top: 140px;
    }
    
    /* Configuración adaptativa de la barra de contactos y navegación */
    .nav-bar-contacto {
        height: auto; /* Permite crecimiento dinámico sin desbordar contenido */
        min-height: 140px;
        padding: 12px 15px;
    }
    
    .nav-bar-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .contacto-izquierda {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
    
    #menu-central {
        flex-wrap: wrap; /* Envuelve los enlaces si la pantalla es muy angosta */
        justify-content: center;
        gap: 6px;
    }
    
    #menu-central a {
        font-size: 13px;
        padding: 4px 10px;
    }
    
    .redes-derecha {
        justify-content: center;
    }
    
    /* Maquetación pasa de dos columnas a una sola columna vertical */
    .main-layout-container {
        flex-direction: column;
        padding: 20px 15px;
        gap: 30px;
    }
    
    .columna-contenido,.columna-redes {
        width: 100%;flex: 100%;
    }
    
    /* Escalado adaptativo del bloque de inicio y servicios */
    .hero {
        padding: 40px 20px;
        text-align: center;
        margin-bottom: 30px;
    }
    
    .hero h1 {
        font-size: 30px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .services-grid {
        grid-template-columns: 1fr; /* Una única columna vertical en móviles */
        gap: 20px;
    }
    
    .service-card {
        padding: 25px;
    }
    
    /* Escalado tipográfico cómodo para lectura táctil */
    .section-title {
        font-size: 24px;
    }
    
    .about p {
        font-size: 15px;
        margin-top: 15px;
    }
    
    .phone-link {
        font-size: 24px;
    }
}

/* Ajustes finos adicionales para teléfonos muy pequeños (móviles verticales) */
@media (max-width: 480px) {
    #banner-superior,#banner-superior img {
        max-height: 120px;
    }
    
    body {
        padding-top: 270px;
    }
    
    .btn-whatsapp {
        width: 100%; /* Botón de acción expandido para facilitar el clic táctil */
        justify-content: center;
        font-size: 14px;
    }
}



/* --- OPTIMIZACIONES EXTRAS PARA QUIÉNES SOMOS --- */
.about-lead {
    font-size: 19px !important;
    color: var(--color-oscuro) !important;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 15px;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    background-color: var(--color-gris-fondo);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--color-principal);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.feature-icon {
    font-size: 24px;
    line-height: 1;
    margin-top: 2px;
}

.feature-item h4 {
    font-size: 16px;
    color: var(--color-oscuro);
    font-weight: 700;
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 14px;
    color: var(--color-gris-texto);
    margin-top: 0 !important;
}

/* Adaptación para móviles */
@media (max-width: 992px) {
    .about-lead {
        font-size: 17px !important;
    }
    .about-features {
        padding: 20px 15px;
    }
}


/* ==========================================================================
   7. TEXTOS LEGALES Y POLÍTICA DE COOKIES (CUMPLIMIENTO RGPD)
   ========================================================================== */

/* Casilla de aceptación en el formulario */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0 10px 0;
}

.form-group-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-group-checkbox label {
    font-size: 13px;
    color: var(--color-gris-texto);
}

.legal-link-inline {
    color: var(--color-principal);
    text-decoration: underline;
}

/* Caja oculta de Aviso Legal */
.legal-section {
    display: none; /* Se activa dinámicamente o por ancla CSS */
}

.legal-section:target {
    display: block;
    margin-top: 30px;
}

.legal-box {
    background-color: var(--color-gris-fondo);
    border: 1px solid rgba(65, 130, 208, 0.2);
    padding: 25px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-gris-texto);
}

.legal-box h3 {
    color: var(--color-oscuro);
    margin-bottom: 12px;
}

.legal-box p {
    margin-bottom: 10px !important;
}

.btn-cerrar-legal {
    display: inline-block;
    margin-top: 10px;
    color: var(--color-principal);
    font-weight: 600;
    text-decoration: none;
}

/* Banner flotante de aviso de cookies */
.cookies-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-oscuro);
    color: var(--color-blanco);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    width: 90%;
    max-width: 600px;
    display: none; /* Controlado por JS */
}

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

.cookies-content p {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.btn-cookies {
    background-color: var(--color-fondo-claro);
    color: var(--color-principal);
    border: none;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-cookies:hover {
    background-color: var(--color-blanco);
}

@media (max-width: 768px) {
    .cookies-content {
        flex-direction: column;
        text-align: center;
    }
    .btn-cookies {
        width: 100%;
    }
}

/* Ajuste de adaptabilidad absoluta para el Plugin de Facebook */
.widget-contenedor,
.widget-contenedor .fb-page, 
.widget-contenedor .fb-page span, 
.widget-contenedor .fb-page iframe {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

/* Enlace especial de Intranet en el Footer */
.footer-links .link-intranet {
    color: #cbd5e1 !important;
    font-weight: 600;
    font-size: 13px;
}

.footer-links .link-intranet:hover {
    color: var(--color-fondo-claro) !important;
}