.wpb-navigation { --nav-bg-clr: var(--gradient-mega-menu); --menu-clr: var(--clr-text); --menu-hover-clr: var(--clr-primary); position: absolute; top: 0; right: 0; left: 0; margin: var(--block-spacing); z-index: 1040;
  .container { display: flex; align-items: center; justify-content: space-between; }
  h2 { --fs: clamp(2.4rem, 4vw, 3.2rem);  }
  .wpb-navigation__top { background-color: var(--clr-dark); height: 5.2rem;
    * { color: #FFF; }
    .container-fluid { display: flex; align-items: center; justify-content: space-between; column-gap: 1rem; padding-block: 1.6rem;
      .wpb-top-menu { display: flex; align-items: center; gap: 2rem;
        .wpb-top-menu__list { display: flex; align-items: center; gap: 2rem; list-style: none; }
        .wpb-top-menu__link { font-weight: 500; text-decoration: none; font-size: 1.2rem; color: #FFF; transition: 200ms ease;
          &:hover { color: rgba(255, 255, 255, 0.8); }
        }
        .wpb-top-menu__item--featured .wpb-top-menu__link { position: relative;
          &::before { content: ''; position: absolute; top: -0.1rem; right: -1rem; width: .4rem; height: .4rem; background-color: var(--clr-primary); border-radius: 50%; }
        }
      }
    }
  }

  .wpb-sub-menu__cta { background-color: var(--clr-secondary); position: relative; height: 100%; display: grid; place-items: end; border-radius: .8rem; overflow: hidden;
    *:not(.btn, span, i) { color: #FFF; }
    .wpb-sub-menu__text { --mt: 0; }
    .wpb-text { display: grid; z-index: 2; position: relative; padding: 3.2rem;
      .wpb-image { overflow: hidden; background-color: #FFF; border-radius: 50%; width: 7.6rem; height: 7.6rem; display: grid; place-items: center;
        img { object-position: top; }
      }
    }
  }

  .logo { display: inline-flex;
      img { height: 3.6rem; width: auto; }
      .logo__light { display: none; }
  }

  &:has(+ .wpb-main-content .wpb-header--home) { --menu-clr: #FFFF; --menu-hover-clr: rgba(255, 255, 255, 0.6);
    :is(.wpb-collapse__body > .logo, .wpb-navigation__main .container > .logo) .logo__default { display: none; }
    .logo .logo__light { display: block; }
  }

  & + *:is(section) { --spacing-top: 7.8rem; padding-top: calc(var(--spacing-top) + var(--pt, 0px)); }
}


.btn--nav-toggle { --clr: var(--menu-clr) !important; --hover-clr: var(--clr-primary); --focus-clr: var(--clr-primary); --active-clr: var(--clr-primary);
  svg { fill: var(--clr-primary); background-color: #FFF; border-radius: 50%; padding: .4rem;
    rect { transition: y var(--ts-25) ease var(--ts-25), transform var(--ts-25) ease, opacity 0ms 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 rect { fill: var(--active-clr); transition: y var(--ts-25) ease, transform var(--ts-25) ease var(--ts-25), opacity 0ms var(--ts-25); }
    svg .top { y: 45; transform: rotate(45deg); }
    svg .middle { opacity: 0; }
    svg .bottom { y: 45; transform: rotate(-45deg); }
  }
}

@supports (-webkit-touch-callout: none) {
  .btn--nav-toggle {
    svg rect { transition: transform var(--ts-25) ease, opacity var(--ts-25) ease; transform-origin: center; }
    &[aria-expanded="true"] {
      svg rect { transition: translateY(2px) translateX(2px) rotate(45deg); }
      svg .top { transform: translateY(17px) translateX(-10px) rotate(45deg); }
      svg .bottom { transform: translateY(-11px) translateX(-8px) rotate(-45deg); }
    }
  }
}

.wpb-navigation__collapse {
  ul, .wpb-menu, .wpb-top-menu__list { list-style: none; }
  
  .menu-item {
    .menu-link { color: var(--menu-clr); width: 100%; text-decoration: none; display: inline-flex; align-items: center; column-gap: 1rem; line-height: 1; transition: color var(--ts-duration) var(--ts-function); 
      &:hover { color: var(--menu-hover-clr); }
    }
  }

  .wpb-top-menu__item {
    .wpb-top-menu__link { color: var(--clr-text); text-decoration: none; display: inline-flex; align-items: center; line-height: 1; transition: color var(--ts-duration) var(--ts-function);
      &:hover { opacity: .8; }
    }

    &.wpb-top-menu__item--featured {
      .wpb-top-menu__link { color: var(--clr-primary); font-weight: 600; }
    }
  }

  .wpb-collapse__footer {
    .btn:not(.btn--primary){ --clr: var(--menu-clr); --hover-clr: var(--menu-hover-clr); } 
  }

  .wpb-sub-menu {
    .wpb-sub-menu__body { display: grid; gap: 2.4rem; }
    }
}

/*** Navigation mobile ***/
@media (max-width: 1199.98px) {
  body:has(.wpb-navigation__collapse.active) { overflow: hidden; }

  .wpb-navigation { 
    .wpb-navigation__top .wpb-top-menu { display: none !important; }
    .wpb-navigation__top .container-fluid { justify-content: center; }
    .wpb-navigation__main { padding-block: 1.8rem; }
  }

  .wpb-navigation__collapse { --menu-clr: #FFFF; max-width: min(50rem, 100%); transform: translate3d(100%, 0, 0); width: 100%; margin: var(--block-spacing); border-radius: var(--block-radius); display: none; flex-direction: column; position: fixed; top: 5.2rem; right: 0; bottom: 0; left: auto; background: var(--nav-bg-clr); z-index: 1030; overflow: hidden; transition: transform var(--ts-35) ease; 
    &.active { pointer-events: all; transform: translate3d(0%, 0, 0); }
    &.wpb-navigation__collapse--left { transform: translate3d(-100%, 0, 0); left: 0; right: auto;
      &.active { transform: translate3d(0%, 0, 0); }
    }
  
    .wpb-collapse__header { font-size: 1.6rem; font-weight: bold; padding: 2rem; display: flex; justify-content: space-between; align-items: center; background-color: #FFF; }
    .wpb-collapse__header > span { font-size: 2.4rem; color: #FFFF; }
    .wpb-collapse__body { padding: 2rem; padding-bottom: 4rem; flex-grow: 1; overflow-y: auto; overscroll-behavior: contain; background-color: var(--clr-light); 
      & > .logo { display: none; }
    }
    .wpb-collapse__body { 
      .btn--link { font-size: 1.4rem; }
    }

    .wpb-collapse__footer { padding: 2rem; display: flex; background-color: var(--clr-light); flex-direction: column; row-gap: 1.8rem;
      .btn { width: 100%; z-index: 10; }
      .wpb-top-menu {
        .wpb-top-menu__item { border-bottom: none; 
          .wpb-top-menu__link { padding: 1rem 0; font-size: 1.6rem; }
        }
      }
    }

    .wpb-sub-menu__links{
      .js-submenu-back-toggle{ display: flex; align-items: center; gap: 1rem; font-size: 1.4rem; padding-bottom: 2.4rem; font-weight: 600; }
      .menu-item:first-child .menu-link{ display: flex; flex-direction: column; align-items: start;
        i{ background-color: #FFF; width: 2rem; height: 2rem; min-width: 2rem; border-radius: 50%; display: inline-grid; place-items: center; }
      }
    }
    
    .menu-item { border-bottom: 1px solid var(--clr-border);
      .fa-chevron-right, .fa-chevron-left { color: var(--clr-primary); font-size: 1.4rem;}
      .menu-link { font-size: 2rem; padding: 1.5rem 0; position: relative; color: var(--clr-text); font-weight: 500;
        &:has(.fa-chevron-right) { justify-content: space-between; }
        .btn { min-height: 4rem; }
        &:hover { color: var(--clr-primary); }
      }
      &.menu-item-has-children > .wpb-sub-menu.active ~ .menu-link::after { transform: rotate(90deg); }
    }
    .btn--outline { --clr: #FFFF; --border: 1px solid #FFF6; }
  }


  .wpb-sub-menu { background-color: var(--clr-light); height: 100%; list-style: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; display: flex; flex-direction: column; transform: translate3d(100%, 0, 0); transition: transform var(--ts-35) ease; overflow: hidden;
    &.active { transform: translate3d(0, 0, 0); }
    .js-submenu-toggle { justify-content: start; }
    .wpb-icon-wrapper { display: none !important; }
    .wpb-sub-menu__header { font-size: 1.6rem; font-weight: bold; padding: 2rem; display: flex; align-items: center; justify-content: space-between; background-color: #FFF; flex-shrink: 0; position: relative; z-index: 1; }
    .container {overflow-y: auto; overflow-x: hidden; padding-top: 2rem;  }
    .wpb-submenu__footer { padding: 2rem; display: flex; background-color: var(--clr-light); flex-direction: column; row-gap: 1.8rem; position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
      .btn { width: 100%; z-index: 10; }
    }
    .wpb-sub-menu__body { display: flex; flex-direction: column; align-items: start; padding: 0; width: 100%; 
      .wpb-sub-menu__text { display: none !important; }
      .btn-group { display: none; }
    }
    .wpb-sub-menu__columns { display: none; }
    .wpb-sub-menu__column { width: 100%; padding: 0; background-color: var(--clr-light); margin: 0;
      .wpb-submenu__links { 
        li { border-bottom: 1px solid var(--clr-border); 
          a { font-size: 2rem; padding: 1.5rem 0; position: relative; color: var(--clr-text); font-weight: 500; display: block; text-decoration: none;
            .btn { min-height: 4rem; }
            &:hover { color: var(--clr-primary); }
          }
          &:first-child a { padding-top: 0; }
          &:last-child { border-bottom: none; }
        }
      }
      .wpb-sub-menu__image { margin-bottom: 2rem;
        img { width: 100%; height: auto; }
      }

      .wpb-submenu__usps { padding-left: 1.6rem;
        li { list-style: disc; margin-bottom: 0.8rem; }
      }
    }
  }
}

@media (min-width: 330px) and (max-width: 1199.98px) {
  .wpb-navigation .logo { position: absolute; left: 50%; transform: translateX(-50%) translateY(0); 
    img { height: 4.2rem; }
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .wpb-navigation__main .container:has(.wpb-navigation__collapse.active) > .logo { display: none; }
}

/*** Navigation desktop ***/
@media (min-width: 1200px) {
  .wpb-navigation {
    .wpb-navigation__main .container > .logo { display: none; }
    .btn.btn--nav-toggle, .wpb-collapse__header { display: none; }
    .container { position: static; }
    .logo img { height: 5rem; }
    &:has(.menu-item-has-children:hover, .wpb-sub-menu:hover) { --nav-bg-clr: white; --menu-clr: var(--clr-text); --menu-hover-clr: var(--clr-primary);
      .wpb-navigation__main { background-color: white; }
      .logo .logo__default { display: block !important; }
      .logo .logo__light { display: none; }
    }
  }


  .wpb-navigation__collapse { width: 100%; display: flex!important; justify-content: space-between; align-items: center;
    .menu-item {
      .menu-link { font-size: 1.6rem; padding: 1rem 1.6rem; }
      &.menu-item-has-children {
        > .menu-link { display: flex; justify-content: space-between; 
          i { transform: rotate(90deg); font-size: 1rem; }
        }
        &:hover > .wpb-sub-menu { pointer-events: all; opacity: 1; }
      }
    }
    .wpb-collapse__footer { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(1.2rem, 2vw, 3.2rem); 
      .wpb-top-menu { display: none; }
    }
    .wpb-collapse__body { display: flex;  align-items: center; justify-content: space-between; width: 100%; gap: 2rem; }
    
    .wpb-collapse__body > .logo { position: absolute; left: 50%; transform: translatex(-50%);}
    
    .wpb-sub-menu__usps { position: relative; height: 100%; border-radius: .8rem; overflow: hidden;
      &::after { content: ''; position: absolute; top: 0; right: 0; left: 0; bottom: 0; background: linear-gradient(218.42deg, rgba(var(--clr-secondary-rgb), 0) 45.19%, var(--clr-secondary) 77.88%); }
      * { color: #FFF; }
      .wpb-image img { height: 100%; object-fit: cover; }
      .wpb-image { height: 100%; }
      .wpb-usps { position: absolute; bottom: 0; padding: var(--p); gap: 2rem; --p: 4rem; z-index: 5;
        .wpb-usp { 
          .wpb-usp__text { font-size: 2rem; max-width: 15rem; }
        }
      }
    }

    .wpb-sub-menu__columns { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; height: 100%;}


    .wpb-menu { display: flex; align-items: center;
      .wpb-menu { display: flex; align-items: center; margin: 0; padding: 0; }
      .menu-item { padding: 0 1rem; }
      > .menu-item > .menu-link { padding: 4.6rem 0.6rem; }
      .btn--underline-link { width: 100%; justify-content: space-between; --mh: unset; padding-bottom: 2.4rem;}
      .wpb-sub-menu { position: absolute; left: calc(50% - 50vw); width: 100vw; padding-top: 6rem; padding-bottom: 6rem; height: auto!important; opacity: 0; overflow: visible; pointer-events: none; z-index: -1; transition: opacity var(--ts-25) ease; 
        &::before { content: ''; position: absolute; top: 0; right: 0; left: 0; bottom: 0; background: var(--clr-light); z-index: -1; box-shadow: 0 .5rem .5rem rgba(21, 47, 51, .1); }

        .container { width: 100%; }

        .wpb-sub-menu__header {display: none; }

        .wpb-sub-menu__links { display: grid; gap: 2.4rem; padding-top: 2rem;
          .wpb-icon-wrapper { background-color: var(--clr-primary); border-radius: 50%; width: 2.4rem; height: 2.4rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #FFF; flex-shrink: 0; 
            i { transform: rotate(-45deg); font-size: 1rem; }
          }
          .menu-item { border-bottom: 1px solid var(--clr-border); padding: 0; padding-bottom: 2.4rem;
            &:has(.btn--link) { display: none; }
            .menu-link { padding: 0; font-weight: 600; font-size: 1.4rem; justify-content: space-between;}
          }
        }

        .btn-group { margin-top: 2rem; }
        
        .wpb-sub-menu__body { display: grid; grid-template-columns: 38rem 1fr; align-items: start; gap: 6rem; }
        .wpb-sub-menu__body .wpb-sub-menu { top: 0; left: 100%; transform: none; }
        .wpb-sub-menu__column { padding: 0; height: 100%;
          .wpb-submenu__links { display: grid; gap: 2.3rem;

            li a { font-size: 1.4rem; padding: 0.8rem 0; display: block; text-decoration: none; color: var(--clr-text);
              &:hover { color: var(--clr-primary); }
            }
          }
          .wpb-submenu__image { margin-bottom: 1.6rem;
            img { width: 100%; height: auto; }
          }
          .wpb-submenu__usps { padding-left: 1.6rem;
            li { list-style: disc; margin-bottom: 0.6rem; font-size: 1.4rem; }
          }
        }
        .wpb-submenu__footer { display: none; }
      }
    }
  } 

  .wpb-pagewrapper:has(.wpb-navigation .menu-item-has-children) { 
    &::after { content: ''; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; background-color: rgba(51, 51, 51, 1); opacity: 0; pointer-events: none; transition: opacity var(--ts-duration) var(--ts-function); }
    &:has(.wpb-navigation .menu-item-has-children:hover) { overflow: hidden;
      &::after { opacity: .4; }
    }
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .wpb-navigation .btn--support .btn__text { display: none; }
}

@media(min-width: 1400px) {
  .wpb-navigation .wpb-sub-menu__body { gap:6rem;  }
}
