/*
 * Global mobile navigation scroll-state hotfix.
 *
 * Keep the existing menu layout unchanged. The collapsed catalogue fits the
 * supported portrait viewports, so it must not remain an iOS/WKWebView scroll
 * container. Scrolling is enabled only while the longer Services catalogue is
 * expanded.
 */
@media screen and (max-width: 1180px) {
  /*
   * The tablet cascade used to lock the tools wrapper to the language
   * control's width (112px) even though the language control and menu button
   * sit beside each other.  Long native language labels therefore painted
   * outside the wrapper between 768px and 1180px.  Let the wrapper size to
   * both controls while keeping the approved controls themselves unchanged.
   */
  :is(html[lang="es"], html[lang="de"], html[lang="fr"], html[lang="ja"])
    body.global-tech-page.global-tech-page.global-tech-page.global-tech-page
    .site-header.site-header
    .header-tools {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: auto !important;
    gap: 10px !important;
  }

  body.global-tech-page .site-header.is-open::before {
    position: fixed;
    top: var(--site-header-height-tablet, 68px);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    content: "";
    touch-action: none;
    overscroll-behavior: none !important;
  }

  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav {
    overscroll-behavior-y: none !important;
    -webkit-overflow-scrolling: auto !important;
  }

  /*
   * The shared touch-device cascade makes every nav link position: static.
   * Keep the CTA as its own positioning context and remove its decorative
   * shine on mobile so the absolutely positioned pseudo-element cannot enlarge
   * the menu's scroll area on iOS/WKWebView.
   */
  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav
    > .nav-cta {
    position: relative !important;
  }

  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav
    > .nav-cta::after {
    display: none !important;
    content: none !important;
  }

  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav-dropdown:not(.is-open)
    > .site-nav-dropdown-menu {
    display: none !important;
  }

  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav:not(:has(.site-nav-dropdown.is-open)) {
    height: auto !important;
    block-size: auto !important;
    min-height: 0 !important;
    min-block-size: 0 !important;
    max-height: none !important;
    max-block-size: none !important;
    overflow-y: hidden !important;
    touch-action: none !important;
  }

  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav:has(.site-nav-dropdown.is-open) {
    min-height: 0 !important;
    min-block-size: 0 !important;
    max-height: calc(100dvh - var(--site-header-height-tablet, 68px) - 20px) !important;
    max-block-size: calc(100dvh - var(--site-header-height-tablet, 68px) - 20px) !important;
    overflow-y: auto !important;
    touch-action: pan-y !important;
  }
}

@media screen and (max-width: 767px) {
  html[lang="ja"] body.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page .site-header.site-header .header-tools {
    gap: 10px !important;
  }

  html[lang="ja"] body.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page .site-header.site-header .language-switcher.language-switcher-custom {
    flex: 0 0 68px !important;
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    padding: 0 7px !important;
  }

  html[lang="ja"] body.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page .site-header.site-header .language-menu-toggle {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
  }

  html[lang="ja"] body.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page.global-tech-page .site-header.site-header .nav-toggle {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
  }

  body.global-tech-page .site-header.is-open::before {
    top: var(--site-header-height-mobile, 68px);
  }

  html.device-mobile.input-coarse:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page:not(.thank-you-page)
    .site-header.is-open
    .site-nav
    > a:not(.nav-cta) {
    position: relative !important;
  }

  html.device-mobile.input-coarse:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page:not(.thank-you-page)
    .site-header.is-open
    .site-nav
    > a:not(.nav-cta)::after {
    display: none !important;
    content: none !important;
  }

  html.device-mobile.input-coarse:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page:not(.thank-you-page)
    .site-header.is-open
    .site-nav
    > .nav-cta {
    position: relative !important;
  }

  html:has(> body.global-tech-page) >
    body.global-tech-page.global-tech-page
    .site-header.is-open
    .site-nav:has(.site-nav-dropdown.is-open) {
    max-height: calc(100dvh - var(--site-header-height-mobile, 68px) - 20px) !important;
    max-block-size: calc(100dvh - var(--site-header-height-mobile, 68px) - 20px) !important;
  }
}
