/* =========================================
   BASIS STRUCTUUR
========================================= */
#mx_menu {
  display: flex;
  min-height: 75px;
  text-align: left;
}

#mx_menu ul,
#mx_menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

#mx_menu a {
  display: block;
  text-decoration: none;
  transition: all 0.3s ease;
}

#mx_menu .mx_parent {
  position: relative;
  }

#mx_menu .mx_submenu_toggle {
cursor: pointer;
}

#mx_menu_toggle {
  display: none;
}

#mx_menu_overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mx_menu [hidden] {
    display: none !important;
}

/* =========================================
   DESKTOP Styling
========================================= */
@media (min-width: 1131px) {


#mx_menu .mx_parent:hover > .mx_level_2,
#mx_menu .mx_parent:focus-within > .mx_level_2,
#mx_menu .mx_level_2 .mx_parent:hover > .mx_level_3,
#mx_menu .mx_level_2 .mx_parent:focus-within > .mx_level_3 {
  display: block;
}

#mx_menu .mx_level_1 {
  display: flex;
  margin: 0 0 0 auto;
}

#mx_menu .mx_level_1 > li {
  display: flex;
}

#mx_menu .mx_level_1 > li > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 10px 15px;
  color: var(--light-color);
}

#mx_menu .mx_level_1 > li.mx_last {
align-self: center;
margin-left: 10px;
}

#mx_menu .mx_level_1 > li.mx_last > a {
padding: 10px 20px;
line-height: 20px!important;
color: #FFFFFF;
background-color: var(--primary-color);
font-size: calc(var(--body-font-size) - 2px);
border-radius: var(--border-radius);
transition: .18s;
}


#mx_menu .mx_level_1 > li > .mx_submenu_toggle {
position: absolute;
 width: 24px;
    height: 35px;
    top: 20px;
    right: 0;
}

#mx_menu .mx_submenu_toggle:before{
content: "";
display: block;
width: 100%;
height: 100%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M169.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 306.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z'/%3E%3C/svg%3E") no-repeat left center;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M169.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 306.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z'/%3E%3C/svg%3E") no-repeat left center;
mask-size: 15px 15px;      
-webkit-mask-size: 15px 15px;
background-color: var(--light-color);
transition: all 0.3s ease;
    mask-position: center center;
    -webkit-mask-position: center center;
}

#mx_menu .mx_level_1 > li.mx_last > a:hover {
background-color: var(--primary-dark-color);
}

#mx_menu .mx_level_1 > li.mx_parent > a {  
  padding-right: 0;
  margin-right: 24px;
}

#mx_menu .mx_level_1 > li:hover > a,
#mx_menu .mx_level_1 > li:focus > a, 
#mx_menu .mx_level_1 > li.active > a{
  color: #FFFFFF;
  outline: none;
}

#mx_menu > .mx_level_1 > li:hover > .mx_submenu_toggle:before,
#mx_menu > .mx_level_1 > li.active > .mx_submenu_toggle:before{
background-color: #FFFFFF;
}
/* =========================================
   LEVEL 2  (DESKTOP SUBMENU)
========================================= */
#mx_menu .mx_level_2 {
  display: none;
  position: absolute;
  background: var(--bg-color);
  top: 100%;
  left: 0;
  min-width: 200px;
  /* submenu net zo breed als items
  white-space: nowrap;
  width: auto;*/
  z-index: 1000;
  padding: 8px 0;
  margin-top: 10px;
  border-radius: var(--border-radius);
}

/* Onzichtbare hover-zone tussen 1e en2 e niveau */
#mx_menu .mx_level_2::before {
  content: "";
  position: absolute;
  height: 15px;/* zelfde als margin-top */
  top: -15px;/* afstand overbruggen */
  left: 0; 
  width: 100%; 
  background: transparent;
}

#mx_menu .mx_level_2 a {
  padding: 8px 20px;
  color: var(--body-color);
}

#mx_menu .mx_level_2 li.mx_parent a {
padding-right: 35px;
}

#mx_menu .mx_level_2 > li:hover > a,
#mx_menu .mx_level_2 > li.active > a {
color: var(--dark-color);
}

#mx_menu .mx_level_2 .mx_submenu_toggle {
position: absolute;
right: 0;
top: 0;
height: 100%;
}

#mx_menu .mx_level_2 .mx_submenu_toggle:before {
transform: rotate(-90deg);
mask-position: center center;
}


#mx_menu .mx_level_2 li:hover .mx_submenu_toggle:before,
#mx_menu .mx_level_2 li.active .mx_submenu_toggle:before {
background-color: var(--dark-color);
}

/* =========================================
   LEVEL 3 (DESKTOP SUBMENU)
========================================= */

#mx_menu .mx_level_3 {
  display: none;
  position: absolute;
  top: -10px;
  left: 100%;
  margin-left: 10px; /* witruimte tussen parent en submenu */
  background: var(--light-color);
  min-width: 200px;
  z-index: 1000;
  padding: 8px 0;
  border-radius: var(--border-radius);
}

/* Onzichtbare hover-zone tussen 2e en 3e niveau */
#mx_menu .mx_level_3::before {
  content: "";
  position: absolute;
  top: 0;
  left: -15px; /* afstand overbruggen */
  width: 15px; /* zelfde als margin-left */
  height: 100%;
  background: transparent;
}

#mx_menu .mx_level_3 a {
  padding: 8px 20px;
  color: #FFFFFF;
}

#mx_menu .mx_level_3 li:hover a {
  color: var(--dark-color);
}

} /* end mediaquery */


/* =========================================
   MOBIELE STYLING
========================================= */
@media (max-width: 1130px) {

#mx_menu {
overflow-x: clip;
}

  #mx_menu_toggle {
    display: block;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 9999;
    position: relative;
    height: 60px;
    width: 60px;
    padding: 0;
    float:  right;
    margin-right: -15px;
  }
  
.mx_menu_bar {
position: absolute;
width: 36px;
height: 5px;
left: 11px;
background: var(--light-color);
transition: 0.4s ease;
border-radius: var(--border-radius);
}

.mx_menu_bar:nth-child(1) {
top: 18px;
}

.mx_menu_bar:nth-child(2) {
top: 28px;
}

.mx_menu_bar:nth-child(3) {
top: 38px;
}

#mx_menu_toggle[aria-expanded="true"] .mx_menu_bar:nth-child(1) {
transform: translateY(8px) rotate(45deg);
}

#mx_menu_toggle[aria-expanded="true"] .mx_menu_bar:nth-child(2) {
opacity: 0;
}

#mx_menu_toggle[aria-expanded="true"] .mx_menu_bar:nth-child(3) {
transform: translateY(-12px) rotate(-45deg);
}

#mx_menu_close {
  display: block!important;
  padding: 0;
  background-color: transparent;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
width: 60px;
height: 60px;
cursor: pointer;
}

#mx_menu_close:before {
content: "";
width: 60px;
height: 60px;
display: block;
   mask-position:center center;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z'/%3E%3C/svg%3E") no-repeat center center;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z'/%3E%3C/svg%3E") no-repeat center center;
mask-size: 40px 40px;      
-webkit-mask-size: 40px 40px;
    transform: rotate(45deg);
    background-color: var(--dark-color);
   }

  #mx_menu_overlay.active {
    display: block;
    opacity: 1;
  }

  #mx_menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: #fff;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10001;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
  }

  #mx_menu.active {
    transform: translateX(0);
  }

  #mx_menu .mx_level_1 {
    flex-direction: column;
    width: 100%;
  }

  /* Alle li full width */
  #mx_menu .mx_level_1 > li,
  #mx_menu .mx_level_2 > li,
  #mx_menu .mx_level_3 > li {
    width: 100%;
    display: block;
  }

  /* Alle links full width */
  #mx_menu a {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 13px;
    transition: background 0.3s ease;
  }
  
  #mx_menu .mx_level_1 > li.mx_last > a {
padding: 10px 20px;
line-height: 30px!important;
color: #FFFFFF;
background-color: var(--primary-color);
font-size: calc(var(--body-font-size) - 2px);
border-radius: var(--border-radius);
transition: .18s;
text-align: center!important;
margin: 60px 20px 20px 20px ;
width: calc(100% - 40px);
display: block;
}

#mx_menu .mx_level_1 > li.mx_last > a:hover {
background-color: var(--primary-dark-color);
color: #FFFFFF;
}

  /* Submenu containers volledig block met animatie */
  #mx_menu .mx_level_2,
  #mx_menu .mx_level_3 {
    width: 100% ;
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  #mx_menu .mx_level_2.active,
  #mx_menu .mx_level_3.active {
    max-height: 1000px; /* groot genoeg voor alle items */
  }

  #mx_menu .mx_parent > a {
  padding-right: 60px;
  }

  /* Submenu toggle indicator rechts */
  #mx_menu .mx_submenu_toggle {
    right: 0;
    top: 0;
    display: block;
    position: absolute;
    height: 50px;
    width: 50px;
    background-color: var(--bg-color);
  }
   #mx_menu .mx_submenu_toggle:before {
   content: "";
display: block;
width: 100%;
height: 100%;
   mask-position:center center;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z'/%3E%3C/svg%3E") no-repeat center center;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z'/%3E%3C/svg%3E") no-repeat center center;
mask-size: 20px 20px;      
-webkit-mask-size: 20px 20px;
background-color: var(--dimmed-color);
   }
   #mx_menu li.active > .mx_submenu_toggle::before{ 
    transform: rotate(45deg);
   }
   
   #mx_menu > .mx_level_1 > li > a {
   color: var(--dimmed-color);
   }
   
   #mx_menu > .mx_level_1 > li:hover > a,
   #mx_menu > .mx_level_1 > li.active > a{
   color: var(--dark-color);
   }
   
   #mx_menu > .mx_level_1 > li:hover > .mx_submenu_toggle:before,
   #mx_menu > .mx_level_1 > li.active > .mx_submenu_toggle::before{ 
    background-color: var(--dark-color);
   }
   
   #mx_menu .mx_level_2 {
   background-color: var(--bg-color);
   }
   
   #mx_menu .mx_level_2 > li > a {
   color: var(--dark-color);
   }
   
   #mx_menu .mx_level_2.active > li:hover > a,
   #mx_menu .mx_level_2 li.active > a { 
   color: var(--dimmed-color);
   }
   
   #mx_menu .mx_level_2 .mx_submenu_toggle {
    background-color: var(--dark-color);
    }
   #mx_menu .mx_level_2 li:hover .mx_submenu_toggle::before,
   #mx_menu .mx_level_2 li.active .mx_submenu_toggle::before{
    background-color: var(--dimmed-color);   
   }
   
   #mx_menu .mx_level_3{
    background-color: var(--dark-color);
 }
   
   #mx_menu .mx_level_3 a {
   color: var(--dimmed-color);
   }
   
   #mx_menu .mx_level_3 li:hover a {
   color:#FFFFFF;
   } 

  /* Parent <a> normale hoogte behouden */
  #mx_menu .mx_level_1 > li > a,
  #mx_menu .mx_level_2 > li > a,
  #mx_menu .mx_level_3 > li > a {
    height: auto;
    min-height: 50px;
    font-weight: bold;
  }
  
} /* end mediaquery */