/* =========================================
   SCROLLSPY (Menú Lateral)
   ========================================= */
.scrollspy {
    position: fixed;
    right: 1.5rem;
    top: 45%;
    transform: translateY(-50%);
    z-index: 900;
    display: none;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    padding: 0.5rem;  /* ← NUEVO: Espacio interno para evitar cortes */
}

.scrollspy::-webkit-scrollbar {
    width: 4px;
}

.scrollspy::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

@media (min-width: 1024px) {
    .scrollspy {
        display: block;
    }
}

.scrollspy__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;  /* ← Cambiado de 1rem a 0.75rem */
    margin: 0;
    padding: 0;
}

.scrollspy__list li {
    margin: 0;
    padding: 0;
}

.scrollspy__list a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;   /* ← Cambiado de 40px a 32px */
    height: 32px;  /* ← Cambiado de 40px a 32px */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.scrollspy__list a svg {
    width: 14px;   /* ← Cambiado de 18px a 14px */
    height: 14px;  /* ← Cambiado de 18px a 14px */
    display: block;
}

.scrollspy__list a.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
    transform: scale(1.1);  /* ← Cambiado de 1.15 a 1.1 */
    box-shadow: 0 4px 6px -1px rgba(214, 158, 46, 0.4);
}

/* Tooltip corregido */
.scrollspy__list a::before {
    content: attr(data-title);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: var(--color-primary);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    z-index: 1000;
}

.scrollspy__list a:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* =========================================
   BOTONES DE NAVEGACIÓN (Subir/Bajar)
   ========================================= */
.scrollspy-nav-btn {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
}

.scrollspy-nav-btn:hover {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    transform: scale(1.1);  /* ← Cambiado de 1.15 a 1.1 */
    color: white !important;
}

.scrollspy-nav-btn svg {
    width: 16px;   /* ← Cambiado de 20px a 16px */
    height: 16px;  /* ← Cambiado de 20px a 16px */
    display: block;
}