/* Company navigation, approved1.2. Load after the existing header styles. */
.mps-header {
  --mps-company-panel-width: 322px; /* 70% of the original 460px mockup. */
  --mps-company-paper: #f7f7f0;
  --mps-company-ink: #000;
  /* Exactly 48px at the normal 16px root size; grows with enlarged user text. */
  --mps-company-action-height: max(48px, 3rem);
  --mps-company-action-radius: 6px;
}

.mps-header .mps-utility {
  position: relative;
  z-index: 30;
}

.mps-header .mps-utility-inner {
  position: relative;
  min-height: 64px;
  flex-wrap: nowrap;
  gap: 12px 24px;
  padding-block: 8px;
}

.mps-header .mps-utility-inner > .mps-contact {
  flex: 1 1 auto;
  min-width: 0;
}

.mps-header .mps-company-menu {
  position: static;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  margin-inline-start: auto;
}

/* One action typeface, height, weight and radius token for Search and Menu. */
.mps-header .mps-site-search button,
.mps-header .mps-company-menu-trigger {
  height: var(--mps-company-action-height);
  min-height: var(--mps-company-action-height);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--mps-company-ink);
}

.mps-header .mps-site-search button {
  border-radius: 0 var(--mps-company-action-radius) var(--mps-company-action-radius) 0;
}

.mps-header .mps-site-search button:is(:hover, :focus-visible) {
  color: var(--mps-company-ink);
}

.mps-header .mps-site-search,
.mps-header .mps-site-search input {
  background: var(--mps-company-paper);
}

.mps-header .mps-site-search {
  /* The input cannot stretch Search beyond Menu's shared button height. */
  height: calc(var(--mps-company-action-height) + 2px);
}

.mps-header .mps-site-search input {
  height: var(--mps-company-action-height);
  padding-block: 0;
  line-height: 1.25;
  border-radius: var(--mps-company-action-radius) 0 0 var(--mps-company-action-radius);
}

.mps-header .mps-company-menu-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--mps-company-action-radius);
  background: var(--mps-header-action-green, #00bc70);
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.mps-header .mps-company-menu-trigger:is(:hover, :focus-visible) {
  background: var(--mps-brand-hover, #00aa65);
}

/* The underline sits outside the green button fill. */
.mps-header .mps-company-menu-trigger::after {
  position: absolute;
  inset-inline: 0;
  bottom: -5px;
  height: 2px;
  background: var(--mps-header-action-green, #00bc70);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease-out;
  pointer-events: none;
}

.mps-header .mps-company-menu-trigger:is(:hover, :focus-visible)::after {
  transform: scaleX(1);
}

.mps-header .mps-company-menu-trigger:focus-visible,
.mps-header .mps-company-link:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
}

.mps-header .mps-company-menu-panel {
  position: absolute;
  top: calc(100% + 1px);
  inset-inline-end: 0;
  z-index: 1;
  width: var(--mps-company-panel-width);
  max-width: min(100%, calc(100vw - 32px));
  max-height: var(--mps-company-panel-available, calc(100dvh - 82px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 24px;
  border: 1px solid #dfe2d8;
  border-radius: 0 0 8px 8px;
  background: var(--mps-company-paper);
  color: var(--mps-company-ink);
  box-shadow: 0 12px 26px #18362a14;
  scrollbar-width: thin;
}

.mps-header .mps-company-menu-panel[hidden] {
  display: none;
}

.mps-header .mps-company-menu-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mps-header .mps-company-menu-item {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.mps-header .mps-company-menu-panel:not([hidden]) .mps-company-menu-item {
  animation: mpsCompanyMenuReveal 300ms cubic-bezier(.2, .7, .25, 1) both;
  animation-delay: calc(var(--mps-company-order, 0) * 45ms);
}

.mps-header .mps-company-menu-panel .mps-company-menu-item:focus-within {
  animation: none;
}

.mps-header .mps-company-link {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 0;
  background: none;
  color: var(--mps-company-ink);
  font-family: inherit;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: -.02em;
  text-decoration: none;
}

.mps-header .mps-company-link--large {
  padding-block: 4px;
  font-size: 40px;
  font-weight: 700;
  line-height: 44px;
}

.mps-header .mps-company-link > span {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mps-header .mps-company-link > span::after {
  position: absolute;
  inset-inline: 0;
  bottom: -3px;
  height: 2px;
  background: var(--mps-header-action-green, #00bc70);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease-out;
  pointer-events: none;
}

.mps-header .mps-company-link:is(:hover, :focus-visible) {
  color: var(--mps-company-ink);
  text-decoration: none;
}

.mps-header .mps-company-link:is(:hover, :focus-visible) > span::after {
  transform: scaleX(1);
}

@keyframes mpsCompanyMenuReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .mps-header .mps-utility-inner {
    gap: 12px;
  }

  .mps-header .mps-utility-inner > .mps-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .mps-header .mps-contact > a {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mps-header .mps-company-menu-panel {
    padding: 20px;
  }

  .mps-header .mps-company-link {
    font-size: 22px;
  }

  .mps-header .mps-company-link--large {
    font-size: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mps-header .mps-company-menu-panel:not([hidden]) .mps-company-menu-item {
    animation: none;
  }

  .mps-header .mps-company-menu-trigger,
  .mps-header .mps-company-menu-trigger::after,
  .mps-header .mps-company-link > span::after {
    transition: none;
  }
}
