/* Mobile nav fix (2026-11-11). Desktop (min-width: 1241px) is unchanged. */

.nav-mobile-tools,
.nav-mobile-close {
  display: none;
}

@media (max-width: 1240px) {
  header.nav,
  .nav {
    z-index: 200 !important;
  }

  .nav-in {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 0.5rem !important;
    padding-left: 1rem !important;
    padding-right: 0.65rem !important;
  }

  /* Keep the bar to logo + compact Book a Call + hamburger. */
  header.nav .nav-in > div:last-of-type > .lang-switch,
  header.nav .nav-right > .lang-switch,
  header.nav .sn-lang,
  header.nav .nav-in > div:last-of-type > .theme-toggle,
  header.nav .nav-right > .theme-toggle,
  header.nav .nav-in > div:last-of-type > .nav-login,
  header.nav .nav-right > .nav-login,
  header.nav .nav-in > div:last-of-type > .nav-backend,
  header.nav .nav-right > .nav-backend {
    display: none !important;
  }

  header.nav .nav-in > div:last-of-type,
  header.nav .nav-right {
    display: flex !important;
    align-items: center;
    gap: 0.4rem !important;
    min-width: 0;
  }

  header.nav .nav-cta {
    padding: 0.42rem 0.72rem !important;
    font-size: 0.78rem !important;
    letter-spacing: 0 !important;
  }

  header.nav .nav-burger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0 !important;
    flex: none;
    border-radius: 999px;
    position: relative;
    z-index: 201;
  }

  /* Hamburger becomes an X while the drawer is open. */
  header.nav .nav-burger[aria-expanded="true"] svg {
    display: none;
  }
  header.nav .nav-burger[aria-expanded="true"]::before,
  header.nav .nav-burger[aria-expanded="true"]::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.05rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }
  header.nav .nav-burger[aria-expanded="true"]::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }
  header.nav .nav-burger[aria-expanded="true"]::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  /* Full-screen drawer under the sticky header. */
  .nav-mobile.open,
  nav.nav-mobile.open,
  header.nav .nav-mobile.open {
    display: block !important;
    position: fixed !important;
    top: var(--mn-header-h, 4.5rem) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100dvh - var(--mn-header-h, 4.5rem)) !important;
    max-height: calc(100dvh - var(--mn-header-h, 4.5rem)) !important;
    z-index: 199 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1.15rem 3rem !important;
    background: #0b0b0d !important;
    border-bottom: 0 !important;
    box-sizing: border-box;
  }
  html[data-theme="light"] .nav-mobile.open,
  html[data-theme="light"] nav.nav-mobile.open,
  html[data-theme="light"] header.nav .nav-mobile.open {
    background: #fff !important;
  }

  html.nav-is-open,
  html.nav-is-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  /* Jules sits at z-index 60 and was painting over the open menu. */
  html.nav-is-open .jules-dock,
  html.nav-is-open #jules-dock {
    display: none !important;
    pointer-events: none !important;
  }

  .nav-mobile ul,
  .nav-mobile.open ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .nav-mobile li {
    list-style: none !important;
    margin: 0;
    padding: 0;
  }

  .nav-mobile > ul > li > a,
  .nav-mobile ul > li > a {
    display: block;
    font-size: 1.02rem !important;
    font-weight: 550 !important;
    line-height: 1.3 !important;
    padding: 0.72rem 0 !important;
    color: var(--bone, #f5f2ec) !important;
    border-bottom: 1px solid rgba(245, 242, 236, 0.1);
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
  }
  html[data-theme="light"] .nav-mobile > ul > li > a,
  html[data-theme="light"] .nav-mobile ul > li > a {
    color: #1a1a1a !important;
    border-bottom-color: rgba(26, 26, 26, 0.1);
  }
  .nav-mobile a.active,
  .nav-mobile a.cur {
    color: var(--bone, #f5f2ec) !important;
    font-weight: 650 !important;
  }
  html[data-theme="light"] .nav-mobile a.active,
  html[data-theme="light"] .nav-mobile a.cur {
    color: #0a0a0c !important;
  }

  /* Collapsible groups (Services, Resources, and the rest). */
  .nav-mobile .nav-mgrp {
    border-bottom: 1px solid rgba(245, 242, 236, 0.1);
  }
  html[data-theme="light"] .nav-mobile .nav-mgrp {
    border-bottom-color: rgba(26, 26, 26, 0.1);
  }
  .nav-mobile .nav-mgrp > details > summary {
    list-style: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: .75rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding: 0.7rem 0 !important;
    color: var(--tx-fc5000,#fc5000) !important;
    opacity: 1 !important;
  }
  .nav-mobile .nav-mgrp > details > summary::-webkit-details-marker,
  .nav-mobile .nav-mgrp > details > summary::marker {
    display: none;
    content: "";
  }
  .nav-mobile .nav-mgrp details summary::after {
    content: "+" !important;
    opacity: 0.8;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0;
    text-transform: none;
  }
  .nav-mobile .nav-mgrp details[open] summary::after {
    content: "\2212" !important;
  }
  .nav-mobile .nav-mgrp details a,
  .nav-mobile .nav-mgrp > details > a {
    display: block !important;
    padding: 0.45rem 0 0.45rem 0.9rem !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    color: #ff7a33 !important;
    border-bottom: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    opacity: 1 !important;
  }
  html[data-theme="light"] .nav-mobile .nav-mgrp details a,
  html[data-theme="light"] .nav-mobile .nav-mgrp > details > a {
    color: #b83a00 !important;
  }

  /* One language control, inside the drawer. */
  .nav-mobile .lang-mobile,
  .nav-mobile .sn-mlang,
  .nav-mobile li.lang-mobile {
    display: block !important;
    padding: 0.15rem 0 0.85rem !important;
    border-bottom: 1px solid rgba(245, 242, 236, 0.1);
    margin: 0 0 0.35rem !important;
  }
  html[data-theme="light"] .nav-mobile .lang-mobile,
  html[data-theme="light"] .nav-mobile .sn-mlang {
    border-bottom-color: rgba(26, 26, 26, 0.1);
  }
  .nav-mobile .sn-mlang {
    display: flex !important;
    gap: 1rem;
    align-items: center;
  }
  .nav-mobile .sn-mlang a {
    border-bottom: 0 !important;
    padding: 0.35rem 0 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.06em;
    font-weight: 650 !important;
  }

  .nav-mobile-tools {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0 0.9rem;
    margin: 0 0 0.25rem;
    border-bottom: 1px solid rgba(245, 242, 236, 0.1);
  }
  html[data-theme="light"] .nav-mobile-tools {
    border-bottom-color: rgba(26, 26, 26, 0.1);
  }
  .nav-mobile-tools .theme-toggle,
  .nav-mobile .nav-mobile-tools .theme-toggle {
    display: inline-flex !important;
    width: 2.4rem;
    height: 2.4rem;
    align-items: center;
    justify-content: center;
    flex: none;
  }
  .nav-mobile-close {
    display: none !important;
  }

  .nav-mobile-tools .nav-login,
  .nav-mobile .nav-mobile-tools a.nav-login {
    display: inline-flex !important;
    margin: 0 0 0 auto !important;
    padding: 0.42rem 0.8rem !important;
    font-size: 0.82rem !important;
    border: 1px solid rgba(245, 242, 236, 0.22);
    border-radius: 0.5rem;
    color: var(--bone, #f5f2ec) !important;
    width: auto;
    flex: none;
    text-decoration: none !important;
  }
  html[data-theme="light"] .nav-mobile-tools .nav-login,
  html[data-theme="light"] .nav-mobile .nav-mobile-tools a.nav-login {
    color: #1a1a1a !important;
    border-color: rgba(26, 26, 26, 0.18);
  }

  .nav-mobile .nav-login,
  .nav-mobile .nav-cta {
    display: inline-flex !important;
    width: fit-content;
    margin-top: 0.65rem !important;
    border-bottom: 0 !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.88rem !important;
  }
  .nav-mobile .nav-cta {
    background: var(--brand-btn,#c2410c) !important;
    color: #fff !important;
    border-radius: 0.6rem;
  }
  html[data-theme="light"] .nav-mobile .nav-login {
    color: #1a1a1a !important;
  }

  .nav-mobile-tools .lang-mobile,
  .nav-mobile-tools .sn-mlang,
  .nav-mobile-tools li {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  html[data-theme="light"] header.nav .nav-burger,
  html[data-theme="light"] .nav-mobile-close,
  html[data-theme="light"] .nav-mobile-tools .theme-toggle {
    color: #1a1a1a !important;
  }
}


@media (max-width: 1240px) and (max-width: 360px) {
  header.nav .nav-cta {
    padding: 0.38rem 0.55rem !important;
    font-size: .75rem !important;
  }
}
