/* Site navigation: desktop mega menus + full-screen mobile menu (src/lib/nav.ts). */

:root {
  --mos-blue: #003399;
  --mos-navy: #001641;
  --mos-orange: #ee4c01;
  --mos-line: #e3e8f2;
  --mos-header-bottom: 125px;
}

/* ---------- Desktop mega menus (>=1024px) ---------- */
#nav-menu-v2-oBEG4MNxcB .mos-mega {
  display: none;
}

@media (min-width: 1024px) {
  /* Panels are owned by site-interactions.js, not the captured :hover rules. */
  #nav-menu-v2-oBEG4MNxcB .menu-item:hover > .mos-mega,
  #nav-menu-v2-oBEG4MNxcB .mos-mega:hover {
    visibility: hidden;
    opacity: 0;
  }

  #nav-menu-v2-oBEG4MNxcB .mos-mega {
    display: block;
    position: fixed;
    top: var(--mos-header-bottom);
    left: 50%;
    right: auto;
    width: min(1170px, calc(100vw - 48px));
    transform: translate(-50%, 8px);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: #fff;
    border: 1px solid var(--mos-line);
    border-top: 3px solid var(--mos-orange);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 28px 60px rgba(0, 22, 65, 0.28), 0 2px 6px rgba(0, 22, 65, 0.08);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    font-family: 'Lato', sans-serif;
    text-align: left;
  }

  #nav-menu-v2-oBEG4MNxcB .mos-mega.is-open,
  #nav-menu-v2-oBEG4MNxcB .menu-item:hover > .mos-mega.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
  }

  /* Invisible bridge so the pointer can move from the menu item to the panel. */
  #nav-menu-v2-oBEG4MNxcB .mos-mega::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -28px;
    height: 28px;
  }

  .mos-mega__inner {
    display: grid;
    gap: 32px;
    padding: 32px 36px 24px;
  }

  .mos-mega__inner--services { grid-template-columns: 1fr 1fr 1fr 1.15fr; }
  .mos-mega__inner--areas { grid-template-columns: 3fr 1.15fr; }

  .mos-mega__heading {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--mos-line);
    color: #c43f00;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .mos-mega__list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* Alphabetical down each column, the way people scan a town list. */
  .mos-mega__list--grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(5, auto);
    column-gap: 24px;
  }

  /* Open trigger reads as active (blue), not the captured grey hover. */
  #nav-menu-v2-oBEG4MNxcB .menu-item.mos-mega-open > a.menu-item-title,
  #nav-menu-v2-oBEG4MNxcB .menu-item.mos-mega-open > button {
    color: var(--mos-blue) !important;
  }

  .mos-mega__list a {
    display: block;
    padding: 7px 0;
    color: var(--mos-navy);
    font-size: 16px;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, transform 0.15s ease;
  }

  .mos-mega__list a:hover,
  .mos-mega__list a:focus-visible {
    color: var(--mos-blue);
    transform: translateX(3px);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .mos-mega__card {
    align-self: start;
    padding: 22px 22px 20px;
    border-radius: 8px;
    background: #f3f6fb;
  }

  .mos-mega__card-title {
    margin: 0 0 6px;
    text-wrap: balance;
    color: var(--mos-navy);
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 700;
  }

  .mos-mega__card-copy {
    margin: 0 0 16px;
    text-wrap: pretty;
    color: #3a4357;
    font-size: 14.5px;
    line-height: 1.5;
  }

  .mos-mega__card-btn {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 8px;
    background: var(--mos-blue);
    color: #fff !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  .mos-mega__card-btn:hover,
  .mos-mega__card-btn:focus-visible { background: var(--mos-navy); }

  .mos-mega__card-link {
    display: block;
    margin-top: 12px;
    color: var(--mos-blue);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
  }

  .mos-mega__foot {
    padding: 14px 36px;
    border-top: 1px solid var(--mos-line);
    background: #fafbfd;
    border-radius: 0 0 10px 10px;
  }

  .mos-mega__foot a {
    color: var(--mos-blue);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }

  .mos-mega__foot a:hover,
  .mos-mega__foot a:focus-visible,
  .mos-mega__card-link:hover { text-decoration: underline; }

  .mos-mega a:focus-visible {
    outline: 2px solid var(--mos-blue);
    outline-offset: 2px;
  }
}

/* ---------- Header below 1024px: hamburger, no cramped desktop row ---------- */
@media (max-width: 1023.98px) {
  #nav-menu-v2-oBEG4MNxcB .nav-menu-desktop { display: none !important; }
  #nav-menu-v2-oBEG4MNxcB .cart-search-mobile { display: flex !important; }

  #nav-menu-v2-oBEG4MNxcB .nav-menu-mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 0 !important;
  }

  /* Bigger, clearer hamburger icon than the captured 15px glyph. */
  #nav-menu-v2-oBEG4MNxcB .nav-menu-mobile span::before {
    content: "\f0c9";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 26px;
    color: var(--mos-orange);
  }
}

/* Tablet: keep the captured desktop Get Started column tidy beside the hamburger. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  #button-_BqoFpCGBg .cbutton-_BqoFpCGBg { white-space: nowrap; }
  #col-SCNCqGjIOQ { flex: 0 0 auto !important; width: auto !important; padding-right: 0 !important; }
  #col-T7FPQ9GZrr { flex: 1 1 auto !important; min-width: 0; }
  #row-GQAcT72eQz { padding-right: 20px !important; padding-left: 12px !important; }
}

/* ---------- Full-screen mobile menu ---------- */
.mos-mm {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  font-family: 'Lato', sans-serif;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.mos-mm.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}

@media (min-width: 1024px) {
  .mos-mm { display: none; }
}

html.mos-mm-lock,
html.mos-mm-lock body { overflow: hidden; }

.mos-mm__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 14px 18px;
  border-bottom: 1px solid var(--mos-line);
}

.mos-mm__logo img {
  display: block;
  width: auto;
  height: 52px;
}

.mos-mm__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #f3f6fb;
  color: var(--mos-navy);
  cursor: pointer;
}

.mos-mm__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 22px 32px;
  /* Fade the last rows into the pinned buttons so cut-off text reads as "scroll". */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}

.mos-mm__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mos-mm__list > li { border-bottom: 1px solid var(--mos-line); }

.mos-mm__list > li > a,
.mos-mm__row > a {
  display: block;
  flex: 1 1 auto;
  padding: 16px 0;
  color: var(--mos-navy);
  font-family: 'Montserrat', sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.mos-mm__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mos-mm__toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mos-orange);
  cursor: pointer;
}

.mos-mm__chev::before {
  content: "\f078";
  display: inline-block;
  font-family: "Font Awesome 5 Free";
  font-size: 17px;
  font-weight: 900;
  transition: transform 0.2s ease;
}

.mos-mm__toggle[aria-expanded="true"] { background: #f3f6fb; }
.mos-mm__toggle[aria-expanded="true"] .mos-mm__chev::before { transform: rotate(180deg); }

.mos-mm__panel {
  margin-left: 2px;
  padding: 0 0 16px 14px;
  border-left: 2px solid #fbd9c8;
}

.mos-mm__heading {
  margin: 10px 0 4px;
  color: #c43f00;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mos-mm__sublist {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}

.mos-mm__sublist--grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(7, auto);
  column-gap: 16px;
}

.mos-mm__sublist a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  color: #2b3348;
  font-size: 17px;
  line-height: 1.3;
  text-decoration: none;
}

.mos-mm__all {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 0;
  color: var(--mos-blue);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.mos-mm__cta {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
  padding: 16px 22px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--mos-line);
  background: #fff;
}

.mos-mm__btn,
.mos-mm__call {
  display: block;
  padding: 15px 18px;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.mos-mm__btn { background: var(--mos-blue); color: #fff; }
.mos-mm__call { border: 2px solid var(--mos-blue); color: var(--mos-blue); }

.mos-mm a:focus-visible,
.mos-mm button:focus-visible {
  outline: 2px solid var(--mos-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .mos-mm,
  .mos-mm.is-open,
  #nav-menu-v2-oBEG4MNxcB .mos-mega { transition: none; }
}
