/*
** Main Menu styles
*/
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  @media(min-width: 768px) and (max-width: 991px) {
    justify-content: flex-end;
  }
  & > .top-nav + *:not(.top-includes) {
    flex-grow: 100;
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* Desktop menu - (min 1200px) styles */
@media(min-width: 1200px) {
  .top-nav {
    position: relative;
    flex-grow: 10;
    flex-wrap: nowrap;

    display: flex;
    align-items: center;

    .justify-nav-end & {
      justify-content: flex-end;
    }

    .justify-nav-center & {
      justify-content: center;
    }
  }

  /* menu layout */
  .sf-menu {
    display: block;
  }
  .sf-menu, .sf-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .sf-menu li {
    position: relative;
  }
  .sf-menu li > ul {
    position: absolute;
    left: 0;
    display: none;
    top: 110%;
    z-index: 99;
  }

  .sf-menu li:hover > ul,
  .sf-menu li.sfHover > ul {
    display: block;
  }

  .sf-menu a {
    display: block;
    position: relative;
  }

  /* menu skin */

  .sf-menu a {
    padding: 10px 1.1em;
    text-decoration: none;
    zoom: 1;
    transition-property: color, background-color, border-color, padding-top, padding-bottom;
    &:hover {
      opacity: 1 !important;
    }
  }

  .sf-menu li {
    font-weight: 400;
    white-space: nowrap;
    *white-space: normal;
    border-bottom: 1px solid rgba($lightColor, 0.2);
    &:last-child {
      border-bottom: 0;
    }
  }

  //first level
  .sf-menu > li {
    border-bottom: 0;
    display: inline-block;
    position: relative;
  }

  .sf-menu > li > a {
    line-height: 14px;
    font-weight: 400;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-right: 0;
    padding-left: 0;
    margin: 0 15px;
    transition-duration: 0.15s;

    .affix & {
      padding-top: 20px;
      padding-bottom: 20px;
    }
    @media (min-width: 1500px) {
      margin: 0 25px;
    }
  }

  .sf-menu > li > a:hover,
  .sf-menu > li.active > a {
    color: $colorMain;
  }

  .nav-narrow {
    .sf-menu > li {
      padding: 0;
    }

    .sf-menu > li > a {
      padding-top: 24px;
      padding-bottom: 24px;
      margin-left: 29px;
      margin-right: 29px;
    }

    .sf-menu > li.active > a {
      &:before {
        content: '';
        position: absolute;
        height: 1px;
        left: -20px;
        right: -20px;
        top: 0;
        z-index: 1;
        background-color: $colorMain;
      }

    }
  }

  .nav-bordered {
    .sf-menu > li {
      &:before {
        content: '';
        width: 1px;
        position: absolute;
        left: -2px;
        top: 0;
        bottom: 0;
        background-color: $darkBlueColor;
      }
       &:last-child {
        &:after {
          content: '';
          width: 1px;
          position: absolute;
          right: -2px;
          top: 0;
          bottom: 0;
          background-color: $darkBlueColor;
        }
      }
    }
  }
  
  .cs {
    .sf-menu > li > a {
      color: $lightColor;
    }
    .sf-menu > li > a:hover,
    .sf-menu > li.active > a {
      color: $darkgreyColor;
    }
  }
  .ds {
    .sf-menu > li > a {
      color: $lightColor;
    }
    .sf-menu > li > a:hover,
    .sf-menu > li.active > a {
      color: $colorMain;
    }
    .sf-menu > li.active > a {
      font-weight: 500;
    }
  }
  .ls {
    .sf-menu > li > a {
      color: $darkgreyColor;
    }
    .sf-menu > li > a:hover,
    .sf-menu > li.active > a {
      color: $colorMain;
    }

    .sf-menu > li + li:before {
      background-color: $borderColor;
    }
  }

  .sf-menu li:hover,
  .sf-menu li.sfHover {
    /* only transition out, not in */
    -webkit-transition: none;
    transition: none;
  }

  /* second and next levels */
  .sf-menu > li .mega-menu,
  .sf-menu li > ul {
    //for animation
    margin-top: 5px;
    text-align: left;
    list-style: none;
    padding: 43px 60px;
    background-color: lighten($darkColor2, 5%);
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
    min-width: 19.3em;
    *width: 10em;
  }
  .sf-menu > li .mega-menu {
    padding-left: 0;
    padding-right: 0;
  }

  .sf-menu.nav ul a {
    color: $lightColor;
    padding-left: 0;
    padding-right: 64px;
  }
  .sf-menu .mega-menu ul {
    box-shadow: none;
    padding: 0;
    background: transparent;
  }
  .sf-menu .mega-menu ul a {
    padding-left: 0;
    padding-right: 0;
  }
  .sf-menu ul > li + li:before {
  }
  .sf-menu ul a:hover,
  .sf-menu ul li.active > a {
    color: $colorMain;
  }
  /* third level */
  .sf-menu ul ul {
    margin-top: 0;
    //making third level on exact height as second
    top: -43px;
  }

  .sf-arrows .sf-with-ul:after {
    font-family: 'FontAwesome';
    content: "\f107";
    padding-left: 7px;
  }
  .sf-arrows ul .sf-with-ul:after {
    font-family: 'FontAwesome';
    padding-left: 7px;
    content: '\f105';

  }
}

.sf-menu i[class] {
  margin-right: 7px;
  font-size: 1.1em;
}

/* hidden menu items */
@media(min-width: 1200px) {
  .sf-menu .sf-xl-hidden {
    display: none !important;
  }
}

@media(max-width: 1199px) {
  .sf-more-li {
    display: none;
  }
}


.icon-menu {
  .sf-menu .sub-menu {
    .sf-with-ul:after {
      display: none;
    }
    li a:before {
      font-family: 'FontAwesome';
      content: "\f105";
      padding-right: 7px;
    }
  }

  .sf-menu .children {
   li a:before {
      font-family: 'FontAwesome';
      content: "\f105";
      padding-right: 7px;
    }
    .sf-with-ul:after {
      display: none;
    }
  }
}
