<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm sticky-top py-2">
  <div class="container-fluid">
    <a class="navbar-brand fw-bolder fs-4 text-info" href="<?php echo $site->url(); ?>"><?php echo $site->title(); ?></a>
    <button class="navbar-toggler bg-info border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon text-white"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <li class="nav-item">
          <a class="nav-link text-dark" aria-current="page" href="<?php echo $site->url(); ?>">Home</a>
        </li>
         <?php foreach ($categories->db as $key=>$fields):
            if($fields['list']):  ?>
        <li class="nav-item">
          <a class="nav-link text-dark" href="<?php echo DOMAIN_CATEGORIES.$key; ?>"><?php echo $fields['name']; ?></a>
        </li>
        <?php
        endif;
        endforeach; ?>
      </ul>
      <?php if (pluginActivated('pluginSearch')): ?>
      <div class="d-flex border-0 rounded-pill" style="background-color: #eff3f4;">
        <button onClick="searchNow()" class="btn text-dark" type="submit"><i class="fa-solid fa-magnifying-glass text-info"></i></button>
        <input id="search-input" class="form-control me-2 bg-transparent border-0 text-secondary fw-light" type="search" placeholder="Search Website" aria-label="Search">
        <script>
        function searchNow() {
          var searchURL = "<?php echo Theme::siteUrl(); ?>search/";
          window.open(searchURL + document.getElementById("search-input").value, "_self");
        }
        var elem = document.getElementById('search-input');
        elem.addEventListener('keypress', function(e){
          if (e.keyCode == 13) {
            searchNow();
          }
        });
      </script>
      </div>
      <?php endif ?>
    </div>
  </div>
</nav>