/**
 * Navbar chrome unification after merging Entertainment + Copilot nav.
 * Unique filename: nginx caches /css/ immutable.
 *
 * Staging's compact-search sheets pin Login next to Search under the tabs
 * and hide Partners / About below 1600px. This PR keeps Copilot after
 * Connect, but restores the landing chrome contract:
 *
 *   - primary tabs on one 64px row, including Partners, About, Help Centre
 *   - Login / avatar / bell / language on that same row
 *   - wide, page-centred Search immediately under the nav
 */

@media (min-width: 1280px) {
  html[data-active-module="landing"] {
    --erp-desktop-search-h: 3rem;
  }

  html[data-active-module="landing"] body.erp-body #navbar.navbar,
  html[data-active-module="landing"] body.erp-body #navbar.erp-shell-navbar,
  html[data-active-module="landing"] body.erp-body nav.navbar.erp-shell-navbar {
    flex-direction: column !important;
    align-items: stretch !important;
    height: var(--erp-nav-main-h, 4rem) !important;
    max-height: var(--erp-nav-main-h, 4rem) !important;
    overflow: visible !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar .container.nav-container,
  html[data-active-module="landing"] body.erp-body #navbar .nav-container {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 18.5rem !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar {
    order: 2 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--erp-desktop-search-h, 3rem) !important;
    min-height: var(--erp-desktop-search-h, 3rem) !important;
    max-height: var(--erp-desktop-search-h, 3rem) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
    z-index: 6 !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: var(--erp-desktop-search-h, 3rem) !important;
    background-color: var(--erp-nav-chrome-bg, #070d1a) !important;
    background-image: var(--erp-nav-chrome-surface) !important;
    background-size: var(--erp-nav-chrome-size) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
    pointer-events: none !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto auto auto !important;
    grid-template-rows: var(--erp-nav-main-h, 4rem) var(--erp-desktop-search-h, 3rem) !important;
    align-items: center !important;
    justify-content: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(var(--erp-nav-main-h, 4rem) + var(--erp-desktop-search-h, 3rem)) !important;
    margin: calc(-1 * var(--erp-nav-main-h, 4rem)) 0 0 !important;
    padding: 0 1.15rem 0 0 !important;
    gap: 0 12px !important;
    pointer-events: none !important;
    background: transparent !important;
    overflow: visible !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-spacer,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #navUserProfile {
    display: none !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar #utilAiSearchSlot,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-ai-search-slot {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    justify-self: center !important;
    width: min(42rem, calc(100% - 14rem)) !important;
    min-width: 18rem !important;
    max-width: 42rem !important;
    flex: none !important;
    height: 40px !important;
    pointer-events: auto !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar #us-trigger,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .us-trigger,
  html[data-active-module="landing"] body.erp-body #navbar #utilAiSearchSlot .us-trigger {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > .nav-auth-buttons,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #navUserChip,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #navNotifWrap,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > .util-lang-wrap,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #utilLangWrapper {
    grid-row: 1 !important;
    align-self: center !important;
    height: var(--erp-nav-main-h, 4rem) !important;
    min-height: var(--erp-nav-main-h, 4rem) !important;
    max-height: var(--erp-nav-main-h, 4rem) !important;
    margin: 0 !important;
    pointer-events: auto !important;
    position: static !important;
    transform: none !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > .nav-auth-buttons {
    grid-column: 2 !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #navUserChip {
    grid-column: 3 !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #navNotifWrap {
    grid-column: 4 !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > .util-lang-wrap,
  html[data-active-module="landing"] body.erp-body #navbar #util-bar .util-bar-inner > #utilLangWrapper {
    grid-column: 5 !important;
  }

  html[data-active-module="landing"] body.erp-body #landing .erp-hero.erp-hero--command-center {
    padding-top: calc(2.4rem + var(--erp-desktop-search-h, 3rem)) !important;
  }
}

@media (min-width: 1280px) {
  html[data-active-module="landing"] body.erp-body #navbar #navMenu,
  html[data-active-module="landing"] body.erp-body #navbar .nav-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-evenly !important;
    gap: 0 !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.partners-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.nav-end-link.partners-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.about-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.nav-end-link.about-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.help-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.nav-end-link.help-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.copilot-li,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li.nav-end-link.copilot-li {
    display: flex !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li > a,
  html[data-active-module="landing"] body.erp-body #navbar .nav-menu > li > a {
    padding: 0 0.12rem !important;
    font-size: 0.76rem !important;
    white-space: nowrap !important;
  }

  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li > a .nav-chevron,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li > a .pp-chevron,
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li > a .material-symbols-outlined {
    display: none !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

@media (min-width: 1440px) {
  html[data-active-module="landing"] body.erp-body #navbar #navMenu > li > a,
  html[data-active-module="landing"] body.erp-body #navbar .nav-menu > li > a {
    padding: 0 0.16rem !important;
    font-size: 0.78rem !important;
  }
}
