/* ============================================================
   INICIO - SECCIÓN PARTNERS (CONSTELACIÓN DE ALIANZAS)
   Fondo oscuro ejecutivo con tarjetas corporativas y red estelar.
   ============================================================ */

.seccion-partners {
    padding: 5rem 1.25rem 5.5rem;
    background: radial-gradient(1000px 600px at 50% 40%, #0d1a3a 0%, #050b1a 100%);
    color: #e6eef8;
    position: relative;
    overflow: hidden;
}

/* Red / Fondo estelar tenue */
.fondo-constelacion-estelar {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.25), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 186, 0, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(154, 196, 255, 0.25), transparent);
    background-repeat: repeat;
    background-size: 240px 240px;
    opacity: 0.35;
    pointer-events: none;
}

.disposicion-partners {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 480px;
    margin-top: 1rem;
}

.constelacion {
    width: 100%;
    max-width: 1100px;
    height: 520px;
    margin: 0 auto;
    position: relative;
}


/* Tarjeta Corporativa del Socio (No circular) */
.socio-card {
    --dur: 8s;
    --x1: 0px;
    --y1: 0px;
    --x2: 0px;
    --y2: 0px;
    --r1: 0deg;
    --r2: 0deg;

    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 8px 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    overflow: visible;
    pointer-events: auto;
    transition: box-shadow 0.3s var(--curva-salida), border-color 0.3s var(--curva-salida);
    user-select: none;
    z-index: 10;
    min-width: 110px;
    animation: flotarConstelacionOrganica var(--dur, 7.5s) ease-in-out infinite both;
}

/* Nodo / Pin estelar en la parte superior de la tarjeta */
.nodo-estelar {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffba00;
    box-shadow: 0 0 10px #ffba00, 0 0 0 3px rgba(255, 186, 0, 0.25);
    transition: transform 0.25s var(--curva-salida), background 0.25s var(--curva-salida), box-shadow 0.25s var(--curva-salida);
    animation: pulsoEstelarPin 2.8s ease-in-out infinite alternate;
}

.contenedor-logo-socio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.socio-card img {
    max-width: 115px;
    max-height: 42px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    filter: brightness(0.98) contrast(1.02);
    transition: transform 0.25s var(--curva-salida);
    pointer-events: none;
}

.texto-socio {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0b1836;
    text-align: center;
    line-height: 1.2;
}

/* Hover / Focus interactivo */
.socio-card:focus-visible {
    animation-play-state: paused;
    border-color: #ffba00;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 30px rgba(255, 186, 0, 0.45);
    outline: none;
    z-index: 30;
}
@media (hover: hover) and (pointer: fine) {
    .socio-card:hover {
        animation-play-state: paused;
        border-color: #ffba00;
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 30px rgba(255, 186, 0, 0.45);
        outline: none;
        z-index: 30;
    }
}

.socio-card:focus-visible .nodo-estelar {
    transform: translateX(-50%) scale(1.4);
    background: #ffffff;
    box-shadow: 0 0 16px #ffffff, 0 0 0 4px rgba(255, 186, 0, 0.7);
    animation-play-state: paused;
}
@media (hover: hover) and (pointer: fine) {
    .socio-card:hover .nodo-estelar {
        transform: translateX(-50%) scale(1.4);
        background: #ffffff;
        box-shadow: 0 0 16px #ffffff, 0 0 0 4px rgba(255, 186, 0, 0.7);
        animation-play-state: paused;
    }
}

.socio-card:focus-visible img {
    animation: flotarConstelacionSutil var(--dur, 7s) ease-in-out infinite alternate;
}
@media (hover: hover) and (pointer: fine) {
    .socio-card:hover img {
        animation: flotarConstelacionSutil var(--dur, 7s) ease-in-out infinite alternate;
    }
}

/* Animación de flotación orgánica espacial dinámica viva */
@keyframes flotarConstelacionOrganica {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(-50%, -50%) translate(var(--x1, 14px), var(--y1, -14px)) rotate(var(--r1, 1.5deg));
    }
    66% {
        transform: translate(-50%, -50%) translate(var(--x2, -14px), var(--y2, 12px)) rotate(var(--r2, -1.5deg));
    }
    100% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
    }
}

/* Pulso estelar continuo para las estrellas de la constelación */
@keyframes pulsoEstelarPin {
    0% {
        box-shadow: 0 0 8px #ffba00, 0 0 0 3px rgba(255, 186, 0, 0.2);
        transform: translateX(-50%) scale(1);
    }
    100% {
        box-shadow: 0 0 16px #ffba00, 0 0 0 6px rgba(255, 186, 0, 0.45);
        transform: translateX(-50%) scale(1.22);
    }
}

/* Modal de información del socio (Centrado en pantalla para evitar desbordes) */
.panel-informacion-socio {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 380px;
    max-width: 92vw;
    max-height: 85vh;
    background: rgba(6, 15, 36, 0.96);
    border: 1.5px solid rgba(255, 186, 0, 0.45);
    backdrop-filter: blur(16px);
    color: #e6eef8;
    border-radius: 18px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s var(--curva-salida);
    z-index: 999;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 186, 0, 0.2);
    overflow-y: auto;
}

.panel-informacion-socio .contenido-panel {
    padding: 1.4rem;
}

.categoria-badge-panel {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffba00;
    background: rgba(255, 186, 0, 0.12);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(255, 186, 0, 0.3);
}

.panel-informacion-socio .titulo-panel {
    font-family: var(--font-serif);
    font-weight: var(--fw-800);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.panel-informacion-socio .descripcion-panel {
    font-size: 0.9rem;
    color: rgba(230, 238, 248, 0.88);
    line-height: 1.48;
}

.imagen-convenio-panel {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 10px;
    margin-top: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
}

.panel-informacion-socio--abierto {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.boton-cerrar-panel {
    position: absolute;
    right: 12px;
    top: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: rgba(230, 238, 248, 0.8);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s var(--curva-salida);
    z-index: 5;
}

@media (hover: hover) and (pointer: fine) {
    .boton-cerrar-panel:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
}

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

@media (max-width: 768px) {
    .seccion-partners {
        padding: 3.5rem 0.75rem 4.5rem;
    }

    .constelacion {
        height: 520px;
    }

    .socio-card {
        min-width: 85px;
        max-width: 110px;
        height: 46px;
        padding: 4px 8px;
        border-radius: 10px;
    }

    .socio-card img {
        max-height: 30px;
        max-width: 88px;
    }

    .texto-socio {
        font-size: 0.68rem;
    }

    .panel-informacion-socio {
        width: 92%;
        left: 4%;
        right: 4%;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .constelacion {
        height: 500px;
    }

    .socio-card {
        min-width: 75px;
        max-width: 98px;
        height: 42px;
        padding: 3px 6px;
        border-radius: 8px;
    }

    .socio-card img {
        max-height: 26px;
        max-width: 78px;
    }
}
