/*-------------------------------------------------------*/
/* Navigation
/*-------------------------------------------------------*/
.nav {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index: 120;
  min-height: $nav-height;  
  position: relative;

  &__holder {
    border-bottom: 1px solid $border-color;
  }
  
  &__menu,
  &__dropdown-menu {
    list-style: none;
  }

  &__menu {
    position: relative;
    @include display-inline-flex;
    align-items: center;
    flex-wrap: wrap;

    li {
      position: relative;
    }

    li a {
      font-family: $heading-font;
    }

    & > li > a {
      font-weight: 600;
      color: $nav-links-color;
      font-size: 1rem;      
      line-height: $nav-height;
      display: block;
      position: relative;
      @include transition( .1s color );

      &:hover {
        opacity: .9;
      }
    }
  }

  /* Dropdowns (large screen) */
  @include bp-lg-up {

    &__flex-parent {
      height: $nav-height;
    }

    &__wrap {
      margin-left: auto;

      &.collapse {
        display: block;
        height: auto;
      }
    }

    &__menu > li {
      display: inline-block;
      text-align: center;
      padding: 0 17px;

      &:last-child {
        padding-right: 0;
      }
    }

    &__dropdown-menu {
      position: absolute;
      left: -5px;      
      top: 100%;
      z-index: 1000;
      min-width: 220px;
      width: 100%;
      text-align: left;
      padding: 16px 0;
      list-style: none;
      background-color: #fff;
      box-shadow: 0 4px 20px rgba( #9aa1ab, .25);
      border-radius: 3px;
      -webkit-background-clip: padding-box;
      background-clip: padding-box;
      display: block;
      visibility: hidden;
      opacity: 0;
      @include transition (all .2s ease-in-out);

      & > li > a {
        color: $text-color;
        padding: 5px 24px;
        line-height: 22px;
        display: block;        

        &:hover,
        &:focus {
          color: $primary-color;
        }
      }
    }

    &__item-dropdown::after {
      content: '\e900';
      font-size: 12px;
      opacity: 0.5;
      font-family: 'everse';
      line-height: 1;
      margin-left: 4px;
    }

    &__dropdown-menu.hide-dropdown {
      visibility: hidden !important;
      opacity: 0 !important;
    }

    &__dropdown:hover > .nav__dropdown-menu,
    &__dropdown:focus > .nav__dropdown-menu,
    &__dropdown.focus > .nav__dropdown-menu {
      opacity: 1;
      visibility: visible;
    }

    &__dropdown-menu {
      .nav__dropdown-menu {
        left: 100%;
        top: -16px;
      }
    }

    &__dropdown &__dropdown {
      position: relative;
    }

    &__dropdown &__dropdown > a:after {
      content: '\e902';
      font-family: 'everse';
      font-size: 16px;
      position: absolute;
      right: 20px;
      top: 50%;
      @include transform(translateY(-50%));
    }

    &__dropdown-trigger {
      display: none;
    }
  }
}


/* Mini Cart dropdown
-------------------------------------------------------*/
.everse-menu-cart__dropdown {
  @extend .nav__dropdown-menu;
}


/* Dropdown trigger
-------------------------------------------------------*/
.nav__dropdown-trigger { 
  background-color: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  color: inherit;

  &:focus {
    background-color: transparent;
    color: inherit;
  }

  i {
    display: inline-block;
    vertical-align: middle;
    @include transition (all .2s ease-in-out);
  }

  &--is-open i {
    @include transform( rotate( 180deg ) );
  }
}

.mobile body {
  cursor: pointer;
}

.nav__menu > li.active > a,
.nav__menu > .current_page_parent > a,
.nav__menu .current-menu-item > a {
  color: $primary-color;
}


/* Logo
-------------------------------------------------------*/
.logo {
  line-height: 1;
  display: block;
  max-height: 60px;

  &-url {
    vertical-align: middle;
    line-height: 1.2;
    color: $nav-links-color;
  }
}


/* Nav Flexbox
-------------------------------------------------------*/
.nav__flex-parent {
  align-items: center;
  justify-content: space-between;

  @include bp-lg-down {
    display: block;
  }
}

.nav--align-right {
  margin-left: auto;
}

.nav--align-left {
  margin-right: auto;
}


/* Nav Right / Last menu item
-------------------------------------------------------*/
.nav__right {
  margin-left: 32px;
  align-items: center;

  &-item {
    margin-right: 16px;

    &:last-child {
      margin-right: 0;
    }
  }

  &-btn-holder {
    margin-left: 10px;
  }
}

.nav__last-item-mobile {
  padding: 16px 0;
}

.everse-menu-account__icon,
.everse-menu-cart__icon,
.everse-menu-search__icon {
  font-size: 1.125rem;
  display: block;
}


/* Nav Mobile / Icon Toggle
-------------------------------------------------------*/
.nav__mobile {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.nav__icon-toggle {
  display: block;
  position: relative;
  padding: 9px !important;
  width: 36px;
  height: 32px;
  margin-right: -9px;
  margin-left: auto;  
  border: none;
  z-index: 50;
  outline: 0;
  box-shadow: none;

  &.eversor-nav-menu__icon-toggle,
  .nav__mobile & {
    background-color: transparent;

    &:hover,
    &:focus {
      background-color: transparent;
    }
  }

  @include bp-lg-up {
    display: none;
  }

  &-bar {
    background-color: $nav-links-color;
    width: 18px;
    display: block;
    position: absolute;
    height: 2px;
    border-radius: 1px;
  }

  span:nth-child(2) {
    top: 9px;
    @include transition ( top 0.2s 0.20s ease-in, opacity 0.1s ease-in );
  }

  span:nth-child(3) {
    top: 15px;
    @include transition ( opacity 0.1s ease-in );
  }

  span:nth-child(4) {
    bottom: 9px;
    @include transition ( bottom 0.2s 0.20s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19) );
  }

  &--is-opened {
    span:nth-child(2) {
      top: 15px;
      @include transition( .5s cubic-bezier(0.215, 0.61, 0.355, 1) );
      @include transform ( rotate(45deg) );
    }

    span:nth-child(3) {
      opacity: 0;
    }

    span:nth-child(4) {
      bottom: 15px;
      @include transform( rotate(-45deg) );
      @include transition ( bottom 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1) );
    }
  }

  &:focus {
    outline: 0;
  }

  &:focus .nav__icon-toggle-bar,
  &:hover .nav__icon-toggle-bar {
    background-color: $primary-color;
  }

}


/* Header Layout 2 (Bottom navbar)
-------------------------------------------------------*/
.everse-header-layout-2 {

  @include bp-lg-up {
    .nav__flex-parent {
      display: block;
      height: auto;
      text-align: center;
    }

    .nav__navbar-holder {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .nav__wrap {
      margin-left: 0;
    }

    .nav--sticky.sticky .nav__flex-parent {
      height: auto;
    }

    .nav__header {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .logo-url,
    .nav__wrap.collapse {
      display: inline-flex;
    }

    .nav__right {
      display: inline-flex !important;
      align-items: center;
    }

  }
  
}


/* Header Layout 3 (Logo right, menu left)
-------------------------------------------------------*/
.everse-header-layout-3 {
  .nav__flex-parent {
    flex-flow: row-reverse nowrap;
  }

  @include bp-lg-up {
    .nav__wrap {
      margin-left: 0;
      margin-right: auto;
    }
  }

  .nav__right {
    margin-right: 32px;
    margin-left: 0;
  }

  .nav__menu > li:first-child {
    padding-left: 0;
  }

}


/* Custom Header Logo
-------------------------------------------------------*/
.everse-logo-container {
  display: inline-block;
  vertical-align: middle;
}


/* Sticky Nav
-------------------------------------------------------*/
.nav--sticky {

  &.offset {
    @include transform (translate3d(0, -100%, 0));
    @include transition ($transition-all !important);
  }

  &.scrolling {
    @include transform (translate3d(0, 0px, 0));
  }

  &.sticky {
    position: fixed !important;
    background-color: #fff;
    visibility: hidden;
    opacity: 0;
    left: 0;
    right: 0;
    top: 0;
    box-shadow: 0 0 5px rgba(62, 64, 69, 0.1);

    &.scrolling {
      opacity: 1;
      visibility: visible;
    }
  }
}


/* Go to Top
-------------------------------------------------------*/
#back-to-top {
  display: block;
  z-index: 100;
  width: 34px;
  height: 34px;
  text-align: center;
  font-size: 15px;
  position: fixed;
  bottom: -34px;
  right: 20px;
  line-height: 34px;
  background-color: $bg-light;
  box-shadow: 0px 1px 4px 0px rgba( 154, 161, 171, .4 );
  border-radius: 50%;
  @include transition ($transition-all);
  text-decoration: none;

  i {
    @include transition ($transition-all);
  }

  a {
    display: block;
    color: $nav-links-color;
  }

  &.show {
    bottom: 20px;
  }

  &:hover {
    background-color: $primary-color;
    bottom: 24px;
  }

  &:hover i {
    color: #fff;
  }
}


/*-------------------------------------------------------*/
/* Nav Mobile Styles
/*-------------------------------------------------------*/
@include bp-lg-down {

  .nav {

    &__wrap {
      margin-left: 0;
    }

    &__header {
      height: $nav-height;
      @include display-flex;
      align-items: center;
    }

    &__menu {
      display: block;
    }

    &__menu li a {
      padding: 0;
      line-height: 46px;
      height: 46px;
      display: block;      
      border-bottom: 1px solid $border-color;
    }

    &__dropdown-menu a {
      color: $text-color;

      &:hover {
        color: #000;
      }
    }

    &__dropdown-menu > li > a {
      padding-left: 10px;
    }

    &__dropdown-menu > li > ul > li > a {
      padding-left: 20px;
    }

    &__dropdown-trigger {
      display: block;
      width: 20px;
      min-height: 46px;
      line-height: 1;
      font-size: 1rem;
      text-align: center;
      position: absolute;
      right: 0;
      top: 0;
      box-shadow: none;
      z-index: 50;
      cursor: pointer;
    }

    &__dropdown-menu {
      display: none;
      width: 100% !important;
    }

    &__dropdown-trigger.active + .nav__dropdown-menu {
      display: block;
    }
  }

  .logo-wrap {
    float: left;

    a {
      display: table-cell;
      vertical-align: middle;
      height: $nav-height;
    }
  }

  .nav__btn {
    width: 100%;
    margin-bottom: 18px;
  }

}