/* Estilos adicionales para el botón subir */
#btnSubir {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#btnSubir.show {
    opacity: 1;
    visibility: visible;
}

#btnSubir:hover {
    transform: scale(1.1);
    background: linear-gradient(145deg, #d97706, #b45309);
}

/* Estilos para el menú móvil - TOC */
#toc-sidebar {
    transition: transform 0.3s ease-in-out;
}

#toc-sidebar.mobile-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background-color: white;
    overflow-y: auto;
    padding: 1rem;
    margin: 0;
    border-radius: 0;
    width: 100%;
    display: block !important;
}

body.menu-open {
    overflow: hidden;
}

/* Overlay para cuando el menú está abierto */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Desktop: el TOC siempre visible */
@media (min-width: 1024px) {
    #toc-sidebar {
        display: block !important;
        position: sticky !important;
        top: 6rem !important;
        background: transparent !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    .mobile-menu-overlay {
        display: none !important;
    }
    body.menu-open {
        overflow: auto !important;
    }
}

    /* Estilos complementarios para mejorar la experiencia */
    .toc-container {
        transition: all 0.3s ease;
    }
    .hero-description {
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    }
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 40;
    }
    .mobile-menu-overlay.active {
        display: block;
    }
    #btnSubir {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: linear-gradient(135deg, #1e3c3c, #0f2c2c);
        color: white;
        border: none;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #btnSubir:hover {
        transform: scale(1.1);
        background: linear-gradient(135deg, #0f2c2c, #061414);
    }
    @media (max-width: 1023px) {
        #toc-sidebar {
            position: fixed;
            top: 0;
            left: -280px;
            width: 280px;
            height: 100%;
            z-index: 50;
            transition: left 0.3s ease;
            margin: 0;
            padding: 0;
        }
        #toc-sidebar.mobile-open {
            left: 0;
        }
        .toc-container {
            height: 100%;
            border-radius: 0;
            overflow-y: auto;
        }
    }