<?php
  $currentPage = basename($_SERVER['PHP_SELF']);
?>

<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top shadow-sm">
  <div class="container">
    <a class="navbar-brand" href="#"><img src="images/logo.png" alt="GMM Logo" style="max-height: 50px;" /></a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav ms-auto">
        <li class="nav-item">
          <a class="nav-link <?= ($currentPage == 'index.php') ? 'active' : '' ?>" href="index.php">Home</a>
        </li>

        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle <?= ($currentPage == 'about_us.php' || $currentPage == 'team.php') ? 'active' : '' ?>" href="#" id="aboutDropdown" role="button" data-bs-toggle="dropdown">About</a>
          <ul class="dropdown-menu" aria-labelledby="aboutDropdown">
            <li><a class="dropdown-item <?= ($currentPage == 'about_us.php') ? 'active' : '' ?>" href="about_us.php">Who We Are</a></li>
            <li><a class="dropdown-item <?= ($currentPage == 'team.php') ? 'active' : '' ?>" href="team.php">Our Team</a></li>
          </ul>
        </li>

        <li class="nav-item">
          <a class="nav-link <?= ($currentPage == 'products.php') ? 'active' : '' ?>" href="products.php">Products & Services</a>
        </li>

        <li class="nav-item">
          <a class="nav-link <?= ($currentPage == 'parteners.php') ? 'active' : '' ?>" href="parteners.php">Partners</a>
        </li>

        <li class="nav-item">
          <a class="nav-link <?= ($currentPage == 'contact.php') ? 'active' : '' ?>" href="contact.php">Contact</a>
        </li>
      </ul>
    </div>
  </div>
</nav>
