ormSearch, 300);
            searchInputEl.addEventListener('input', e => debouncedSearch(e.target.value));

            document.addEventListener('keydown', e => {
                if (e.key === 'Escape' && isSearchOpen) {
                    toggleSearch();
                }
            });

            searchPopupEl.addEventListener('click', e => {
                if (e.target === searchPopupEl) {
                    toggleSearch();
                }
            });

            // Tab switching functiona