/* =========================================================================
   CDO Global — Site header & navigation (sync with cdo-global-home.pplx.app)
   ========================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding-top: 0;
  padding-bottom: 0;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.site-logo img { display: block; height: 32px; width: auto; }

/* ---------- Primary nav ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto 0 16px;
}

.site-nav > .nav-item {
  position: relative;
}

.site-nav > .nav-item > a,
.site-nav > .nav-item > button.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font: 500 14px/1.2 var(--font-sans, 'Manrope', system-ui, sans-serif);
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
}
.site-nav > .nav-item > a:hover,
.site-nav > .nav-item > button.nav-link:hover,
.site-nav > .nav-item.is-open > button.nav-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.site-nav > .nav-item > a.is-active {
  color: var(--lime, #74D414);
}

.nav-caret {
  width: 10px;
  height: 10px;
  display: inline-block;
  transition: transform .2s ease;
}
.nav-item.is-open .nav-caret { transform: rotate(180deg); }

/* ---------- Dropdown ---------- */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  padding: 8px;
  background: rgba(18, 20, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 110;
}
.nav-item.is-open > .nav-dropdown { display: flex; }

.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  font: 500 14px/1.35 var(--font-sans, 'Manrope', system-ui, sans-serif);
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.nav-dropdown a:hover {
  background: rgba(116, 212, 20, 0.10);
  color: var(--lime, #74D414);
}

/* Mega dropdown (для ИИ-продукты и Решения) */
.nav-dropdown.is-mega { min-width: 340px; }

/* ---------- Right side: lang + CTA ---------- */
.header-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
.lang-switch button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 5px 10px;
  font: 600 12px/1 var(--font-sans, 'Manrope', system-ui, sans-serif);
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font: 600 14px/1 var(--font-sans, 'Manrope', system-ui, sans-serif);
  color: #0B0C10;
  background: var(--lime, #74D414);
  border-radius: 10px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-write:hover {
  background: #82e616;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(116, 212, 20, 0.25);
}

/* Old phone — hidden in new nav */
.site-header .header-phone { display: none; }

/* ---------- Burger ---------- */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
  .site-nav {
    position: fixed;
    inset: 72px 0 0 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    background: rgba(11, 12, 16, 0.98);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    max-height: calc(100vh - 72px);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 105;
  }
  .site-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .site-nav > .nav-item { width: 100%; }
  .site-nav > .nav-item > a,
  .site-nav > .nav-item > button.nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 4px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
    padding: 6px;
  }
  .nav-dropdown a {
    padding: 12px 14px;
    font-size: 14px;
  }

  .nav-toggle { display: inline-flex; }

  /* lang & CTA on mobile: lang remains visible, CTA collapses inside menu */
  .header-cta { gap: 8px; }
  .header-cta .btn-write { display: none; }

  /* Mobile-only CTA inside the menu */
  .site-nav .mobile-cta {
    margin-top: 12px;
    display: flex;
  }
  .site-nav .mobile-cta a {
    flex: 1;
    text-align: center;
    padding: 14px;
    background: var(--lime, #74D414);
    color: #0B0C10;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
  }
}

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

/* Avoid scroll when mobile menu open */
body.nav-open { overflow: hidden; }
