/* =========================
   NAVIGATION – DESKTOP
   ========================= */

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  margin: 0;
}

nav ul li {
  position: relative;
  margin-left: 20px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 10px;
  display: block;
  white-space: nowrap;
}

nav ul li:has(ul) > a::after {
  content: " ▼";
  font-size: 0.8rem;
}

nav ul li ul {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  color: #333;
  min-width: 200px;
  display: none;
  flex-direction: column;
  z-index: 3;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 5px;
  margin-top: -1px;
}

nav ul li ul li {
  margin-left: 0;
  width: 100%;
}

nav ul li ul li a {
  color: #333;
  padding: 10px;
}

nav ul li ul li.dropdown-header {
  color: #555;
  padding: 10px;
  font-weight: bold;
  font-size: 0.9rem;
  border-bottom: 1px solid #eee;
}

nav ul li:hover ul {
  display: flex;
}

nav ul li:hover ul li a:hover {
  background-color: #f4f4f4;
}

/* Touch / JS dropdown support */
nav ul li.open ul {
  display: flex;
}

/* Hamburger + close hidden on desktop */
.menu-toggle,
.menu-close {
  display: none;
}


/* =========================
   NAVIGATION – MOBILE
   ========================= */

@media (max-width: 768px) {

  /* Show hamburger */
  .menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 1001;
  }

  .menu-toggle:focus {
    outline: 2px solid white;
    outline-offset: 4px;
  }

  /* Slide-in nav */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: rgba(51, 51, 51, 0.98);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 80px 20px 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.3);
  }

  nav.menu-open {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    width: 100%;
  }

  nav ul li {
    margin-left: 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  nav ul li > a {
    color: white;
    padding: 15px 10px;
    font-size: 1.1rem;
  }

  nav ul li > a:active {
    background-color: rgba(255,255,255,0.1);
  }

  /* Mobile dropdown */
  nav ul li ul {
    position: relative;
    background-color: rgba(0,0,0,0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: none;
    border-radius: 0;
  }

  nav ul li.open ul {
    max-height: 1000px;
  }

  nav ul li ul li a {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    padding: 12px 10px 12px 20px;
  }

  nav ul li ul li.dropdown-header {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    padding: 10px 10px 10px 20px;
  }

  /* Close button */
  .menu-close {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
  }
}
