/* dropdown basics */
.nav-item.dropdown { position: relative; }

.dropdown-toggle {
  background: none;
  border: none;
  font: inherit;
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 0;
}

.dropdown-toggle:focus {
  outline: 3px solid rgba(255,122,0,0.12);
  outline-offset: 3px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: .35rem 0;
  display: none;
  z-index: 1200;
  border: 1px solid rgba(0,0,0,0.03);
  list-style-type: none;
}

.dropdown-menu a {
  display: block;
  padding: .6rem 1rem;
  color: var(--text-dark);
  font-weight: 500;
}
.dropdown-menu li a{
    text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-menu a:focus {
  background: #FFF9F0;
  color: var(--brand-orange);
  text-decoration: none;
}

/* show/hide controlled by aria-expanded attribute (set via JS) */
.nav-item.dropdown[aria-expanded="true"] .dropdown-menu {
  display: block;
}

/* desktop: hover enhancement for pointer devices */
@media (hover: hover) {
  .nav-item.dropdown:hover .dropdown-menu { display: block; }
  .nav-item.dropdown:hover .dropdown-toggle .caret { transform: rotate(180deg); }
}

/* mobile: when nav-links is shown inline (your mobile code uses inline styles),
   the submenu should be static in the flow */
@media (max-width: 640px) {
  .nav-links[style*="flex"] .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    display: none; /* still controlled by aria-expanded on the .dropdown */
  }
  .nav-links[style*="flex"] .nav-item.dropdown[aria-expanded="true"] .dropdown-menu {
    display: block;
  }
  .dropdown-toggle, .nav-links a { width: 100%; text-align: left; padding: .98rem 0.7rem; }
}

/* invisible buffer between toggle and menu to avoid tiny gaps */
.dropdown {
  position: relative;
}
.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;     /* the buffer height — tweak 10-18px as needed */
  pointer-events: none; /* don't block clicks */
}

