t.addEventListener("focus", openSearch);
    overlay.addEventListener("click", closeSearch);
    document.addEventListener("keydown", (e) => {
      if (e.key === "Escape") {
        closeSearch();
      }
    });
  });
</script>
<div class="overlay"></div>
<input class="search-input" type="text" placeholder="Search..." />
<div class="search-results">
  <div class="search-results__header">
    <span class="search-results__count">Waiting for input...</span>
  </div>
  <div class="search-results__items"></div