(function ($) {
    $(document).ready(function () {
        function setupHover() {
            $('.lknwp-header-button').off('mouseenter mouseleave').hover(
                function () {
                    $(this).find('.overlay-lkn').stop(true, true).fadeIn(300)
                },
                function () {
                    $(this).find('.overlay-lkn').stop(true, true).fadeOut(300)
                }
            )
        }

        // Configurações do MutationObserver
        const observer = new MutationObserver(function (mutations) {
            mutations.forEach(function (mutation) {
                if (mutation.addedNodes.length > 0) {
                    setupHover()
                }
            })
        })

        const targetNode = document.body
        const config = { childList: true, subtree: true }
        observer.observe(targetNode, config)

        setupHover()
    })
})(jQuery)
