/* 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)
    );
    --partnernet-sticky-main-top-margin: calc(
      var(--partnernet-sticky-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;
    transition: top 0.4s;
  }

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

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

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

  /* 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;
    transition: top 0.4s;
  }

  /* 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);
  }

  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: calc(100vh - var(--partnernet-logo-area-height));
    max-height: calc(100dvh - var(--partnernet-logo-area-height));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--lor-color);
  }

  div#partnernet.sticky-reduced div#menu_hor > ul#nav {
    max-height: calc(100vh - var(--partnernet-sticky-logo-area-height));
    max-height: calc(100dvh - var(--partnernet-sticky-logo-area-height));
  }

  div#partnernet div#menu_hor.opened {
    z-index: 255;
  }

  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;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  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 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);
  }

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

  /* Keep ancestor lists only as a path to the current level. */
  div#menu_hor.mobile-menu-drilldown.opened ul.mobile-menu-ancestor > li:not(.mobile-menu-path):not(.partnernet_menu),
  div#menu_hor.mobile-menu-drilldown.opened li.mobile-menu-path > a,
  div#menu_hor.mobile-menu-drilldown.opened li.mobile-menu-path > button.menu_hor_angle {
    display: none !important;
  }

  div#menu_hor.mobile-menu-drilldown.opened li.mobile-menu-path {
    border: 0;
  }

  div#menu_hor.mobile-menu-drilldown.opened li.mobile-menu-path > ul.menu_submenu {
    display: block;
  }

  div#menu_hor.mobile-menu-drilldown.opened li.mobile-menu-back-row {
    display: flex;
    position: sticky;
    top: 56px;
    z-index: 1;
    align-items: stretch;
    border-bottom: 1px solid var(--lor-color-lighter);
  }

  div#menu_hor button.mobile-menu-back {
    flex: 0 0 80px;
    min-height: 56px;
    padding: 12px 8px;
    border: 0;
    border-right: 1px solid var(--lor-color-lighter);
    background: transparent;
    color: white;
    font: inherit;
    cursor: pointer;
  }

  div#menu_hor button.mobile-menu-back::before {
    content: '\2039';
    margin-right: 8px;
  }

  div#menu_hor .mobile-menu-heading,
  div#menu_hor a.mobile-menu-heading:link,
  div#menu_hor a.mobile-menu-heading:visited {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 14px 16px;
    font-weight: bold;
    overflow-wrap: anywhere;
  }

  div#menu_hor ul.mobile-menu-current > li:not(.partnernet_menu) {
    animation: partnernet-menu-forward .22s ease both;
  }

  div#menu_hor.mobile-menu-returning ul.mobile-menu-current > li:not(.partnernet_menu) {
    animation-name: partnernet-menu-back;
  }

  @keyframes partnernet-menu-forward {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes partnernet-menu-back {
    from {
      opacity: 0;
      transform: translateX(-100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    div#menu_hor ul.mobile-menu-current > li:not(.partnernet_menu) {
      animation: none;
    }
  }
}

@media (min-width: 801px) {

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