/* Variables y clases públicas para sobrescribir desde custom.less. */
.iw-toc, .iw-toc-mobile { --iw-toc-active: var(--bs-primary, #0d6efd); }
.iw-toc[hidden] { display: none !important; }
.iw-toc__list { list-style: none; padding: 0; margin: 0; }
.iw-toc__list .iw-toc__list { padding-inline-start: 1rem; }
.iw-toc__link { display: block; border-inline-start: 1px solid var(--bs-border-color, #ddd); padding: .45rem .75rem; color: inherit; text-decoration: none; }
.iw-toc__link:hover, .iw-toc__link:focus-visible { color: var(--iw-toc-active); }
.iw-toc__link.active { border-inline-start: 2px solid var(--iw-toc-active); color: var(--iw-toc-active); font-weight: 600; }
.iw-toc-mobile { display: none; }
@media (max-width: 991.98px) {
    .iw-toc { display: none; }
    .iw-toc-mobile {
        display: block;
        position: fixed;
        left: max(16px, env(safe-area-inset-left));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: min(360px, calc(100vw - 32px));
        z-index: 1040;
    }
    .iw-toc-mobile__toggle {
        display: flex;
        align-items: center;
        gap: .4rem;
        width: 100%;
        padding: .8rem 1rem;
        border: 1px solid var(--bs-border-color, #ddd);
        border-radius: .5rem;
        background: var(--bs-body-bg, #fff);
        color: var(--bs-body-color, #222);
        box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }
    .iw-toc-mobile__current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .iw-toc-mobile__toggle::after { content: '\25B4'; }
    .iw-toc-mobile__toggle[aria-expanded="true"]::after { content: '\25BE'; }
    .iw-toc-mobile__panel {
        position: absolute;
        bottom: calc(100% + .5rem);
        left: 0;
        width: 100%;
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
        overflow-y: auto;
        padding: .5rem;
        border: 1px solid var(--bs-border-color, #ddd);
        border-radius: .5rem;
        background: var(--bs-body-bg, #fff);
        color: var(--bs-body-color, #222);
        box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    }
    .iw-toc-mobile__panel[hidden] { display: none !important; }
}
