/* CIDB V15 — equal optical gaps in the shared header, fluid top bar.
   Runs after the 47 Builder runtime CSS.  Applies to both the static pages
   and the /admin menu renderer (they share the same class names). */

/* The builder's global .wrap rule can force a 1400px max and a 70px inset.
   Override it on these two components only, leaving page content untouched. */
html[data-theme="light"] body .cidb-topbar-elite > .wrap,
html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap {
  box-sizing:border-box!important;
  width:calc(100% - 32px)!important;
  max-width:none!important;
  margin-inline:16px!important;
  padding-inline:0!important;
}

/* Three real layout zones: brand | navigation | contact + RO/EN.
   The central nav has intrinsic width, with equal available space to either
   adjacent zone. No flex-grow on the navigation to disguise asymmetry. */
html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap {
  display:grid!important;
  grid-template-columns:max-content minmax(0,1fr) max-content!important;
  align-items:center!important;
  justify-content:stretch!important;
  column-gap:0!important;
  height:100%!important;
}
html[data-theme="light"] body .site-header.cidb-header-elite .cidb-brand-elite {
  grid-column:1!important;
  justify-self:start!important;
  margin:0!important;
}
html[data-theme="light"] body .site-header.cidb-header-elite .cidb-nav-elite {
  grid-column:2!important;
  display:flex!important;
  flex:0 0 auto!important;
  width:max-content!important;
  max-width:100%!important;
  min-width:0!important;
  justify-self:center!important;
  justify-content:center!important;
  margin:0!important;
}
html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions {
  grid-column:3!important;
  justify-self:end!important;
  flex:0 0 auto!important;
  margin:0!important;
}

/* Top bar follows exactly the same edge guides as the white navigation. */
html[data-theme="light"] body .cidb-topbar-elite > .wrap {
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:16px!important;
  min-width:0!important;
}
html[data-theme="light"] body .cidb-topbar-elite .topbar-links {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:clamp(12px,1.5vw,27px);
  margin-left:auto!important;
  min-width:0;
}

/* Keep the complete seven-category menu at desktop sizes; at the previous
   1319px threshold use the accessible hamburger without any overlap. */
@media (max-width:1319px) {
  html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap {
    grid-template-columns:minmax(0,1fr) max-content!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-nav-elite {
    display:none!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-brand-elite {
    grid-column:1!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions {
    grid-column:2!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .menu-toggle {
    display:grid!important;
    place-items:center!important;
  }
}

@media (max-width:650px) {
  html[data-theme="light"] body .cidb-topbar-elite > .wrap,
  html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap {
    width:calc(100% - 22px)!important;
    margin-inline:11px!important;
  }
  html[data-theme="light"] body .cidb-topbar-elite > .wrap {gap:8px!important}
}

@media (max-width:760px) {
  /* Mobile keeps the original concise, single-line top bar. */
  html[data-theme="light"] body .cidb-topbar-elite .topbar-links {
    display:none!important;
  }
}
