/* CMS-owned responsive horizontal menu behaviour. */

@media (max-width: 800px) {

  :root {
    --partnernet-logo-area-height: 56px;
    --partnernet-menu-height: 56px;
    --partnernet-secondary-header-height: 56px;
    --partnernet-sticky-logo-area-height: 37px;
    --partnernet-main-top-margin: calc(
      var(--partnernet-logo-area-height) + var(--partnernet-menu-height)
    );
  }

  body.mobile-menu-open {
    overflow: hidden !important;
  }

  div#menu_hor {
    position: fixed !important;
    top: 0 !important;
    right: 0;
    bottom: auto !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: var(--partnernet-menu-height) !important;
    max-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box;
  }

  div#partnernet div#menu_hor {
    height: var(--partnernet-menu-height) !important;
    min-height: var(--partnernet-menu-height) !important;
  }

  /* Match the responsive layout to the compact logo area instead of the desktop 113px banner. */
  div#partnernet div#logobanner {
    top: 0 !important;
    height: var(--partnernet-logo-area-height) !important;
  }

  div#partnernet div#logobackground {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    top: 0 !important;
    height: var(--partnernet-logo-area-height);
    padding: 0 12px;
    overflow: hidden;
    box-sizing: border-box;
  }

  div#partnernet div#logobackground a {
    float: none;
    margin-right: 0;
  }

  div#partnernet div#logobackground .headerLogo {
    font-size: 3em;
  }

  /* Keep the compact menu below the visible PartnerNET logo area. */
  div#partnernet div#menu_hor {
    top: var(--partnernet-logo-area-height) !important;
    z-index: 253;
  }

  /* Keep the compact menu below the reduced sticky logo area. */
  div#partnernet.sticky-reduced div#menu_hor {
    top: var(--partnernet-sticky-logo-area-height) !important;
  }

  div#partnernet.sticky-reduced div#logobanner {
    top: calc(-1 * var(--partnernet-logo-area-height)) !important;
  }

  /* Keep a smaller LORENTZ mark visible above the compact mobile menu. */
  div#partnernet.sticky-reduced div#logobackground {
    opacity: 1 !important;
    z-index: 254;
    height: var(--partnernet-sticky-logo-area-height);
    background-color: var(--lor-color);
  }

  div#partnernet.sticky-reduced div#logobackground .headerLogo {
    font-size: 2.5em;
  }

  /* Keep the mobile menu below page navigation headers when they are present. */
  div#partnernet:has(div.nav_header) div#menu_hor {
    top: var(--partnernet-logo-area-height) !important;
  }

  div#partnernet.sticky-reduced:has(div.nav_header) div#menu_hor {
    top: var(--partnernet-sticky-logo-area-height) !important;
  }

  div#menu_hor > ul#nav {
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--lor-color);
  }

  div#menu_hor:not(.opened) > ul#nav > li.mh_class:not(.partnernet_menu),
  div#menu_hor ul li.partnernet_return_to_your_own_account:not(.account_switched) {
    display: none !important;
  }

  div#menu_hor.opened > ul#nav > li.mh_class {
    display: block;
  }

  div#menu_hor > ul#nav > li.mh_class,
  div.sticky-reduced div#menu_hor > ul#nav > li.mh_class {
    float: none;
    width: 100%;
    min-height: 56px;
    height: auto;
    margin: 0;
    border-bottom: 1px solid var(--lor-color-lighter);
    box-sizing: border-box;
    line-height: 1.4;
  }

  div#menu_hor > ul#nav > li.mh_class.partnernet_menu {
    display: block;
    min-height: 56px;
    height: 56px;
  }

  div#menu_hor button.partnernet_menu_toggle {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
    height: 56px;
    padding: 14px 16px;
    color: white;
    text-align: left;
  }

  div#menu_hor button.partnernet_menu_toggle i {
    margin-right: 10px;
  }

  div#menu_hor ul li a:link,
  div#menu_hor ul li a:visited {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 56px;
    padding: 14px 60px 14px 16px;
    margin: 0;
    line-height: 1.4;
  }

  div#menu_hor ul li ul {
    width: 100%;
    box-sizing: border-box;
  }

  div#menu_hor ul li ul li,
  div.sticky-reduced div#menu_hor ul li ul li {
    display: block;
    float: none;
    clear: both;
    width: 100%;
    height: auto;
    margin: 0;
    box-sizing: border-box;
  }

  div#menu_hor ul li ul {
    display: none;
    position: static;
    top: auto;
    left: auto;
    margin: 0;
    padding: 0;
  }

  div#menu_hor ul li.submenu-open > ul.menu_submenu {
    display: block;
  }

  div#menu_hor ul li ul li a:link,
  div#menu_hor ul li ul li a:visited {
    min-height: 50px;
    padding-left: 32px;
  }

  div#menu_hor button.menu_hor_angle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    color: white;
  }

  div#menu_hor button.menu_hor_angle i {
    display: block;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    font-size: 0;
    line-height: 0;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  /* Draw the control locally while the deferred icon font is unavailable. */
  div#menu_hor button.menu_hor_angle i::before {
    content: none;
  }

  div#menu_hor li.submenu-open > button.menu_hor_angle i {
    transform: rotate(180deg);
  }
}

@media (min-width: 801px) {

  div#menu_hor button.partnernet_menu_toggle,
  div#menu_hor button.menu_hor_angle {
    display: none;
  }
}