/* ==========================================================================
   COMPARADOR DE AFORES — De Cero al Infinito
   Archivo: style_afores.css  |  Versión: 1.0
   ========================================================================== */
:root {
    --af-rojo: #b30000;
    --af-dorado: #d4af37;
    --af-dorado-hover: #b8962e;
    --af-verde: #2e7d32;
    --af-radio: 14px;
}

/* ══════════════════════════════════════════════════════════════
   SELECTOR DE GENERACIÓN
   ══════════════════════════════════════════════════════════════ */
.afore-selector-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: var(--af-radio);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.afore-selector-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
}
.afore-selector-label i { color: var(--af-dorado); margin-right: 6px; }
.afore-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.afore-pill {
    padding: 7px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.73rem;
    font-weight: 700;
    color: #777;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.afore-pill:hover { border-color: #bbb; color: #444; }
.afore-pill.active {
    background: var(--af-rojo);
    border-color: var(--af-rojo);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   BLOQUE DE TABLA (uno por SIEFORE)
   ══════════════════════════════════════════════════════════════ */
.afore-tabla-block {
    margin-bottom: 32px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--af-radio);
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: box-shadow 0.4s;
    scroll-margin-top: 20px;
}
.afore-tabla-block.afore-highlight {
    box-shadow: 0 0 0 3px var(--af-dorado), 0 4px 20px rgba(212,175,55,0.2);
}
.afore-tabla-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
}
.afore-tabla-header h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #222;
}
.afore-tabla-meta {
    font-size: 0.75rem;
    color: #999;
}
.afore-tabla-meta i {
    color: var(--af-dorado);
    margin-right: 3px;
}

/* ══════════════════════════════════════════════════════════════
   TABLA
   ══════════════════════════════════════════════════════════════ */
.afore-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.afore-table thead th {
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    padding: 10px 16px;
    border-bottom: 2px solid #eee;
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 2;
}
.afore-th-rank { width: 50px; text-align: center; }
.afore-th-nombre { min-width: 120px; }
.afore-th-irn { min-width: 180px; }
.afore-th-comision { width: 90px; text-align: right; }

/* ── Filas ── */
.afore-table tbody tr {
    transition: background 0.15s;
}
.afore-table tbody tr:hover {
    background: #fffdf5;
}
.afore-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}
.afore-row-top { background: #fffff5; }
.afore-row-top td { border-bottom-color: #ece8c8; }

/* ── Rank / Medal ── */
.afore-td-rank { text-align: center; }
.afore-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
}
.afore-medal-1 { background: var(--af-dorado); }
.afore-medal-2 { background: #aaa; }
.afore-medal-3 { background: #cd7f32; }
.afore-rank-num { font-size: 0.8rem; font-weight: 700; color: #bbb; }

/* ── Nombre ── */
.afore-td-nombre a {
    color: #222;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s;
}
.afore-td-nombre a:hover { color: var(--af-rojo); }
.afore-tipo-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 5px;
    margin-left: 6px;
    vertical-align: middle;
}
.afore-tipo-publica {
    background: #e8f5e9;
    color: var(--af-verde);
}
.afore-tipo-privada {
    background: #f5f5f5;
    color: #999;
}

/* ── IRN con barra ── */
.afore-irn-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.afore-irn-cell strong {
    color: var(--af-verde);
    font-size: 0.9rem;
}
.afore-bar-track {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}
.afore-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--af-dorado) 0%, #e6c84b 100%);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── Comisión ── */
.afore-td-comision {
    text-align: right;
    font-weight: 600;
    color: #666;
}

/* ── Disclaimer ── */
.afore-disclaimer {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.5;
    padding: 16px 0 0;
    border-top: 1px solid #f2f2f2;
    margin-top: 10px;
}
.afore-disclaimer i { margin-right: 4px; color: #ccc; }
.afore-disclaimer strong { color: #999; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .afore-selector-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .afore-pills { gap: 5px; }
    .afore-pill { padding: 6px 10px; font-size: 0.68rem; }
    .afore-tabla-header { padding: 14px 14px 10px; }
    .afore-tabla-header h3 { font-size: 0.95rem; }
    .afore-tabla-meta { font-size: 0.68rem; }
    .afore-table { font-size: 0.8rem; }
    .afore-table td, .afore-table th { padding: 10px 10px; }
    .afore-th-comision, .afore-td-comision { display: none; }
    .afore-medal { width: 26px; height: 26px; font-size: 0.65rem; }
}