/* Keep the catalog rail attached to the header in normal flow and while scrolling. */
body:has(> main > .portal-catalog-tabs) > .topbar {
  margin-bottom: 0 !important;
  transform: none !important;
}

body:has(> main > .portal-catalog-tabs) > main#content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body > main#content > .portal-catalog-tabs {
  box-sizing: border-box;
  margin-top: 0 !important;
  margin-inline: calc((100% - var(--header-stack-width, 100%)) / 2) !important;
  max-width: none !important;
  top: var(--topbar-runtime-offset, 58px) !important;
  transform: none !important;
  width: var(--header-stack-width, 100%) !important;
}

/* Both rows travel the same distance, including a taller wrapped mobile rail. */
html.is-topbar-hidden body:has(> main > .portal-catalog-tabs) > .topbar,
html.is-topbar-hidden body > main#content > .portal-catalog-tabs {
  pointer-events: none;
  transform: translateY(calc(-1 * var(--header-stack-height, 180px))) !important;
}
