Fix a sticky dropdown menu that does not close when clicking outside it, by adding a blur/outside-click handler.
The dropdown opens on click but stays open when the user clicks elsewhere on the page. Implement a handler that closes the dropdown when a click occurs outside its element.
Listen for clicks on the document and close the dropdown if the click target is not inside the dropdown container.
Make sure clicking inside the dropdown keeps it open, and the toggle button still works.
Test that clicking outside closes the menu and that it reopens correctly.