/* ============================================================================
 * beecore-global-header.css  —  SINGLE SOURCE OF TRUTH for the public header.
 * ----------------------------------------------------------------------------
 * ONE renderer (beecore-products-nav.js -> #bc-global-header), ONE DOM, ONE CSS.
 * Every public route (/, /products/*, /models, /pricing, /docs, /status) renders
 * this exact header. Geometry is LOCKED here and scoped under #bc-global-header so
 * it outranks the React bundle CSS and any per-route CSS (id specificity wins).
 *
 * Active state changes ONLY color/background — never font-size / font-weight /
 * padding / margin / border, so layout cannot shift between routes.
 * ========================================================================== */

/* Hide the React-rendered header inside #root. The global header above is the
   only header on the public site. Scoped to #root so it never affects page content. */
html.bc-gh-active #root > nav.nav,
html.bc-gh-active #root > header { display: none !important; }

/* ---- Root ---- */
#bc-global-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 65px;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #eef0f3;
  z-index: 1000;
  box-sizing: border-box;
  display: block;
}

/* ---- Inner container (locked max-width + padding) ---- */
#bc-global-header .nav-inner {
  max-width: 1440px;
  margin-inline: auto;
  margin-top: 0;
  margin-bottom: 0;
  width: 100%;
  height: 65px;
  padding: 0 32px 0 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

/* ---- Left cluster: brand + search ---- */
#bc-global-header .nav-left {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  flex-shrink: 0;
}
#bc-global-header .nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
#bc-global-header .nav-brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* ---- Search box (fixed width; placeholder text may change with language) ---- */
#bc-global-header .nav-search {
  width: 200px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 12px;
  background: #f8fafc;
  flex-shrink: 0;
  box-sizing: border-box;
}
#bc-global-header .nav-search-icon {
  width: 14px; height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
}
#bc-global-header .nav-search input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #1e293b;
  font-family: inherit;
}
#bc-global-header .nav-search input::placeholder { color: #94a3b8; }

/* ---- Center cluster: nav links (fixed gap + left offset) ---- */
#bc-global-header .nav-center {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 18px;
  flex-shrink: 0;
}

/* ---- Nav links: identical box on every route; active changes only color/bg ---- */
#bc-global-header .nav-link {
  display: inline-flex;
  align-items: center;
  height: 33px;
  padding: 0 14px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;          /* uniform -> no width shift on active */
  line-height: 1;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  border: 0;
  background: transparent;
  transition: color .15s ease, background .15s ease;
}
#bc-global-header .nav-link:hover { color: #181818; }
#bc-global-header .nav-link.bc-nav-active:hover { color: #B77900; }
#bc-global-header .nav-link.bc-nav-active {
  color: #B77900;
  background: transparent;
}

/* ---- Right cluster: language + login + CTA (pushed to the edge) ---- */
#bc-global-header .nav-right {
  
  margin-right: calc(-1 * ((100vw - 1440px) / 2));
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#bc-global-header .lang-switch,
#bc-global-header .bc-lang-switch {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
#bc-global-header .lang-btn.bc-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
#bc-global-header .nav-login {
  display: inline-flex;
  align-items: center;
  height: 33px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  white-space: nowrap;
}
#bc-global-header .btn-primary {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  /* BeeCore original gold CTA — restored from Production Gold Header (#F5B800 brand gold) */
  background: #F5B800;
  color: #1a1a1a;
  border: 1px solid #F5B800;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
#bc-global-header .btn-primary:hover {
  background: #e0ab00;
  border-color: #e0ab00;
  color: #1a1a1a;
}
#bc-global-header .btn-primary:active {
  background: #cf9a00;
  border-color: #cf9a00;
}

/* Products chevron (added by nav.js) */
#bc-global-header .ag-nav-chevron {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #94a3b8;
}
/* Products chevron — gold when parent nav is active */
#bc-global-header .nav-link.bc-nav-active .ag-nav-chevron {
  color: #B77900;
}

/* ---- Language button: SVG globe icon (monochrome, currentColor) ---- */
#bc-global-header .bc-lang-btn .bc-lang-globe-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #181818;
  flex-shrink: 0;
}
#bc-global-header .bc-lang-btn .bc-lang-globe-wrap svg {
  display: block;
  stroke: currentColor;
  fill: none;
}
#bc-global-header .bc-lang-btn .bc-lang-short {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}

/* Old inline search form replaced by .bc-search-trigger — hide ALL instances */
.nav-search { display: none !important; }

/* ---------------------------------------------------------------------------
 * Header nav increment (Gold Baseline minimal increment)
 * Search trigger relocated into the RIGHT cluster, immediately before Language.
 * Keep ALL of its existing visual properties (height/width/radius/icon/
 * placeholder/shortcut/hover/focus/interaction) — only neutralize the old
 * first-child-of-nav-inner left offset so it sits correctly inside nav-right.
 * ------------------------------------------------------------------------- */
#bc-global-header .nav-right .bc-search-trigger {
  left: 0;
}

/* Disabled dropdown items (Playground Chat/Image/Video and Developer
   API Reference/Quickstart/Examples placeholders — no real route yet) read as
   "Coming Soon": non-interactive, no fake navigation, visually de-emphasized.
   The base .ag-pd-item--disabled (cursor:default) lives in ai-gateway-page.css;
   these rules only add a subtle de-emphasis. Scoped to .ag-pd so they never
   leak to unrelated elements. */
.ag-pd .ag-pd-item--disabled { opacity: 0.55; }
.ag-pd .ag-pd-item--disabled:hover { background-color: transparent; }

/* ---------------------------------------------------------------------------
 * Geometry fix (1440 fit) — the 210px search trigger left the middle flow for
 * the right cluster, so the center nav must (a) start after the LOCKED logo
 * (ends at ~140.5px) and (b) stay narrow enough to clear the right cluster
 * (search 210px + language + login + CTA ≈ 512px, right-aligned). nav-link
 * backgrounds are transparent (active state = color only), so tightening the
 * invisible horizontal padding 14px -> 4px has zero visual footprint while
 * keeping the uniform 24px gap, font size and every locked property intact.
 * Result @1440: logo ends 140.5 | nav 164..881 | search starts 908 — no
 * overlap anywhere; gap logo→Home ≈ 24px matches the nav's own rhythm.
 *
 * SCOPED to >=1440px (the design width). The 164px logo clearance only fits
 * once the inner row is capped at 1440px; below that the 8-link center nav +
 * 512px right cluster already exceed available width (no mobile hamburger
 * menu exists — the React menu is out of scope for this increment), so we let
 * the base .nav-center margin-left:18px (line 107) apply and the layout falls
 * back to the original nav-core baseline instead of introducing overflow.
 * ------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  #bc-global-header .nav-center {
    margin-left: 164px;
  }
}
#bc-global-header .nav-link {
  padding: 0 4px;
}

/* ===========================================================================
 * MOBILE GLOBAL HEADER (P1-1 remediation, 2026-10-07)
 * ---------------------------------------------------------------------------
 * Defect: below 1440px the 8-link center nav (~550px) + right cluster
 * (~470px) exceed available width and the nav rows overlap the logo. The
 * only prior media query was min-width:1440px, so 390px collapsed.
 *
 * Breakpoint choice: max-width:1023px (NOT the recommended 820px) — geometry
 * audit shows the desktop row already needs ~1022px (nav 550 + right 472),
 * so 821–1023 would still overlap. Desktop (>=1024px) is byte-identical to
 * the frozen layout: this block only ever applies below 1024px.
 *
 * Design language: white bg, thin #e2e8f0 border, black/gray text, existing
 * gold (#F5B800) used only for focus ring + the existing CTA. No new
 * breakpoints, no redesign.
 * ========================================================================= */

/* --- Menu trigger (hidden on desktop, shown <=1023px) ------------------- */
#bc-global-header .bc-mobile-toggle {
  display: none;                       /* desktop default: absent */
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}
#bc-global-header .bc-mobile-toggle svg { display: block; }
#bc-global-header .bc-mobile-toggle:focus-visible {
  outline: 2px solid #F5B800;
  outline-offset: 2px;
}

/* --- Drawer panel (fixed under header; child of #bc-global-header) ------ */
#bc-global-header .bc-mobile-drawer {
  display: none;                       /* closed = fully out of tab order */
  position: fixed;
  top: 66px;                           /* header 65px + 1px border */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: #ffffff;
  border-bottom: 1px solid #eef0f3;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px 24px;
  box-sizing: border-box;
}
#bc-global-header .bc-mobile-drawer.is-open { display: block; }

#bc-global-header .bc-mob-link {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 4px;
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  border-radius: 8px;
}
#bc-global-header .bc-mob-link:hover { color: #181818; background: #f8fafc; }
#bc-global-header .bc-mob-link:focus-visible {
  outline: 2px solid #F5B800;
  outline-offset: 1px;
}
#bc-global-header .bc-mob-link.bc-nav-active { color: #B77900; }

#bc-global-header .bc-mob-group-label {
  margin: 14px 4px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}
#bc-global-header .bc-mob-sub {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px 0 18px;
  font-size: 14.5px;
  font-weight: 400;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
}
#bc-global-header .bc-mob-sub:hover { color: #181818; background: #f8fafc; }
#bc-global-header .bc-mob-sub:focus-visible {
  outline: 2px solid #F5B800;
  outline-offset: 1px;
}
#bc-global-header .bc-mob-sub.bc-nav-active { color: #B77900; }

#bc-global-header .bc-mob-divider {
  height: 1px;
  background: #eef0f3;
  margin: 14px 0;
}
#bc-global-header .bc-mob-authrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}
#bc-global-header .bc-mob-authrow .bc-mob-login {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  border-radius: 8px;
}
#bc-global-header .bc-mob-authrow .bc-mob-login:hover { color: #181818; }
#bc-global-header .bc-mob-authrow .btn-primary {
  margin-left: auto;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

/* --- Mobile layout rearrangement (<=1023px ONLY) ------------------------ */
@media (max-width: 1023px) {
  #bc-global-header .nav-inner { padding: 0 12px 0 0; }
  #bc-global-header .nav-left { left: 16px; }
  /* Desktop rows leave the layout entirely (display:none = not focusable) */
  #bc-global-header .nav-center,
  #bc-global-header .nav-right .bc-search-trigger,
  #bc-global-header .nav-right .lang-switch,
  #bc-global-header .nav-right .nav-login { display: none !important; }
  /* nav-right margin is computed for the 1440 cap — neutralize it */
  #bc-global-header .nav-right { margin-right: 0; gap: 10px; }
  #bc-global-header .nav-right .btn-primary {
    height: 34px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  #bc-global-header .bc-mobile-toggle { display: inline-flex; }
}

/* Desktop hard-freeze: even if markup leaks, drawer/toggle never render >=1024 */
@media (min-width: 1024px) {
  #bc-global-header .bc-mobile-toggle,
  #bc-global-header .bc-mobile-drawer { display: none !important; }
}