/* ========== EQUIPO - HERO SECTION ========== */
#team-hero {
    /* Agregar imagen de fondo */
    background-image: url('../assets/team-hero-bg.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    padding: 50px 0 40px;
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

/* Overlay para mejorar legibilidad del texto */
.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

#team-hero .container {
    position: relative;
    z-index: 2;
}

#team-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.hero-title {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--brand-black);
    position: relative;
    z-index: 2;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
}

.hero-subtitle {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.3rem;
    color: var(--brand-dark-gray);
    position: relative;
    z-index: 2;
    padding-bottom: 0 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* ========== DESCRIPCIÓN DEL EQUIPO ========== */
.team-description {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--brand-black);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
    background: rgba(158, 181, 151, 0.2);
    padding: 0.5rem;
    border-radius: 0px;
}

.team-description:not(:last-child) {
    margin-bottom: 1rem;
}

.team-description:last-child {
    margin-bottom: 0;
}

/* ========== NAVEGACIÓN DEL EQUIPO - ESTÁTICA ========== */
#team-navigation {
    background: var(--white);
    padding: 0;
    box-shadow: 0 2px 10px rgba(26, 26, 26, 0.1);
    position: static; /* Cambiado a estático */
    z-index: 100;
    margin-bottom: 0;
}

.team-nav-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    background: var(--white);
}

.team-nav-btn {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background: var(--white);
    border: none;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 3px solid transparent;
}

.team-nav-btn:not(:last-child) {
    border-right: 1px solid var(--brand-light-beige);
}

.team-nav-btn:hover {
    background: var(--brand-light-beige);
    border-bottom-color: var(--brand-beige);
}

.team-nav-btn.active {
    background: var(--brand-beige);
    border-bottom-color: var(--brand-black);
}

.nav-name {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-black);
    margin-bottom: 0.25rem;
    display: block;
}

.nav-role {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.9rem;
    color: var(--brand-medium-gray);
    display: block;
}

/* ========== DETALLES DE MIEMBROS - DISEÑO VERTICAL ========== */
#team-details {
    position: relative;
    min-height: auto;
    margin-top: 0; 
    padding: 0;
}

.member-detail {
    display: none;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.member-detail.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.member-background {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.member-content {
    position: relative;
    width: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* ========== SECCIÓN BLANCA (NOMBRE Y TÍTULO) ========== */
.white-section {
    background: var(--white);
    margin-top: 50px;
    margin-bottom: -140px; 
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ========== INFORMACIÓN DEL MIEMBRO ========== */
.member-name {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--brand-white);
    background-color: var(--brand-black);
    padding-top: 2rem; 
    margin: 0;
}

.member-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.4rem;
    color: var(--brand-beige);
    background-color: var(--brand-black);
    font-weight: 600;
    margin: 0;
    padding-bottom: 2rem; 
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

/* ========== FOTO CENTRADA EN LA DIVISIÓN ========== */
.member-photo-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 20px auto;
    z-index: 10;
    order: 2;
    transform: translateY(50%);
}

.member-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 8px solid var(--brand-beige);
    box-shadow: 0 15px 50px rgba(26, 26, 26, 0.3);
    transition: all 0.4s ease;
    filter: grayscale(0%);
}

.member-photo:hover {
    transform: scale(1.2);
    box-shadow: 0 20px 60px rgba(184, 168, 150, 0.4);
    border-color: var(--brand-light-beige);
}

/* ========== SECCIÓN NEGRA (CONTENIDO) ========== */
.dark-section {
    background: var(--brand-black);
    padding: 160px 2rem 4rem 2rem; 
    order: 3;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 30px;
}

.member-bio {
    margin-bottom: 3rem;
}

.member-bio p {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--white);
    margin-bottom: 1.5rem;
    text-align: justify;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== CTA DE CONTACTO ========== */
#team-contact-cta {
    background-image: url('../assets/team-hero-bg.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    text-align: center;
    position: relative;
    min-height: 40vh;
    display: flex;
    align-items: center;
}

/* Overlay para mejorar legibilidad del texto en CTA */
.cta-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

#team-contact-cta .container {
    position: relative;
    z-index: 2;
}

#team-contact-cta h3 {
    font-family: 'Glacial Indifference', sans-serif;
    color: var(--brand-black);
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

#team-contact-cta .lead {
    color: var(--brand-dark-gray);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

#team-contact-cta .btn {
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(26, 26, 26, 0.2);
}

/* ========== BOTÓN WHATSAPP ========== */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    color: white;
    text-decoration: none;
}

.whatsapp-float.above-footer {
    bottom: 100px;
}

.whatsapp-float.fixed-to-header {
    transition: all 0.3s ease;
}

.whatsapp-float i {
    font-size: 28px;
}

@keyframes whatsappPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6); }
    100% { transform: scale(1); }
}

/* ========== EFECTOS DE TRANSICIÓN ========== */
.member-detail.fade-in {
    animation: memberFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.member-detail.fade-out {
    animation: memberFadeOut 0.3s ease-out;
}

@keyframes memberFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes memberFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ========== RESPONSIVE DESIGN ========== */

/* Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    #team-hero {
        padding: 12px 0 18px; 
        background-attachment: scroll;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .member-name {
        font-size: 2.5rem;
    }
    
    .member-photo-container {
        width: 250px;
        height: 250px;
    }
    
    .dark-section {
        padding: 140px 2rem 4rem 2rem; 
    }
    
    .white-section {
        min-height: 110px; 
        padding: 1rem 2rem 0.5rem 2rem; 
    }
    
    .team-description {
        max-width: 1100px; 
    }

    #team-contact-cta {
        background-attachment: scroll;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    #team-hero {
        padding: 10px 0 15px; 
        background-attachment: scroll;
        min-height: 50vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .team-description {
        font-size: 1rem;
        max-width: 95%; 
        line-height: 1.6; 
    }
    
    .team-nav-btn {
        min-width: 150px;
        padding: 1.2rem 0.8rem;
    }
    
    .nav-name {
        font-size: 1rem;
    }
    
    .nav-role {
        font-size: 0.85rem;
    }
    
    .member-name {
        font-size: 2.2rem;
        margin-bottom: 0.2rem; 
        line-height: 1.1;
    }
    
    .member-title {
        font-size: 1.2rem;
    }
    
    .member-photo-container {
        width: 220px;
        height: 220px;
    }
    
    .white-section {
        padding: 1rem 2rem 0.5rem 2rem; 
        min-height: 100px; 
    }
    
    .dark-section {
        padding: 120px 2rem 3rem 2rem; 
    }
    
    .member-bio p {
        font-size: 1rem;
    }

    #team-contact-cta {
        background-attachment: scroll;
        min-height: 35vh;
    }
}

/* Mobile Large (576px - 767px) */
@media (max-width: 767px) {
    #team-hero {
        padding: 8px 0 12px; 
        background-attachment: scroll;
        min-height: 45vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .team-description {
        font-size: 0.95rem;
        padding: 0 1rem;
        max-width: 98%; 
        line-height: 1.55; 
        background: rgba(255, 255, 255, 0.2);
    }
    
    .team-nav-wrapper {
        flex-direction: column;
    }
    
    .team-nav-btn {
        width: 100%;
        min-width: auto;
        border-right: none !important;
        border-bottom: 1px solid var(--brand-light-beige);
        padding: 1rem;
    }
    
    .team-nav-btn:last-child {
        border-bottom: none;
    }
    
    .member-name {
        font-size: 1.9rem;
        margin-bottom: 0.15rem; 
        line-height: 1.05;
    }
    
    .member-title {
        font-size: 1.1rem;
        line-height: 1.1;
    }
    
    .member-photo-container {
        width: 180px;
        height: 180px;
    }
    
    .white-section {
        padding: 0.75rem 1.5rem 0.25rem 1.5rem; 
        min-height: 90px; 
    }
    
    .dark-section {
        padding: 95px 1.5rem 3rem 1.5rem; 
    }
    
    .member-bio p {
        font-size: 0.95rem;
        text-align: left;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
        font-size: 20px;
    }
    
    .whatsapp-float i {
        font-size: 24px;
    }
    
    .whatsapp-float.above-footer {
        bottom: 80px;
    }

    #team-contact-cta {
        min-height: 30vh;
    }
}

/* Mobile Small (320px - 575px) */
@media (max-width: 575px) {
    #team-hero {
        padding: 5px 0 8px; 
        background-attachment: scroll;
        min-height: 40vh;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.25rem; 
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0.75rem; 
    }
    
    .team-description {
        font-size: 0.9rem;
        padding: 0 0.5rem;
        max-width: 99%;
        line-height: 1.5;
        background: rgba(255, 255, 255, 0.25);
    }
    
    .nav-name {
        font-size: 0.95rem;
    }
    
    .nav-role {
        font-size: 0.8rem;
    }
    
    .member-name {
        font-size: 1.7rem;
        margin-bottom: 0.1rem; 
        line-height: 1;
    }
    
    .member-title {
        font-size: 1rem;
        line-height: 1;
    }
    
    .member-photo-container {
        width: 160px;
        height: 160px;
    }
    
    .white-section {
        padding: 0.5rem 1rem 0.25rem 1rem; 
        min-height: 75px; 
    }
    
    .dark-section {
        padding: 85px 1rem 2.5rem 1rem; 
    }
    
    .member-bio p {
        font-size: 0.9rem;
    }
    
    .whatsapp-float {
        bottom: 10px;
        right: 10px;
    }

    #team-contact-cta {
        min-height: 25vh;
    }
}

/* ========== OPTIMIZACIONES ADICIONALES ========== */

.container {
    padding-left: 15px;
    padding-right: 15px;
}

@media (max-width: 767px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ========== ACCESIBILIDAD Y PERFORMANCE ========== */
@media (prefers-reduced-motion: reduce) {
    .member-detail {
        transition: none;
    }
    
    .member-photo:hover {
        transform: none;
    }
    
    .member-detail.fade-in,
    .member-detail.fade-out {
        animation: none;
    }
    
    .whatsapp-float {
        animation: none !important;
    }

    #team-hero,
    #team-contact-cta {
        background-attachment: scroll !important;
    }
}

/* Optimización para conexiones lentas */
@media (max-width: 768px) {
    #team-hero,
    #team-contact-cta {
        background-attachment: scroll;
    }
}

/* Focus states para accesibilidad */
.team-nav-btn:focus {
    outline: 2px solid var(--brand-beige);
    outline-offset: 2px;
}

.member-photo:focus {
    outline: 3px solid var(--brand-beige);
    outline-offset: 3px;
}

.whatsapp-float:focus {
    outline: 2px solid var(--brand-beige);
    outline-offset: 2px;
}

/* ========== FALLBACKS PARA NAVEGADORES ANTIGUOS ========== */
@supports not (background-attachment: fixed) {
    #team-hero,
    #team-contact-cta {
        background-attachment: scroll;
    }
}

/* ========== MEJORAS DE CONTRASTE ========== */
@media (prefers-contrast: high) {
    .hero-background-overlay,
    .cta-background-overlay {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .team-description {
        background: rgba(255, 255, 255, 0.3);
    }
    
    .hero-title,
    .hero-subtitle {
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    }
}