/*-------------------------------------------------------*/
/* Navigation
/*-------------------------------------------------------*/

.nav {
  min-height: $nav-full-height;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index: 120;
  position: relative;
  background-color: #fff;

  &-menu {
    position: relative;
    @include display-flex;
    align-items: center;

    & > li {
      position: relative;
    }
  }

  &-menu {

    & > li > a {
      font-family: $body-font;
      color: $nav-color;
      font-size: 14px;
      padding: 0 14px;
      line-height: $nav-full-height;
      display: block;
      position: relative;

      &:hover {
        color: #fff;
      }
    }

    & > .active > a {
      color: #fff;
    }

    & > li:last-child > a {
      padding-right: 0;
    }
  }


  /* Dropdowns / Megamenu (large screen) */
  @include bp-md-up {

    &-wrap {
      display: -webkit-box !important;
      display: -ms-flexbox !important;
      display: -webkit-flex !important;
      display: flex !important;
      height: auto !important;
    }

    &-menu > li {
      display: inline-block;
    }

    &-dropdown-menu,
    &-dropdown-submenu > .nav-dropdown-menu {
      position: absolute;
      top: 100%;
      z-index: 1000;
      min-width: 230px;
      padding: 10px 0 20px;
      list-style: none;
      white-space: nowrap;
      background-color: lighten($bg-dark, 2%);
      box-shadow: 0 2px 4px rgba(0,0,0,.05);
      -webkit-background-clip: padding-box;
      background-clip: padding-box;
      display: block;
      visibility: hidden;
      opacity: 0;
      @include transition (all .2s ease-in-out);

      > li > a {
        padding: 5px 30px;
        display: block;
      }
    }

    &-dropdown:hover > .nav-dropdown-menu,
    &-dropdown-submenu:hover > .nav-dropdown-menu {
      opacity: 1;
      visibility: visible;
    }

    &-dropdown-submenu {
      position: relative;

      .nav-dropdown-menu {
        left: 100%;
        top: -10px;
      }

      & > a:after {
        font-family: "ui-icons";
        position: absolute;
        content: "\f105";
        font-size: 8px;
        right: 20px;
        line-height: 21px;
        color: $text-color;
      }
    }   

    &-dropdown-trigger {
      display: none;
    }
  }

  &-dropdown-menu > li > a,
  &-dropdown-submenu > .nav-dropdown-menu > li > a {
    line-height: 21px;
    font-size: 14px;
    color: $nav-color;
  }

  &-dropdown-menu > li a:hover {
    color: #fff;
    background-color: lighten($bg-dark, 4%);
  }
}



/* Logo
-------------------------------------------------------*/
.site-logo {
  font-size: 28px;
}

.logo {
  max-height: 25px;
}

.logo-wrap a {
  display: table-cell;
  vertical-align: middle;
  height: $nav-full-height;
}

.site-title {
  color: #fff;
  font-size: 24px;
}


/* Nav Flexbox
-------------------------------------------------------*/

header .flex-parent {
  @include bp-md-down {
    display: block;
  }
}

header .flex-child {
  flex: 1 0 0;

  @include bp-md-down { 
    width: 100%;
  }
}

header .flex-child.flex-right {
  text-align: right;
}

.nav-wrap.flex-child {
  flex: 2 0 0;
}

.nav-align-right {
  margin-left: auto;
}

.nav-align-left {
  margin-right: auto;

  @include bp-md-up {
    margin-left: 60px;
  }  
}



/* Nav Right
-------------------------------------------------------*/

.nav-right {
  color: $nav-color;
  padding-left: 30px;
  position: relative;

  & > ul > li {
    display: inline-block;
    float: left;
    padding-right: 20px;
  }

  & > ul > li:last-child {
    padding-right: 0;
  }
}

.nav-mobile-links li > a {
  padding: 15px 0 15px 15px;
  line-height: 20px;
  border-bottom: 1px solid $border-color;
  color: $text-color;
  display: block;

  &:hover {
    color: $main-color;
  }
}



/* Nav Search
-------------------------------------------------------*/

.nav-search-link {
  position: relative;
  display: block;
  color: inherit;
  font-size: 15px;
  line-height: $nav-full-height;

  &:hover,
  &:focus {
    color: #fff;
  }
}

.nav {

  &-search-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 23;
  }

  &-search-inner {
    position: relative;
    width: 100%;
    height: 100%;
  }

  &-search-cell {
    position: absolute;
    top: 30%;
    width: 100%;
  }

  &-search-field-holder {
    width: 50%;
    margin: auto;
    position: relative;
    animation: slideInUp .3s;
  }

  &-search-input[type] {
    height: 100%;
    border: none;
    font-size: 24px;
    margin-bottom: 0;
    color: #fff;
    background-color: $bg-dark;
  }

  &-search-input[type]:focus  {
    background-color: $bg-dark;
    border: none;
  }

  &.open .nav-search-close {
    opacity: 1;
  }

  &-search-input::-webkit-input-placeholder {
    color: #fff;
  }

  &-search-input:-moz-placeholder {
    color: #fff;
    opacity: 1;
  }

  &-search-input::-moz-placeholder {
    color: #fff;
    opacity: 1;
  }

  &-search-input:-ms-input-placeholder {
    color: #fff;
  }

  &-search-close {
    position: absolute;
    top: 12px;
    right: 5px;
    font-size: 30px;
    color: $text-color;
    cursor: pointer;
  }
}

.ui-search:before {
  position: relative;
  top: 2px;
}

.nav-search-mobile {
  position: relative;
}


/* Nav Icon Toggle (mobile nav)
-------------------------------------------------------*/

.nav-icon-toggle {
  position: relative;
  top: 14px;
  float: right;
  padding: 9px 5px 9px 10px;
  background-color: transparent;
  border: none;
  z-index: 50;
  outline: none;

  @include bp-md-up {
    display: none;
  }

  &-bar {
    background-color: $bg-dark;
    width: 18px;
    display: block;
    height: 2px;
    border-radius: 1px;
    margin-bottom: 4px;

    &:last-child {
      margin-bottom: 0;
    }

    .nav-dark & {
      background-color: #fff;
    }
  }

  &:focus .nav-icon-toggle-bar,
  &:hover .nav-icon-toggle-bar {
    background-color: $main-color;
  }
}


/* Sticky Nav
-------------------------------------------------------*/

.nav-holder {

  &.offset {
    @include transform (translate3d(0, -100%, 0));
    @include transition ($all);
  }

  &.scrolling {
    @include transform (translate3d(0, 0px, 0));
  }

  &.sticky {
  position: fixed;
  background-color: $bg-dark;
  visibility: hidden;
  opacity: 0;
  left: 0;
  right: 0;
  top: 0;
  box-shadow: 0 0 5px rgba(0,0,0,.1);
  z-index: 120;

    &.scrolling {
      opacity: 1;
      visibility: visible;
    }
  }
}

.admin-bar .nav-holder.sticky {
  top: 32px;
}

@include bp-md-down {
  .nav-sticky-on-mobile .nav-holder {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
}


/* Dark Nav
-------------------------------------------------------*/
.nav-dark {
  background-color: $bg-dark;
}


/* Go to Top
-------------------------------------------------------*/

#back-to-top {
  display: block;
  z-index: 100;
  width: 34px;
  height: 34px;
  text-align: center;
  font-size: 14px;
  position: fixed;
  bottom: -34px;
  right: 20px;
  line-height: 32px;
  background-color: rgba( $heading-color, .3);
  border-radius: 50%;
  @include transition ($all);
  text-decoration: none;

  i {
    @include transition ($all);
  }

  a {
    display: block;
    color: #fff;
  }

  &.show {
    bottom: 20px;
  }

  &:hover {
    background-color: $main-color;
    bottom: 24px;
  }

  &:hover i {
    color: #fff;
  }
}


/*-------------------------------------------------------*/
/* Nav Mobile Styles
/*-------------------------------------------------------*/

@include bp-md-down {

  .nav {
    min-height: $nav-short-height;

    &-menu {
      display: block;
    }

    &-menu li a {
      padding: 0;
      line-height: 46px;
      height: 46px;
      display: block;      
      border-bottom: 1px solid $border-dark-color;
    }

    &-dropdown-menu > li > a {
      padding-left: 10px;
    }

    &-dropdown-menu > li > ul > li > a {
      padding-left: 20px;
    }

    &-dropdown-trigger {
      display: block;
      width: 46px;
      height: 46px;
      padding-left: 26px;
      line-height: 46px;
      text-align: center;
      position: absolute;
      right: 0;
      top: 0;
      z-index: 50;
      cursor: pointer;
    }

    &-dropdown-submenu {
      position: relative;
    }

    &-dropdown-menu {
      display: none;
      width: 100% !important;
    }

    &-dropdown-trigger.active + .nav-dropdown-menu {
      display: block;
    }


    /* Mobile Search */

    &-search-mobile-input[type] {
      height: 46px;
      padding: 0;
      border: none;
      background-color: transparent;
      margin-bottom: 0;
      color: $nav-color;

      &:focus {
        background-color: transparent;
      }
    }

    /* Change Color of Placeholders */

    input.nav-search-mobile-input::-webkit-input-placeholder {
      color: $nav-color;
    }

    input.nav-search-mobile-input:-moz-placeholder {
      color: $nav-color;
      opacity: 1;
    }

    input.nav-search-mobile-input::-moz-placeholder {
      color: $nav-color;
      opacity: 1;
    }

    input.nav-search-mobile-input:-ms-input-placeholder {
      color: $nav-color;
    }

    &-search-mobile-button {
      font-size: 15px;
      position: absolute;
      right: 0;
      top: 0;
      width: 46px;
      height: 46px;
      padding-left: 26px;
      border: 0;
      cursor: pointer;
      color: $nav-color;
      background-color: transparent;
    }
  }

  .logo-wrap {
    float: left;

    a {
      display: table-cell;
      vertical-align: middle;
    }
  }

  .logo-wrap a {
    height: $nav-short-height;
  }

}
