/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
ul {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}

/* Navbar base */
.navbar {
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: fixed; /* keeps navbar at top */
  left: 0;
  right: 0;
  top: 0;
  z-index: 1000;
  font-family: sans-serif;
}


.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 40px;
}

/* Desktop menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-menu > li {
  position: relative;
}

.nav-menu a {
  padding: 15px 10px;
  display: block;
  color: #333;
  font-weight: 500;
}

.has-dropdown > a::after,
.has-submenu > a::after {
  content: " ";
  margin-left: 4px;
}

.dropdown,
.submenu {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  display: none;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 200;
}

.dropdown li {
  position: relative;
}

.submenu {
  top: 0;
  left: 100%;
  min-width: 180px;
}

/* Desktop hover */
.nav-menu li:hover > .dropdown,
.dropdown li:hover > .submenu {
  display: block;
}

/* Highlight button */
.highlight a {
  background: #007bff;
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s ease;
}
.highlight a:hover {
  background: #0056b3;
}

/* Mobile toggle button */
.mobile-toggle {
  display: none;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    border-top: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 999;
  }

  .nav-menu.show {
    display: flex;
  }

  .nav-menu > li {
    width: 100%;
  }

  /* Mobile dropdowns and submenus */
  .dropdown,
  .submenu {
    position: static;
    border: none;
    box-shadow: none;
    min-width: auto;
    background: #f9f9f9;
  }

/* Mobile submenu smooth toggle */
@media (max-width: 768px) {
  .submenu,
  .dropdown {
    display: block; /* always block for transition to work */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .submenu.show,
  .dropdown.show {
    max-height: 500px; /* large enough to fit content */
  }
}

}

/* Desktop .show support */
@media (min-width: 769px) {
  .dropdown.show,
  .submenu.show {
    display: block !important;
  }
}

.dropdown li:hover > .submenu {
  display: block;
  transition: all 0.2s ease-in-out;
}

/* adds scroll bar when needed */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 60px; /* adjust if your navbar height is different */
    left: 0;
    width: 100%;
    max-height: calc(100vh - 60px);
    overflow-y: auto; /* adds scroll bar when needed */
    z-index: 999;
    background: #fff; /* match your design */
  }
}

/* Desktop: make nested submenus scrollable if tall */
@media (min-width: 769px) {
  .submenu {
    max-height: 70vh;   /* or 60vh/80vh to taste */
    overflow-y: auto;   /* shows scrollbar when needed */
  }
}

