/* Shared navigation: clear type, fewer links and distinct account actions. */
.header {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 92px;
  padding: 0 clamp(22px, 3.2vw, 52px);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 28px;
  background: #ffffff;
  border-bottom: 1px solid #e0e9f2;
  box-shadow: 0 4px 20px rgb(32 53 76 / 4%);
  font-family: Inter, sans-serif;
  box-sizing: border-box;
}
.header *,
.header *::before,
.header *::after {
  box-sizing: border-box;
}
.header .brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header .brand img {
  display: block;
  width: 170px;
  height: auto;
  max-height: 62px;
  object-fit: contain;
}
.header .nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 1.7vw, 28px);
  margin: 0 auto;
}
.header .nav a {
  position: relative;
  display: block;
  padding: 12px 0;
  color: #3e5268;
  text-decoration: none;
  font:
    500 13px/1.4 Inter,
    sans-serif;
  white-space: nowrap;
  transition: color 0.2s;
}
.header .nav a:hover,
.header .nav a.active {
  color: #2468ad;
}
.header .nav > a::after,
.header .nav-services > a::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 0;
  right: 0;
  bottom: 3px;
  border-radius: 2px;
  background: #2468ad;
  transform: scaleX(0);
  transition: transform 0.2s;
}
.header .nav > a.active::after,
.header .nav > a:hover::after,
.header .nav-services > a.active::after {
  transform: scaleX(1);
}
.header .nav-services {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
}
.header .services-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #3e5268;
  font:
    500 13px/1.4 Inter,
    sans-serif;
  cursor: pointer;
}
.header .services-toggle:hover,
.header .services-toggle.active,
.header .services-toggle[aria-expanded="true"] {
  color: #2468ad;
}
.header .services-toggle svg {
  width: 18px;
  height: 18px;
  padding: 2px;
  background: #edf5fd;
  border-radius: 4px;
  color: #2468ad;
}
.services-toggle svg {
  display: block;
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}
.nav-services.is-open .services-toggle svg {
  transform: rotate(180deg);
}
.header .services-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: -18px;
  width: 260px;
  padding: 10px;
  border: 1px solid #d8e5f1;
  border-top: 3px solid #2468ad;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgb(32 53 76 / 14%);
}
.header .nav-services.is-open .services-submenu {
  display: grid;
}
.header .services-submenu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 5px;
  font-size: 12px;
}
.header .services-submenu a:hover {
  background: #edf5fd;
}
.header .services-submenu a:first-child {
  border-bottom: 1px solid #dce7f2;
  border-radius: 0;
  margin-bottom: 4px;
  color: #2468ad;
  font-weight: 600;
}
.header .header-login {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  padding: 10px 0 10px 22px;
  border: 0;
  border-left: 1px solid #d9e4ee;
  border-radius: 0;
  background: transparent;
  color: #2468ad;
  font:
    600 12px/1.4 Inter,
    sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.header-login svg {
  display: block;
  width: 19px;
  height: 19px;
}
.header .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  padding: 14px 18px;
  border: 1px solid #2468ad;
  border-radius: 6px;
  background: #2468ad;
  color: #ffffff;
  font:
    600 12px/1.4 Inter,
    sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}
.header .nav-cta:hover {
  background: #1b528b;
}
.header .menu {
  display: none;
  border: 0;
  background: transparent;
  color: #2468ad;
  font-size: 25px;
  cursor: pointer;
}
.header a:focus-visible,
.header button:focus-visible {
  outline: 3px solid #8db9e2;
  outline-offset: 4px;
}
@media (max-width: 1150px) {
  .header {
    height: 76px;
    padding: 0 24px;
    gap: 20px;
  }
  .header .brand img {
    width: 150px;
    max-height: 56px;
  }
  .header .nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    max-height: calc(100svh - 76px);
    overflow-y: auto;
    margin: 0;
    padding: 14px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #ffffff;
    border-bottom: 1px solid #d7e3ef;
    box-shadow: 0 14px 24px rgb(32 53 76 / 10%);
  }
  .header .nav.open {
    display: flex;
  }
  .header .nav a {
    padding: 14px 8px;
  }
  .header .nav > a::after,
  .header .nav-services > a::after {
    display: none;
  }
  .header .nav-services {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .header .services-toggle {
    justify-content: space-between;
    width: 100%;
    padding: 14px 8px;
  }
  .header .services-submenu {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    border: 0;
    background: #f4f8fc;
    border-radius: 6px;
    box-shadow: none;
    padding: 6px;
  }
  .header .header-login {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }
  .header .nav-cta {
    display: none;
  }
  .header .menu {
    display: block;
  }
}
@media (max-width: 450px) {
  .header {
    padding: 0 18px;
    gap: 16px;
  }
  .header .brand img {
    width: 138px;
  }
  .header .header-login {
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .header .nav a,
  .services-toggle svg,
  .header .nav > a::after {
    transition: none;
  }
}

/* Responsive navigation opens as a side drawer. */
.header-menu-backdrop {
  display: none;
}
@media (max-width: 1150px) {
  .header .nav,
  .header .nav.open {
    position: fixed;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: min(360px, 88vw);
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 86px 24px 28px;
    gap: 0;
    overflow-y: auto;
    background: #fff;
    border: 0;
    box-shadow: -16px 0 45px #20354c26;
    transform: translateX(110%);
    visibility: hidden;
    transition:
      transform 0.28s ease,
      visibility 0.28s;
    z-index: 1003;
  }
  .header .nav.open {
    transform: translateX(0);
    visibility: visible;
  }
  .header .nav > a {
    padding: 16px 8px;
    border-bottom: 1px solid #e3ebf2;
    font-size: 14px;
  }
  .header .nav-services {
    display: block;
    position: relative;
    border-bottom: 1px solid #e3ebf2;
  }
  .header .services-toggle {
    font-size: 14px;
    padding: 16px 8px;
    width: 100%;
    justify-content: space-between;
  }
  .header .services-submenu {
    position: static;
    width: 100%;
    max-height: none;
    padding: 6px;
    background: #f2f6fa;
    border: 0;
    box-shadow: none;
    border-radius: 6px;
  }
  .header .services-submenu a {
    font-size: 12px;
    padding: 13px 12px;
  }
  .header .menu {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d5e2ed;
    border-radius: 6px;
    position: relative;
    z-index: 1004;
  }
  .header .menu.open {
    position: fixed;
    right: 22px;
    top: 18px;
    background: #f0f5fa;
    font-size: 28px;
  }
  .header-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    background: #132b44a6;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.28s,
      visibility 0.28s;
    cursor: pointer;
  }
  .header-menu-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }
  body.header-drawer-open {
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .header .nav,
  .header-menu-backdrop {
    transition: none;
  }
}

/* Reserve space for the mobile navigation trigger at every phone width. */
@media (max-width: 1150px) {
  .header {
    flex-wrap: nowrap;
    gap: 12px;
  }
  .header .brand {
    min-width: 0;
    flex-shrink: 1;
  }
  .header .brand img {
    max-width: 100%;
  }
  .header .header-login {
    margin-left: auto;
    flex: 0 0 auto;
  }
  .header #menuToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    opacity: 1;
    flex: 0 0 42px;
    min-width: 42px;
    height: 42px;
    padding: 9px;
    color: #2468ad;
    background: #edf4fa;
    border: 1px solid #bcd0e1;
    border-radius: 6px;
  }
  .header #menuToggle svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
}
@media (max-width: 450px) {
  .header {
    padding-left: 16px;
    padding-right: 16px;
    gap: 10px;
  }
  .header .brand img {
    width: 125px;
  }
  .header .header-login {
    width: 32px;
    justify-content: center;
    padding: 8px 0;
  }
  .header .header-login span {
    display: none;
  }
}

/* Dedicated trigger avoids collisions with page-specific menu styles. */
#site-header .header-drawer-trigger {
  display: none;
}
@media (max-width: 1150px) {
  #site-header .header {
    padding-right: 76px;
  }
  #site-header .header .header-drawer-trigger {
    display: flex !important;
    position: absolute;
    right: 16px;
    top: 17px;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    margin: 0;
    padding: 9px;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none;
    clip: auto;
    clip-path: none;
    overflow: visible;
    background: #edf4fa;
    color: #2468ad;
    border: 1px solid #bcd0e1;
    border-radius: 6px;
    z-index: 1004;
  }
  #site-header .header .header-drawer-trigger.open {
    position: fixed;
    right: 16px;
    top: 17px;
  }
}
