/*╔═══════════════════════════════════════════════════════════════════════════════════════════╗
  ║  RUBRO TOGGLE — Switch Legal / Médico                                                     ║
  ║  Desktop: sticky bar debajo del header al scrollear                                       ║
  ║  Mobile: fixed bottom bar                                                                 ║
  ╚═══════════════════════════════════════════════════════════════════════════════════════════╝*/

/* ─── Colores por rubro ─── */
:root {
    --rubro-legal: #662d91;
    --rubro-legal-light: #f4f0f9;
    --rubro-legal-glow: rgba(102, 45, 145, 0.35);
    --rubro-medical: #0891b2;
    --rubro-medical-light: #ecfeff;
    --rubro-medical-glow: rgba(8, 145, 178, 0.35);
}

/* ─── Barra contenedora ─── */
.rubro-toggle-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    /* Entrada con animación */
    animation: rubroFadeUp 0.4s ease-out;
}

@keyframes rubroFadeUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Pill contenedora ─── */
.rubro-toggle-pill {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--white);
    border-radius: var(--radius-full);
    padding: 5px;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.12),
        0 0 0 1px rgba(0,0,0,0.04);
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: 2px;
}

/* ─── Opciones individuales ─── */
.rubro-option {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
    color: var(--text-muted);
}
.rubro-option:hover {
    text-decoration: none;
}
.rubro-option i {
    font-size: 15px;
    transition: color 0.3s ease;
}

/* Estado inactivo hover */
.rubro-option:not(.active):hover {
    color: var(--text-dark);
}

/* Estado activo */
.rubro-option.active {
    color: #fff;
}
.rubro-option.rubro-legal.active {
    color: #fff;
}
.rubro-option.rubro-medical.active {
    color: #fff;
}

/* ─── Slider animado (fondo que se mueve) ─── */
.rubro-slider {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(50% - 4px);
    height: calc(100% - 10px);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--rubro-legal), var(--primary-warm));
    box-shadow: 0 4px 16px var(--rubro-legal-glow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Slider en posición derecha (médico activo) */
.rubro-slider.slide-right {
    left: calc(50% - 1px);
    background: linear-gradient(135deg, var(--rubro-medical), #06b6d4);
    box-shadow: 0 4px 16px var(--rubro-medical-glow);
}

/* ═══ Desktop: barra sticky debajo del header ═══ */
@media (min-width: 992px) {
    .rubro-toggle-bar {
        position: fixed;
        bottom: 32px;
        left: 50%;
        transform: translateX(-50%);
    }

    .rubro-toggle-pill {
        box-shadow:
            0 8px 32px rgba(0,0,0,0.15),
            0 0 0 1px rgba(0,0,0,0.04);
    }

    .rubro-option {
        padding: 12px 32px;
        font-size: 14px;
    }
}

/* ═══ Mobile ═══ */
@media (max-width: 991px) {
    .rubro-toggle-bar {
        bottom: 20px;
    }

    .rubro-option {
        padding: 11px 24px;
        font-size: 13px;
        gap: 6px;
    }
    .rubro-option i {
        font-size: 14px;
    }

    .rubro-toggle-pill {
        box-shadow:
            0 6px 28px rgba(0,0,0,0.18),
            0 0 0 1px rgba(0,0,0,0.05);
    }
}

@media (max-width: 575px) {
    .rubro-option {
        padding: 10px 20px;
        font-size: 13px;
    }
}
