/* Custom styles for the Kienbaum mobile menu. */

html body #et_mobile_nav_menu {
  display: none !important;
}

.kb-mobile-menu-hide-divi #mobile_menu {
  display: none !important;
}

#kb-mobile-menu-nav,
#kb-mobile-menu-nav * {
  box-sizing: border-box;
}

#kb-mobile-menu-nav {
  position: relative;
  z-index: 10001;
  -webkit-tap-highlight-color: transparent;
}

.kb-mobile-menu-brand {
  max-width: 97px;
  padding: 16px 0;
}

.kb-mobile-menu-logo img {
  width: 97px;
  height: 60px;
  max-width: 100%;
  display: block;
}

/* Toggle button in header. */
.kb-mobile-menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 0;
    padding: 10px 16px;
    margin-bottom: 16px;
  min-height: 44px;
  color: var(--kb-black);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.kb-mobile-menu-toggle-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-block;
}

.kb-mobile-menu-toggle-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kb-mobile-menu-icon-open {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.kb-mobile-menu-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.85);
}

/* Overlay. */
.kb-mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: saturate(150%) blur(2px);
  backdrop-filter: saturate(150%) blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s ease, visibility 0s linear 0.42s;
  z-index: 10000;
  pointer-events: none;
  touch-action: none;
}

.kb-mobile-menu-panel {
  position: fixed;
  inset: 0 auto;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  transform: translateX(-100%);
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease, box-shadow 0.32s ease, visibility 0s linear 0.42s;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  will-change: transform;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
  isolation: isolate;
}

/* Header in panel. */
.kb-mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 75px;
  padding: 0 24px;
  border-bottom: 1px solid #eee;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}


/* Scroll area. */
.kb-mobile-menu-scroll {
  overflow: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 16px;
  touch-action: pan-y;
  position: relative;
  z-index: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-mobile-menu-list {
  border-top: 2px solid var(--kb-mattgold-light);
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.kb-mobile-menu-list > li {
  border-bottom: 1px solid var(--kb-mattgold-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  min-height: 48px;
}

.kb-mobile-menu-list a {
  display: block;
  flex: 1;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--kb-black);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}


.kb-mobile-menu-list .menu-item-has-children > a {
  padding-right: 12px;
  position: relative;
}

/* Chevron button. */
.kb-mobile-menu-item-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.kb-mobile-menu-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10002;
  touch-action: manipulation;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
}

.kb-mobile-menu-close svg {
  width: 24px;
  height: 24px;
  opacity: 1;
  transform: rotate(-90deg) scale(0.85);
  transition: transform 0.32s ease, opacity 0.32s ease;
}

/* Submenus as second page. */
.kb-mobile-menu-subpanel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--kb-white);
  overflow: auto;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
  transform: translateX(100%);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  will-change: transform, opacity;
}

.kb-mobile-menu-subpanel.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.kb-mobile-menu-subpanel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  height: 75px;
  padding: 0 24px;
  border-bottom: 2px solid var(--kb-mattgold-light);
}

.kb-mobile-menu-subpanel-header .strong {
  flex: 0 1 auto;
}

.kb-mobile-menu-back {
  background: transparent;
  border: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: #333;
  touch-action: manipulation;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Open state. */
body.kb-mobile-menu-active .kb-mobile-menu-overlay {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

body.kb-mobile-menu-active .kb-mobile-menu-panel {
  transform: translateX(0);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

/* Fade page content behind the menu. */
#page-container,
#et-main-area,
#main-content,
#content,
#primary,
.site,
.site-content,
.site-main {
  transition: opacity 0.42s ease;
}

body.kb-mobile-menu-active #page-container,
body.kb-mobile-menu-active #et-main-area,
body.kb-mobile-menu-active #main-content,
body.kb-mobile-menu-active #content,
body.kb-mobile-menu-active #primary,
body.kb-mobile-menu-active .site,
body.kb-mobile-menu-active .site-content,
body.kb-mobile-menu-active .site-main {
  opacity: 0.2;
}

body.kb-mobile-menu-active .kb-mobile-menu-head,
body.kb-mobile-menu-active .kb-mobile-menu-scroll {
  opacity: 1;
  transform: translateY(0);
}

body.kb-mobile-menu-active .kb-mobile-menu-icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(0.85);
}

body.kb-mobile-menu-active .kb-mobile-menu-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

body.kb-mobile-menu-lock {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

body.kb-mobile-menu-hide-header #main-header {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

@media (min-width: 981px) {
  /* Mobile only; desktop free. */
  #kb-mobile-menu-nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .kb-mobile-menu-head,
  .kb-mobile-menu-subpanel-header {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.kb-mobile-menu-subpanel-header + ul.sub-menu {
  padding: 24px 16px;
}

.kb-mobile-menu-subpanel-header + ul.sub-menu li {
  border-bottom: 1px solid var(--kb-mattgold-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.kb-mobile-menu-subpanel .sub-menu a {
  display: block;
  flex: 1;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--kb-black);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.kb-mobile-menu-panel.kb-mobile-menu-subpanel-open .kb-mobile-menu-list {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6%);
  transition-delay: 0s;
  transition-duration: 0.42s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-mobile-menu-panel:not(.kb-mobile-menu-subpanel-open) .kb-mobile-menu-list {
  transition-delay: 0s;
  transition-duration: 0.42s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-mobile-menu-panel.kb-mobile-menu-subpanel-open .kb-mobile-menu-close {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.kb-mobile-menu-panel.kb-mobile-menu-subpanel-open .kb-mobile-menu-close svg {
  transform: rotate(-90deg) scale(0.85);
}

.kb-mobile-menu-panel:not(.kb-mobile-menu-subpanel-open) .kb-mobile-menu-close svg {
  transform: rotate(0deg) scale(1);
}

.kb-mobile-menu-toggle:active,
.kb-mobile-menu-item-toggle:active,
.kb-mobile-menu-close:active,
.kb-mobile-menu-back:active {
  transform: scale(0.98);
}

.kb-mobile-menu-list a.strong,
.kb-mobile-menu-subpanel .sub-menu a.strong {
  font-weight: 700;
}

.kb-mobile-menu-toggle:focus-visible,
.kb-mobile-menu-item-toggle:focus-visible,
.kb-mobile-menu-close:focus-visible,
.kb-mobile-menu-back:focus-visible,
.kb-mobile-menu-list a:focus-visible,
.kb-mobile-menu-subpanel .sub-menu a:focus-visible {
  outline: 2px solid var(--kb-mattgold-light);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (hover: hover) {
  .kb-mobile-menu-list a:hover,
  .kb-mobile-menu-subpanel .sub-menu a:hover,
  .kb-mobile-menu-toggle:hover,
  .kb-mobile-menu-item-toggle:hover,
  .kb-mobile-menu-back:hover,
  .kb-mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  #kb-mobile-menu-nav * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
