.wpb-navigation { --nav-bg-clr: var(--clr-dark); position: relative; z-index: 1040; position: absolute; top: 0; right: 0; left: 0; border-top: .4rem solid var(--clr-primary);
  background: linear-gradient(180deg, var(--clr-dark) 0%, transparent 100%);


  .container { display: flex; align-items: center; justify-content: space-between; column-gap: 1rem; }

  .wpb-navigation__main { padding-block: 2rem; }

  .logo { display: inline-flex; margin-right: auto; position: relative; z-index: 2;
    img { width: 16rem; height: auto; }
  }
}

.btn--nav-toggle { position: relative; z-index: 2;
  svg { fill: var(--clr); 
    rect { transition: y var(--ts-25) ease var(--ts-25), transform var(--ts-25) ease, opacity var(--ts-25); transform-origin: center; }
  }
  &:hover svg rect { fill: var(--hover-clr); }
  &:focus svg rect { fill: var(--focus-clr); }
  &:active svg rect { fill: var(--active-clr); }
  
  &[aria-expanded="true"] {
    svg .top { transform: translateY(5px) translateX(-5px) rotate(45deg); }
    svg .middle { opacity: 0; }
    svg .bottom { transform: translateY(-5px) translateX(-5px) rotate(-45deg); }
  }
}

.wpb-navigation__collapse {
   ul { list-style: none; }
   .menu-item {
    .menu-link { font-family: var(--font-secondary); font-size: 1.6rem; text-transform: uppercase; font-weight: 900; color: var(--clr-text); width: 100%; text-decoration: none; display: inline-flex; align-items: center; column-gap: .8rem; line-height: 1; transition: color var(--ts-duration) var(--ts-function); 
      &:hover { color: var(--clr-primary); }
    }

    &.menu-item--current > .menu-link { 
      > [data-toggle] i,
      .mneu-link__text i { color: var(--clr-primary); }
    }
    &.menu-item-has-children { position: relative; }  
  }
}

/*** Navigation mobile ***/
@media (max-width: 991.98px) {
  .wpb-navigation { --nav-height: 9.8rem; }
    .wpb-navigation__collapse { border-top: .4rem solid var(--clr-primary); opacity: 0; pointer-events: none; width: 100%; display: none; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; padding-top: var(--nav-height); left: auto; background-color: var(--nav-bg-clr); overflow: hidden; transition-property: transform, opacity; transition-duration: var(--ts-25); transition-timing-function: ease;
      &.active { pointer-events: all; opacity: 1; }
    
      .wpb-collapse__header { font-size: 1.6rem; font-weight: bold; padding: 1.8rem; display: flex; justify-content: space-between; align-items: center; }
      .wpb-collapse__body { padding: 1.8rem; flex-grow: 1; overflow-y: auto; overscroll-behavior: contain; }
      .wpb-collapse__footer { padding: 1.8rem; }
      
      .menu-item {
        .menu-link { padding: 1.5rem 0; }
        &.menu-item-has-children > .menu-link > .btn { min-height: 3.8rem; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
      }
    }
    
    .wpb-sub-menu { border-top: .4rem solid var(--clr-primary); display: flex; flex-direction: column; height: 100%; overflow: hidden; list-style: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; padding-top: var(--nav-height); background-color: var(--nav-bg-clr); z-index: 1; overflow-y: auto; transform: translate3d(100%, 0, 0); transition: transform var(--ts-35) ease; 
      &.active { transform: translate3d(0, 0, 0); }
      .wpb-sub-menu__header { font-family: var(--font-secondary); font-size: 1.6rem; font-weight: bold; padding: 1.8rem; display: flex; align-items: center; justify-content: start; gap: 1.6rem;
        .btn { min-height: 3.8rem; }
      }
      .wpb-sub-menu__body { padding: 1.8rem; }
    }
}

@media (min-width: 782px) and (max-width: 991.98px) {
  body:has(#wpadminbar) {
    .wpb-navigation { --nav-height: 13rem; }
  }
}

@media (max-width: 781.98px) {
  body:has(#wpadminbar) {
    .wpb-navigation { --nav-height: 14.4rem; }
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .wpb-navigation__collapse { 
    .wpb-collapse__header, .wpb-collapse__body, .wpb-collapse__footer, .wpb-sub-menu__header, .wpb-sub-menu__body { padding-inline: calc((100vw - 504px) / 2); }
  }
}

@media (min-width: 768px) and (max-width: 991.98px) { 
  .wpb-navigation__collapse { 
    .wpb-collapse__header, .wpb-collapse__body, .wpb-collapse__footer, .wpb-sub-menu__header, .wpb-sub-menu__body { padding-inline: calc((100vw - 684px) / 2); }
  }
}

/*** Navigation desktop ***/
@media (min-width: 992px) {
  .wpb-navigation { --nav-height: 14rem;
    .wpb-navigation__main { padding-top: 3.2rem; }
    .btn.btn--nav-toggle, .wpb-collapse__header, .wpb-sub-menu__header { display: none; }
  }

  .wpb-navigation__collapse { width: 100%; display: flex!important; justify-content: end; align-items: center;
    .menu-item {
      .menu-link { position: relative; padding: 1rem 1.6rem; }
      &.menu-item-has-children {
        > .menu-link { display: flex; justify-content: space-between;
          > .btn { --bg-clr: transparent; --border: none; --clr: var(--clr-text); width: auto; height: auto; min-height: 0; }
        }
        &:hover > .wpb-sub-menu { pointer-events: all; opacity: 1; }
      }
    }

    .wpb-menu { display: flex; align-items: center;
      > .menu-item > .menu-link { padding: 1.9rem 1.4rem; 
        > .btn { transform: rotate(90deg); --border: none; --hover-border: none; --hover-bg-clr: transparent; }
      } /* Hoogste niveau links */

      .wpb-sub-menu { position: absolute; top: 100%; right: auto; bottom: auto; left: 50%; transform: translateX(-50%); box-shadow: 0 .5rem .5rem rgba(21, 47, 51, .1); width: 100%; padding: 0; min-width: 20rem; height: auto!important; background-color: var(--nav-bg-clr); opacity: 0; overflow: visible; pointer-events: none; transition: opacity var(--ts-25) ease; border-radius: .4rem;
        .wpb-sub-menu { top: 0; left: 100%; transform: none; } 
        .wpb-sub-menu__header { display: none; }
        .wpb-sub-menu__body { padding: .8rem;
          .menu-link { border-radius: .2rem; height: 5rem; font-size: 1.6rem; font-family: var(--font-primary); text-transform: none; transition: background var(--ts-duration) var(--ts-function);
            &:hover { background-color: var(--clr-secondary); color: #fff; }
          }
        }
      }
    }
  }
}