/* ============================================================
   Nav UI Kit — Regenerative Performance
   Styles for the header component (header.html).
   Uses design-system.css tokens.
   ============================================================ */

/* ---- Sticky Nav Bar ---- */
.nav-sticky {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(1rem, 4vw, 3rem);
  background: var(--rp-white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ---- Logo ---- */
.nav-logo img {
  height: 44px;
  width: auto;
}

/* ---- Desktop Links ---- */
.nav-desktop-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
  list-style: none;
}

.nav-item > a {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rp-gray);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
}

.nav-item > a:hover {
  color: var(--rp-orange);
}

/* ---- Dropdown Trigger ---- */
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rp-gray);
  padding: 0;
  transition: color 0.25s ease;
}

.nav-dropdown-trigger:hover {
  color: var(--rp-orange);
}

.nav-dropdown-trigger svg {
  transition: transform 0.25s ease;
}

/* ---- Dropdown Menu ---- */
.nav-item--has-dropdown .nav-dropdown {
  position: absolute;
  top: 100%;
  left: -1rem;
  width: max-content;
  min-width: 280px;
  background: var(--rp-white);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 1001;
  list-style: none;
  margin: 0;
}

.nav-item--has-dropdown:hover .nav-dropdown,
.nav-item--has-dropdown.dropdown-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item--has-dropdown:hover .nav-dropdown-trigger svg,
.nav-item--has-dropdown.dropdown-open .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-item--has-dropdown .nav-dropdown a {
  display: block;
  padding: 0.5rem 1.5rem;
  font-size: var(--text-sm);
  color: var(--rp-gray);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item--has-dropdown .nav-dropdown a:hover {
  background: var(--rp-light);
  color: var(--rp-blue);
}

/* ---- Nav Actions (Phone + CTA) ---- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

/* ---- Hamburger Button ---- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0;
  z-index: 1002;
  transition: background 0.2s ease;
}

.nav-hamburger:hover,
.nav-hamburger:focus-visible {
  background: var(--rp-blue-10);
  outline: none;
}

.nav-hamburger__bar-area {
  width: 24px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-hamburger__line {
  display: block;
  height: 2px;
  width: 24px;
  background: var(--rp-blue);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hamburger -> X animation when menu is open */
.nav-hamburger.active .nav-hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active .nav-hamburger__line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active .nav-hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile Overlay ---- */
.nav-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---- Mobile Slide-Out Menu ---- */
.nav-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--rp-white);
  z-index: 999;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.nav-mobile-menu.active {
  right: 0;
}

.nav-mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--rp-gray);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-mobile-menu a:hover,
.nav-mobile-menu a:focus-visible {
  background: var(--rp-blue-10);
}

.nav-mobile-menu a:hover {
  color: var(--rp-orange);
}

.nav-mobile-section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rp-orange);
  padding: 0.75rem 0 0.25rem;
  margin-bottom: 0;
  border-bottom: none;
}

/* Close button inside mobile menu */
.nav-mobile-close {
  display: flex;
  align-self: flex-end;
  margin-bottom: 1rem;
}

/* ---- Mobile Header Actions (phone icon + hamburger) ---- */
.nav-mobile-actions {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-mobile-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
  color: var(--rp-blue);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-mobile-phone:hover,
.nav-mobile-phone:focus-visible {
  background: var(--rp-blue-10);
  color: var(--rp-orange);
  outline: none;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .nav-desktop-links {
    display: none;
  }

  .nav-actions {
    display: none;
  }

  .nav-mobile-actions {
    display: flex;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-logo img {
    height: 36px;
  }

  .nav-sticky {
    padding: 0 var(--space-md);
    min-height: 72px;
  }
}

@media (min-width: 1025px) {
  .nav-mobile-menu {
    display: none;
  }

  .nav-mobile-overlay {
    display: none;
  }

  .nav-hamburger {
    display: none;
  }

  .nav-mobile-actions {
    display: none;
  }
}
