/* ============================================================
   PROPHACITE — NAVIGATION COMPONENT
   BEM: .nav, .nav__inner, .nav__logo, .nav__mark, .nav__name,
        .nav__links, .nav__dot, .nav__actions, .nav__hamburger,
        .nav__mobile, .nav.scrolled
   Depends on: variables.css
   ============================================================ */

/* ── Base bar ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #0B1D36;
  border-bottom: 1px solid rgba(0, 194, 178, 0.12);
  transition: all var(--transition-base);
}

/* Scroll state */
.nav.scrolled {
  background: #0B1D36;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  border-bottom-color: rgba(0, 194, 178, 0.08);
}

/* ── Inner flex container ── */
.nav__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* ── Logo link ── */
.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  height: 68px;
  font-size: 26px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SVG mark wrapper ── */
.nav__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Wordmark text ── */
.nav__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-white);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ── Center link list ── */
.nav__links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: stretch;
  height: 100%;
}

.nav__links a {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition-fast);
}

.nav__label {
  display: inline-block;
}

.nav__links a:hover {
  color: var(--teal);
}

.nav__links a.active,
.nav__links li.active a,
.nav__links li.active a:hover {
  color: var(--nav-active-text-color);
}

/* Premium bottom underline for active navbar link */
.nav__links li {
  --nav-active-color: #D4AF37;
  --nav-active-text-color: var(--teal);
  --nav-active-shadow: rgba(212, 175, 55, 0.45);
  position: relative;
  display: flex;
  align-items: center;
}

.nav__link--pre-intent {
  --nav-active-color: #D4AF37;
  --nav-active-text-color: #22C55E;
  --nav-active-shadow: rgba(212, 175, 55, 0.45);
}

.nav__link--pre-diligence {
  --nav-active-color: #D4AF37;
  --nav-active-text-color: #A78BFA;
  --nav-active-shadow: rgba(212, 175, 55, 0.45);
}

.nav__link--risk {
  --nav-active-color: #D4AF37;
  --nav-active-text-color: #EF4444;
  --nav-active-shadow: rgba(212, 175, 55, 0.45);
}

.nav__links li.active::after {
  content: '';
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--nav-active-color);
  box-shadow: 0 0 10px var(--nav-active-shadow);
  z-index: 10;
}

.nav__links a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 4px;
}

/* FAQ link treatment */
.nav__link--faq a {
  color: rgba(255, 255, 255, 0.55);
}

.nav__link--faq a:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* ── Product indicator dots ── */
.nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.nav__dot--green {
  background: #2ECC71;
}

.nav__dot--purple {
  background: #A78BFA;
}

.nav__dot--red {
  background: #EF6B6B;
}

.nav__link--pre-intent.active a,
.nav__link--pre-intent.active a:hover {
  color: #22C55E !important;
}

.nav__link--pre-intent.active::after,
.nav__link--pre-intent.active a::after {
  background: #D4AF37 !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45) !important;
}

.nav__link--pre-diligence.active a,
.nav__link--pre-diligence.active a:hover {
  color: #A78BFA !important;
}

.nav__link--pre-diligence.active::after,
.nav__link--pre-diligence.active a::after {
  background: #D4AF37 !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45) !important;
}

.nav__link--risk.active a,
.nav__link--risk.active a:hover {
  color: #EF4444 !important;
}

.nav__link--risk.active::after,
.nav__link--risk.active a::after {
  background: #D4AF37 !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45) !important;
}

/* ── Right side actions ── */

/* ── Hamburger button (mobile) ── */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.nav__hamburger span {
  width: 18px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* X state */
.nav__hamburger.mobile-open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav__hamburger.mobile-open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.mobile-open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

.nav__hamburger:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

/* ── Mobile panel ── */

/* ── Responsive: hamburger at <=768px ── */
@media (max-width: 768px) {
  .nav__inner {
    height: 64px;
    position: relative;
  }

  .nav__logo {
    height: 64px;
  }

  .nav__links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0B1D36;
    flex-direction: column;
    height: auto;
    padding: 0 var(--container-padding, 1rem);
    gap: 0;
    border-bottom: 1px solid transparent;
    z-index: 1000;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 220ms ease, transform 280ms cubic-bezier(0.4, 0, 0.2, 1), padding 280ms cubic-bezier(0.4, 0, 0.2, 1), border-bottom-color 180ms ease;
  }

  .nav__links.mobile-open {
    padding: 1rem var(--container-padding, 1rem) 1.5rem;
    border-bottom-color: rgba(0, 194, 178, 0.12);
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav__links li {
    width: 100%;
    text-align: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav__links li a {
    justify-content: center;
    /* centers the flex content (text + dot) */
    width: auto;
    display: inline-flex;
    margin: 0 auto;
    position: relative;
  }

  .nav__links li.active::after {
    display: none;
  }

  .nav__links a:hover::after,
  .nav__links a.active::after,
  .nav__links li.active a::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 3px;
    background: var(--nav-active-color);
    box-shadow: 0 0 10px var(--nav-active-shadow);
    z-index: 10;
  }

  .nav__links li:last-child {
    border-bottom: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__mark svg {
    width: 32px;
    height: 32px;
  }
}
