.main-nav {
  display: flex;
  align-items: center;
}

.main-nav > a[aria-current="page"],
.nav-dropdown > summary[aria-current="page"] {
  color: #123b9c;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  color: #37435b;
  cursor: pointer;
  font-size: .79rem;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  padding-left: 6px;
  color: #123b9c;
  content: "⌄";
}

.service-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  left: 0;
  display: grid;
  width: min(290px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e5e9f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(7, 30, 83, .16);
}

.service-menu a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 6px;
  color: #39455a;
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.4;
  white-space: normal;
}

.service-menu a:hover,
.service-menu a[aria-current="page"] {
  background: #f1f4fb;
  color: #123b9c;
}

@media (max-width: 1100px) {
  .site-header {
    z-index: 1200 !important;
    isolation: isolate;
  }

  .main-nav {
    position: fixed !important;
    z-index: 1201;
    top: var(--site-header-height, 78px) !important;
    right: 12px !important;
    left: auto !important;
    display: flex !important;
    width: min(390px, calc(100vw - 24px)) !important;
    max-height: calc(100vh - var(--site-header-height, 78px) - 16px) !important;
    max-height: calc(100dvh - var(--site-header-height, 78px) - 16px) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 12px !important;
    border: 1px solid #e5e9f1 !important;
    border-radius: 0 0 12px 12px !important;
    background: #fff !important;
    box-shadow: 0 20px 48px rgba(7, 30, 83, .2) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(calc(100% + 18px)) !important;
    transition: transform .34s cubic-bezier(.22, .75, .2, 1), opacity .22s ease, visibility .34s;
  }

  .main-nav.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
  }

  .main-nav > a:not(.button) {
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    font-size: .9rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .main-nav > a:not(.button):hover,
  .main-nav > a[aria-current="page"] {
    background: #f3f6fd;
  }

  .nav-dropdown {
    width: 100%;
    border-bottom: 1px solid #edf0f5;
  }

  .nav-dropdown > summary {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: .9rem;
    white-space: normal;
  }

  .nav-dropdown > summary::after {
    display: inline-block;
    transition: transform .24s ease;
  }

  .nav-dropdown[open] > summary::after {
    transform: rotate(180deg);
  }

  .service-menu {
    position: static;
    width: 100%;
    max-height: min(38vh, 300px);
    max-height: min(38dvh, 300px);
    padding: 5px 6px 8px 12px;
    border: 0;
    border-radius: 7px;
    background: #f5f7fc;
    box-shadow: none;
  }

  .service-menu a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: .86rem;
  }

  .main-nav .nav-cta {
    min-height: 48px;
    margin-top: 10px;
  }

  .menu-toggle {
    position: relative;
    z-index: 1202;
    border-radius: 9px;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
  }

  .menu-toggle[aria-expanded="true"] {
    background: #f3f6fd;
    box-shadow: 0 4px 12px rgba(7, 30, 83, .08);
  }

  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }

  body.nav-open::before {
    position: fixed;
    z-index: 999;
    inset: 0;
    background: rgba(7, 20, 48, .4);
    content: "";
    animation: nav-backdrop-in .22s ease both;
  }

  @keyframes nav-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (max-width: 480px) {
  .main-nav {
    right: 8px !important;
    width: min(390px, calc(100vw - 16px)) !important;
    max-height: calc(100vh - var(--site-header-height, 72px) - 10px) !important;
    max-height: calc(100dvh - var(--site-header-height, 72px) - 10px) !important;
    padding: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav {
    transition-duration: .01ms;
  }
}
