/* Style mega-menu and its children on mobile */
.nv-nav-wrap .neve-mega-menu {
  > .sub-menu {
    cursor: default;

    > .sub-menu {
      opacity: 1;
      visibility: visible;
      cursor: default;
    }
  }

  .sub-menu .sub-menu {
    max-height: none;
  }

  .neve-mm-col {
    text-align: left;
    cursor: default;

    .sub-menu {
      border: none;
      padding-left: 0;
      .sub-menu {
        left: 0;
        top: 100%;
        li {
          padding: 0 12px;
          border-bottom: $muted-border !important;
        }
      }
    }
  }

  .neve-mm-heading {
    opacity: .75;
    font-size: 1.1em;
    cursor: default;

    a, span {
      font-weight: 700;
      text-transform: uppercase;
      display: flex;
      align-items: center;
    }

    i {
      margin-right: $spacing-xs;
    }
  }

  a {
    display: flex;
    align-items: center;

    i {
      margin-right: 10px;
    }
  }

  .neve-mm-divider {
    height: 1px;
    margin: $spacing-xs auto;
    width: 100%;
    background-color: $muted-white-med;
    padding: 0;
    cursor: default;
  }

  .neve-mm-description {
    text-align: left;
    justify-content: flex-start;
  }
}


.neve-mm-description {
  font-size: .8em;
  padding: 0 0 7px;
  opacity: .9;
  width: 100%;
  display: flex;
  text-align: center;
}

@mixin mega-menu--laptop() {
  .nv-nav-wrap .primary-menu-ul:not(#nv-primary-navigation-sidebar) {
    .neve-mega-menu {
      position: static;
    }

    .neve-mega-menu > .sub-menu {
      width: 950px;
      position: absolute;
      display: flex;
      padding: 20px;
      pointer-events: none;
      left: 25%;
      transform: translateX(-50%);
    }

    .neve-mega-menu:hover > .sub-menu,
    .neve-mega-menu:focus > .sub-menu,
    .neve-mega-menu:focus-within > .sub-menu {
      opacity: 1;
      visibility: visible;
      pointer-events: all;
    }

    .neve-mega-menu {
      li {
        > a, > span {
          padding: 7px 0;
          margin: 0 14px;
        }
      }
    }

    .neve-mega-menu .neve-mm-col > .sub-menu {
      visibility: visible;
      position: relative;
      left: initial;
      right: initial;
      opacity: 1;
      box-shadow: none;
      display: flex;
      flex-direction: column;
      text-align: left;
      width: 100%;

      a {
        white-space: normal;
        justify-content: flex-start;
      }
    }

    .neve-mega-menu .neve-mm-col {
      padding: 0 10px;
      align-items: flex-start;
      border: none;
    }

    .neve-mega-menu .neve-mm-col:not(:last-child) {
      border-right: $muted-border;
    }

    .neve-mega-menu .neve-mm-col > .sub-menu {
      li:not(.neve-mm-divider) {
        border: none;
      }
    }
  }
  .neve-mm-description {
    justify-content: center;
    padding: 0 12px 7px;
  }
}

@mixin mega-menu--desktop() {
  .nv-nav-wrap .primary-menu-ul:not(#nv-primary-navigation-sidebar) {
    .neve-mega-menu {
      > .sub-menu {
        width: 1170px;
      }

      position: static;
    }
  }
}
