/* =======================================================================
   NAVBAR BASE
   ======================================================================= */
.header {
  text-align: center;
  padding: 32px;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;

}

/* Reset dropdown toggle button */
.dropdown-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dropdown-toggle:focus {
  outline: 2px solid var(--nav-text-hover);
  outline-offset: 2px;
}
.navbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #000; /* match hero background or navbar scrolled color */
  z-index: 1002;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  color: var(--nav-text);

  /* Add transform to transition */
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;

  border: none;
  box-shadow: none;
}
.navbar.hidden {
  transform: translateY(-100%);
}

/* Logo / Company name */
.company-name {
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1;
  padding: 0.5rem 0;
  color: var(--nav-text);
  transition: color 0.3s ease;
  cursor: pointer;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
  font-weight: 500;
  color: var(--nav-text);
  transition: color 0.3s ease;
  line-height: 1.2;
  gap: 0.4rem;
  cursor: pointer;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--nav-text-hover);
  outline: none;
  text-decoration: underline;
}

/* =======================================================================
   NAVBAR SCROLLED STATE
   ======================================================================= */
.navbar.scrolled {
  background-color: var(--nav-bg-scrolled);
}

.navbar.scrolled .company-name,
.navbar.scrolled .nav-item {
  color: var(--nav-text-scrolled);
}

/* =======================================================================
   NAV LINKS LAYOUT
   ======================================================================= */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

.nav-links > li {
  display: flex;
  align-items: center;
}

/* =======================================================================
   DROPDOWN
   ======================================================================= */
.dropdown {
  flex: 0 0 auto;
  position: relative;
}

.caret {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.4rem;
  align-self: center;
  transition: transform 0.3s ease;
}

.dropdown.open .caret {
  transform: rotate(225deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  list-style: none;
  display: none;
  flex-direction: column;
  background: var(--dropdown-bg);
  padding-left: 0 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 1001;
  user-select: none;
}

.dropdown-menu li {
  padding: 0.5rem 1rem;
}

.dropdown-menu .nav-item {
  color: var(--dropdown-text);
}

.dropdown:hover .dropdown-menu {
  display: flex;
  animation: dropdownSlideDown 0.3s ease forwards;
}

@keyframes dropdownSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =======================================================================
   HAMBURGER (MOBILE)
   ======================================================================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.hamburger span {
  height: 3px;
  width: 100%;
  background: var(--hamburger-background);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    background 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Update hamburger colors on scroll */
.navbar.scrolled .hamburger span {
  background: var(--hamburger-background);
}

/* =======================================================================
   MOBILE NAV
   ======================================================================= */
@media (max-width: 814px) {
  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    flex-direction: column;
    background: var(--dropdown-background);
    width: 300px;
    height: auto;
    z-index: 4000;
    padding: 1rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .nav-links.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hamburger {
    display: flex;
  }

  /* Mobile dropdown */
  .dropdown-menu {
    position: static;
    display: block;
    max-height: 0;
    width: 100%;
    min-width: 200px;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.3s ease,
      opacity 0.3s ease;
  }

  .dropdown-menu li {
    padding: 0.75rem 1rem;
  }

  .dropdown.open .dropdown-menu {
    max-height: 500px;
    opacity: 1;
  }

  .dropdown > .nav-item,
  .nav-item {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links > li {
    width: 100%;
  }
}
