/* ==========================================================================
   1. VARIABLES DE DISEÑO Y BASE CORPORATIVA
   ========================================================================== */
:root {
    --primary-color: #009848;
    --primary-dark: #007637;
    --secondary-color: #FCBE03;
    --text-dark: #222222;
    --text-muted: #666666;
    --bg-light: #F4F6F8;
    --bg-white: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --radius-card: 8px;
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   2. CABECERA DESKTOP (3 COLUMNAS)
   ========================================================================== */
.main-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Extremo Izquierdo: Marca y Botón de Retorno */
.header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.company-brand {
    font-size: 15px;
    font-weight: 700;
    color: #333333;
}

.btn-return-web {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.btn-return-web:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Centro: Logo Compacto */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#company-logo {
    display: block;
    max-width: 120px;
    width: 100%;
    height: auto;
}

/* Extremo Derecho: Redes Sociales */
.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555555;
    transition: var(--transition);
    text-decoration: none;
}

.social-link svg {
    fill: currentColor;
    width: 18px;
    height: 18px;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ==========================================================================
   3. BANNER SUPERIOR DELGADO
   ========================================================================== */
.banner-compact {
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 22px 0;
    border-bottom: 4px solid var(--secondary-color);
    text-align: center;
}

.banner-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.banner-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ==========================================================================
   4. FILTRO Y GRILLA DE ASESORES
   ========================================================================== */
.main-content {
    padding-top: 30px;
    padding-bottom: 50px;
}

.filter-section {
    text-align: center;
    margin-bottom: 30px;
}

.filter-buttons {
    display: inline-flex;
    gap: 8px;
    background: #EAEAEA;
    padding: 5px;
    border-radius: 30px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-dark);
    padding: 8px 22px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
}

.advisors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card-advisor {
    background-color: var(--bg-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.card-advisor:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    position: relative;
    width: 100%;
    height: 220px;
    background-color: #E0E0E0;
}

.photo-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advisor-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.city-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #FFFFFF;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 12px;
    z-index: 2;
}

.card-identity {
    padding: 16px 20px 6px;
    background-color: #FFFFFF;
}

.advisor-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.advisor-role {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-body {
    padding: 6px 20px 16px;
    background-color: #FFFFFF;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333333;
    font-size: 0.88rem;
    font-weight: 600;
}

.info-icon {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.card-footer {
    padding: 16px 20px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    background-color: #FFFFFF;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.btn-whatsapp {
    background-color: #00A859;
    color: #FFFFFF;
    border: 1px solid #00A859;
}

.btn-whatsapp:hover {
    background-color: #008F4C;
}

.icon-wa {
    width: 16px;
    height: 16px;
    fill: #FFFFFF;
}

.btn-gmail {
    background-color: #FFFFFF;
    color: #333333;
    border: 1px solid #E0E0E0;
}

.btn-gmail:hover {
    background-color: #F5F5F5;
    border-color: #CCCCCC;
}

.icon-gmail {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   5. SECCIÓN CORPORATIVA FINAL (PRE-FOOTER)
   ========================================================================== */
.prefooter-corporate {
    background-color: #0E1E28;
    color: #FFFFFF;
    padding: 45px 0;
    border-top: 4px solid var(--primary-color);
}

.prefooter-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 1fr 0.8fr;
    gap: 30px;
}

.prefooter-brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.prefooter-slogan {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 18px;
    font-weight: 600;
}

.btn-corporate-web {
    display: inline-block;
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 8px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.btn-corporate-web:hover {
    background-color: var(--primary-dark);
}

.prefooter-heading {
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 4px;
}

.prefooter-list {
    list-style: none;
    font-size: 0.85rem;
    color: #CCCCCC;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prefooter-list strong {
    color: #FFFFFF;
}

.prefooter-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prefooter-links a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.prefooter-links a:hover {
    color: var(--secondary-color);
}

.social-btn {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.social-btn svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    fill: #FFFFFF;
    display: block;
}

.social-btn:hover {
    background-color: var(--primary-color);
}

/* ==========================================================================
   6. ADAPTACIÓN RESPONSIVE (MÓVIL <= 768px) - CORREGIDO Y OPTIMIZADO
   ========================================================================== */
/* =========================================
   AJUSTES EXCLUSIVOS PARA MOBILE
   ========================================= */
@media (max-width: 768px) {

    /* --- 1. CABECERA MOBILE (Logo a la izquierda, Nombre/Volver a la derecha) --- */
    .header-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px !important;
    }

    .header-center {
        order: 1 !important;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
    }

    #company-logo {
        max-width: 90px !important;
        height: auto !important;
    }

    .header-left {
        order: 2 !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        text-align: right !important;
        gap: 3px !important;
    }

    .company-brand {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
        text-align: right !important;
    }

    .btn-return-web {
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        text-align: right !important;
    }

    .header-right {
        display: none !important;
    }

    /* --- 2. GRILLA DE ASESORES (1 SOLA COLUMNA EN MÓVIL) --- */
    .advisors-grid {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Corrige las 3 columnas apretadas */
        gap: 20px !important;
        padding: 0 15px !important;
    }

    /* --- 3. REDES SOCIALES FLOTANTES --- */
    .social-icons {
        position: fixed !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        flex-direction: column !important;
        gap: 10px !important;
        z-index: 99999 !important;
        background-color: #ffffff !important;
        padding: 8px !important;
        border-radius: 25px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
        border: 1px solid #e0e0e0 !important;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .social-link {
        width: 36px !important;
        height: 36px !important;
        background-color: #f0fdf4 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: var(--primary-color) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .social-link svg {
        fill: var(--primary-color) !important;
        width: 18px !important;
        height: 18px !important;
        display: block !important;
    }

    /* --- 4. FOOTER (1 COLUMNA CON MARGEN LATERAL) --- */
    .prefooter-corporate {
        padding: 40px 0 !important;
    }

    .prefooter-grid {
        display: flex !important;
        flex-direction: column !important; /* Corrige las 4 columnas horizontales */
        gap: 24px !important;
        text-align: left !important;
        padding: 0 24px !important; /* Otorga el margen respecto al borde */
        box-sizing: border-box !important;
    }

    .prefooter-col {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .prefooter-heading,
    .prefooter-list,
    .prefooter-links {
        text-align: left !important;
    }

    /* --- 5. OCULTAR SÍGUENOS --- */
    .prefooter-col.social-col {
        display: none !important;
    }
}
/* =========================================
       FIX DEFINITIVO: REDES FLOTANTES MOBILE
       ========================================= */
    /* 1. Contenedor Flotante */
    @media (max-width: 768px) {
        .header-right .social-icons,
        .social-icons {
            position: fixed !important;
            left: 10px !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            flex-direction: column !important;
            gap: 10px !important;
            z-index: 999999 !important;
            background-color: #ffffff !important;
            padding: 8px !important;
            border-radius: 25px !important;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
            border: 1px solid #e0e0e0 !important;
            display: flex !important;
            opacity: 1 !important;
            visibility: visible !important;
        }

        /* 2. Círculos de enlace */
        .social-icons a,
        .social-icons .social-link {
            width: 36px !important;
            height: 36px !important;
            min-width: 36px !important;
            min-height: 36px !important;
            background-color: #f0fdf4 !important;
            border-radius: 50% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            opacity: 1 !important;
            visibility: visible !important;
        }

        /* 3. Iconos internos (cubre SVG, Etiquetas IMG e Iconos de fuente) */
        .social-icons a *,
        .social-icons .social-link * {
            opacity: 1 !important;
            visibility: visible !important;
            display: block !important;
        }

        /* Si los iconos son SVG */
        .social-icons svg,
        .social-icons svg path {
            fill: #009848 !important;
            width: 18px !important;
            height: 18px !important;
        }

        /* Si los iconos son imágenes PNG/SVG en tag <img> */
        .social-icons img {
            width: 18px !important;
            height: 18px !important;
            object-fit: contain !important;
        }
    }
    /* Contenedor vertical por cada sección */
.section-block {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

/* Encabezado rojo con indicador de ubicación */
.location-banner {
    background-color: #B30000; /* Rojo corporativo de referencia */
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    align-self: flex-start;
}

/* Grilla interna para las tarjetas de cada sección */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}
/* Soporte para Secciones Verticales */
.section-block {
    width: 100%;
    margin-bottom: 35px;
}

/* Banner Rojo Corporativo */
.location-banner {
    background-color: #B30000;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: inline-block;
}

/* Grilla de Tarjetas por Sección */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}
/* Espaciado del organizador/filtros */
.filter-section {
    margin-top: 35px !important;
    margin-bottom: 35px !important;
}

.filter-btn {
    white-space: nowrap; /* Evita que las palabras se dividan raro */
    padding: 10px 18px;
}

/* Espacio superior para el contenedor principal de tarjetas */
.section-block {
    width: 100%;
    margin-top: 25px;
    margin-bottom: 45px;
}

/* Banner de ubicación verde corporativo (#009848) */
.location-banner {
    background-color: #009848;
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 25px;
}

/* Corrección para conservar redes sociales visibles en móvil */
@media (max-width: 768px) {
    .header-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    .social-links {
        display: flex !important;
        gap: 12px;
    }

    .filter-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
}
/* Ocultar el botón 'Todas las sedes' únicamente en mobile */
@media (max-width: 768px) {
    .filter-btn[data-city="todas"],
    .filter-btn[data-city="todas las sedes"] {
        display: none !important;
    }
}
/* ==========================================================================
   AJUSTES EXCLUSIVOS MÓVIL (<= 768px): CABECERA Y REDES FLOTANTES
   ========================================================================== */
@media (max-width: 768px) {

    /* --- 1. CABECERA FLEXIBLE --- */
    .header-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Logo a la izquierda */
    .header-center {
        order: 1 !important;
        flex: 0 0 auto !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #company-logo,
    .header-center img {
        display: block !important;
        max-width: 90px !important;
        height: auto !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    /* Nombre de empresa y botón volver a la derecha */
    .header-left {
        order: 2 !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        text-align: right !important;
        gap: 3px !important;
    }

    .company-brand {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
    }

    .btn-return-web {
        font-size: 0.78rem !important;
        font-weight: 700 !important;
    }

    /* --- 2. CONTENEDOR DE REDES FLOTANTES --- */
    .header-right {
        display: block !important;
        width: 0 !important;
        height: 0 !important;
        overflow: visible !important;
    }

    /* Barra flotante pegada a la derecha */
    .header-right .social-icons,
    .social-icons {
        position: fixed !important;
        right: 12px !important;
        left: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        flex-direction: column !important;
        gap: 10px !important;
        z-index: 999999 !important;
        background-color: #ffffff !important;
        padding: 8px !important;
        border-radius: 25px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid #e0e0e0 !important;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Círculos de botones */
    .social-icons a,
    .social-icons .social-link {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        background-color: #f0fdf4 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: transform 0.2s ease, background-color 0.2s ease !important;
    }

    /* Hover y estado activo al tocar */
    .social-icons a:hover,
    .social-icons a:active,
    .social-icons .social-link:hover,
    .social-icons .social-link:active {
        background-color: var(--primary-color, #009848) !important;
        transform: scale(1.1) !important;
    }

    /* Íconos SVG */
    .social-icons a *,
    .social-icons .social-link * {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }

    .social-icons svg,
    .social-icons svg path {
        fill: var(--primary-color, #009848) !important;
        width: 18px !important;
        height: 18px !important;
        transition: fill 0.2s ease !important;
    }

    .social-icons a:hover svg,
    .social-icons a:active svg,
    .social-icons a:hover svg path,
    .social-icons a:active svg path,
    .social-icons .social-link:hover svg,
    .social-icons .social-link:active svg,
    .social-icons .social-link:hover svg path,
    .social-icons .social-link:active svg path {
        fill: #ffffff !important;
    }

    .social-icons img {
        width: 18px !important;
        height: 18px !important;
        object-fit: contain !important;
    }
}
/* Corrección absoluta para fijar el logo a la izquierda en móvil */
@media (max-width: 768px) {
    .header-center {
        order: -1 !important;
        margin-right: auto !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
    }

    #company-logo,
    .header-center img {
        margin-left: 0 !important;
        margin-right: auto !important;
        display: block !important;
    }
}
/* 1. Evita que las tarjetas se estiren a la misma altura en la grilla */
.advisors-grid {
    align-items: start !important;
}

/* 2. Remueve cualquier altura fija para que la tarjeta ajuste exacto a su contenido */
.advisor-card {
    height: auto !important;
    min-height: unset !important;
}

/* 3. Ajusta el contenedor interno para eliminar espacios sobrantes */
.advisor-card-info,
.advisor-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 8px !important;
}