/* ============================================================
   CREDIT KERNEL — Navigation (Figma React export alignment)
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 0;
  height: var(--nav-h);
  transition: background .2s, border-color .2s, box-shadow .2s;
}

[data-theme="dark"] .site-nav {
  background: #1a1e1c;
}

.site-nav.scrolled {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15,58,35,.06);
}

[data-theme="dark"] .site-nav.scrolled {
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* ── Brand ──────────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand__logo { display: none; }
.brand__logo--light { display: block; height: 40px; width: 252.428px; }
[data-theme="dark"] .brand__logo--light { display: none; }
[data-theme="dark"] .brand__logo--dark { display: block; height: 40px; width: 252.428px; }

/* ── Right group (links + CTA, mirrors Figma ButtonGroup) ─── */
.nav__group {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 72px;
}

/* ── Desktop nav links ──────────────────────────────────────── */
.nav__links {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 72px;
  margin: 0;
}
/* desktop only — mobile overrides to display:block below */

.nav__link {
  display: inline-flex;
  align-items: center;
  height: 72px;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: rgba(0,205,95,0.6);
  transition: color .15s;
  white-space: nowrap;
}
.nav__link:hover,
.nav-item.is-active .nav__link {
  color: var(--accent);
}

/* Products accent link */
.nav__link--accent {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: rgba(0,205,95,0.6);
}
.nav__link--accent:hover { color: var(--accent); }
.nav-item.is-active .nav__link {
  gap: 4px;
}
.nav-item.is-active .nav__link svg {
  width: 12px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Products dropdown (mobile-first) ───────────────────────── */
.nav-item--has-drop {
  position: relative;
}
.nav-item--has-drop .nav__link--accent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Default = mobile accordion state */
.nav-dropdown {
  position: static;
  height: 0;
  overflow: hidden;
  padding: 0 0 0 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  pointer-events: all;
  transform: none;
  transition: height .3s ease;
  min-width: 0;
}

/* Desktop: override to floating panel */
@media (min-width: 1024px) {
  .nav__links > .nav-item {
    display: flex;
    align-items: center;
    height: 72px;
  }
  .nav-item--has-drop::after {
    position: absolute;
    top: 64px;
    right: -18px;
    left: -18px;
    height: 24px;
    content: "";
  }
  .nav-dropdown {
    position: absolute;
    top: calc(100% - 4px);
    left: -18px;
    min-width: 244px;
    height: auto;
    overflow: visible;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav-item--has-drop:hover .nav-dropdown,
  .nav-item--has-drop:focus-within .nav-dropdown,
  .nav-item--has-drop.is-open .nav-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }
  .nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background .15s, color .15s;
  }
  .nav-dropdown a:hover,
  .nav-dropdown a:focus-visible {
    background: var(--bg-alt);
    color: var(--text);
  }
}
.nav-dropdown__divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── CTA button (Figma: border #00CD5F, rounded-20px, 14px) */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 118px;
  width: 118px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid #00CD5F;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  color: #021914;
  background: transparent;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.nav-cta:hover { background: rgba(0,205,95,0.08); }
[data-theme="dark"] .nav-cta {
  color: #00CD5F;
  border-color: #00CD5F;
}
[data-theme="dark"] .nav-cta:hover { background: rgba(0,205,95,0.15); }

/* ── Mobile-only elements ───────────────────────────────────── */
.nav-cta-mobile    { display: none; }
.lang-switch-mobile { display: none; }
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none;
  padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .25s;
  transform-origin: center;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile (<1024px) ───────────────────────────────────────── */
@media (max-width: 1023px) {
  .nav-hamburger { display: flex; }
  .nav__group .nav-cta { display: none; }
  .brand__logo--light,
  .brand__logo--dark { width: 180px; height: auto; }

  .nav__links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
    padding: var(--space-5);
    margin: 0;
    list-style: none;
    background: #fff;
    border-top: 1px solid var(--border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform .3s ease;
  }
  [data-theme="dark"] .nav__links {
    background: #1a1e1c;
    border-color: rgba(255,255,255,.08);
  }
  .nav__links.is-open { transform: translateX(0); }

  .nav-item {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--border);
  }
  [data-theme="dark"] .nav-item {
    border-color: rgba(255,255,255,.08);
  }
  .nav-item > a {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 48px;
    padding: 14px 0;
    font-size: 17px;
    width: 100%;
    color: #03241a;
    font-weight: 600;
  }
  [data-theme="dark"] .nav-item > a {
    color: #e6eeea;
  }
  .nav-item > a:hover,
  .nav-item.is-active > a {
    color: var(--accent);
  }
  .nav-item--has-drop .nav__link--accent { font-size: 17px; }
  .nav-item--has-drop::after { display: none; }
  .nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    min-height: 44px;
    color: #5c5c5c;
    background: none;
    transition: color .15s;
  }
  .nav-dropdown a:last-child {
    padding-bottom: 24px;
  }
  [data-theme="dark"] .nav-dropdown a {
    color: #b8cec2;
  }
  [data-theme="dark"] .nav-dropdown a:hover {
    color: #e6eeea;
  }

  .nav-cta-mobile { display: flex; margin-top: 24px; width: 100%; }
  .nav-cta-mobile .btn { width: 100%; justify-content: center; }
  .lang-switch-mobile {
    display: flex; gap: 8px; margin-top: 20px; padding-bottom: 24px;
  }
  .lang-switch-mobile a {
    padding: 9px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 14px; font-weight: 700;
    color: var(--text-muted);
  }
  .lang-switch-mobile a.active { border-color: var(--accent); color: var(--accent); }

  /* Hamburger icon colors */
  [data-theme="dark"] .nav-hamburger span {
    background: #e6eeea;
  }
}
