/* =========================================================
   GLOBAL VARIABLES
   ========================================================= */
:root {
  --nav-height: 45px;
  --nav-bg: rgba(0,0,0,0.45);   /* main navbar background */
  --submenu-bg: rgba(40,40,40,0.9);
  --accent: #ffd700;   /* Active link color (gold) */
  --hover: #1D1F2B;    /* Hover color for top-level links */
}

/* =========================================================
   DESKTOP NAVBAR (default styles)
   ========================================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
  z-index: 1000;
  color: #fff;
}

/* Logo */
.nav-right {
  position: absolute;
  right: 16px;
}
.nav-right img.brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* Left nav links */
.nav-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-left > a,
.nav-left > .has-submenu > .submenu-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
  background: transparent;
}

/* Active state (all levels) */
.nav-left a.active,
.nav-left .submenu a.active,
.nav-left > .has-submenu > .submenu-link.active {
  color: var(--accent);
}

/* Underline only for top-level active items */
.nav-left > a.active::after,
.nav-left > .has-submenu > .submenu-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* Hover (top-level only, no background) */
.nav-left > a:hover,
.nav-left > .has-submenu > .submenu-link:hover {
  background: transparent;
  color: var(--hover);
}

/* Dropdowns */
.has-submenu {
  position: relative;
}
.submenu-toggle {
  display: none;
}

/* Arrows (added manually in HTML) */
.has-submenu > .submenu-link span.arrow {
  margin-left: 4px;
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Submenu container */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--submenu-bg);
  border-radius: 6px;
  padding: 6px 0;
  list-style: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 1001;
}
.has-submenu:hover > .submenu {
  display: block;
}
.submenu a {
  display: block;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: #fff;
  white-space: nowrap;
}

/* Submenu hover */
.submenu a:hover {
  background: var(--nav-bg); /* match navbar background */
  color: #d4af37;           /* muted gold */
}

/* Desktop flyouts (3rd level) */
.submenu .has-submenu {
  position: relative;
}
.submenu .has-submenu > .submenu {
  position: absolute;
  top: 0;
  left: 100%;        /* align directly to the right */
  margin-left: 2px;
  border-radius: 6px;
  min-width: 200px;
  background: var(--submenu-bg);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  display: none;
}
.submenu .has-submenu:hover > .submenu {
  display: block;
}

/* Hide hamburger in desktop */
.nav-toggle {
  display: none;
}

/* =========================================================
   MOBILE NAVBAR (overrides for <=768px)
   ========================================================= */
@media (max-width: 768px) {
  /* Hamburger button */
  .nav-toggle {
    display: inline-block;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #fff;
    position: absolute;
    left: 16px;
  }
  .nav-toggle .hamburger {
    width: 22px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .nav-toggle .hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
  }

  /* Mobile nav panel */
  .nav-left {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(0,0,0,0.85);
    padding: 8px 0;

    /* fix for long menus */
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }
  body.nav-open .nav-left {
    display: flex;
  }

  /* Mobile links: compact spacing */
  .nav-left > a,
  .nav-left > .has-submenu > .submenu-link {
    padding: 8px 16px;   /* was 12px 18px */
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: left;
  }
  .nav-left > a.active::after,
  .nav-left > .has-submenu > .submenu-link.active::after {
    display: none; /* hide underline in mobile */
  }
  .nav-left > a:hover,
  .nav-left > .has-submenu > .submenu-link:hover {
    background: transparent;
    color: var(--hover);
  }

  /* Submenu in mobile (stacked) */
  .submenu {
    display: none;
    position: static;
    background: transparent;
    box-shadow: none;
    padding-left: 20px;
  }
  .has-submenu.open > .submenu {
    display: block;
  }
  .submenu .submenu {
    padding-left: 20px;
  }

  /* Smaller logo */
  .nav-right img.brand-logo {
    width: 24px;
    height: 24px;
  }
}
