/* Estilos para la tabla de contenidos horizontal anclada */
.horizontal-toc-container {
    width: 100%;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.horizontal-toc {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin: 0;
    list-style: none;
    justify-content: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.horizontal-toc::-webkit-scrollbar {
    height: 4px;
}

.horizontal-toc::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.horizontal-toc::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 20px;
}

.horizontal-toc li {
    margin: 0.5rem 0.75rem;
}

.horizontal-toc a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.25rem;
    position: relative;
    transition: color 0.3s ease;
}

.horizontal-toc a:hover,
.horizontal-toc a.active {
    color: var(--primary-color);
}

.horizontal-toc a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.horizontal-toc a:hover::after,
.horizontal-toc a.active::after {
    width: 100%;
}

/* Estilos para dispositivos móviles */
@media (max-width: 768px) {
    .horizontal-toc {
        justify-content: flex-start;
        padding: 0.5rem;
    }
    
    .horizontal-toc li {
        margin: 0 0.5rem;
    }
}