//
// Default navbar
// --------------------------------------------------

.b-nav {
  height: @navbar-height;
  background-color: @navbar-default-bg;
  .clearfix();
  position: relative;
}

.navbar-sticky {
  .transition(all .15s ease-in-out);

  &.is-sticky {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1000;
    // width: 100%;
    .box-shadow(0 1px 6px rgba(0,0,0,.18));
  }
}

.b-nav__brand {
  display: block;
  text-decoration: none;
  width: 120px;
  height: 48px;
  position: absolute;
  left: 50%;
  top: 50%;
  .translate(-50%,-50%);

  span {
    display: block;
    width: 120px;
    height: 48px;
    background-repeat: no-repeat;
    overflow: hidden;
    text-indent: -9999px;

    .img-retina('../img/logo.png', '../img/logo@2x.png', 120px, 48px);
  }

  > img {
    display: inline-block;
    max-height: @navbar-height;
  }
}

.b-nav__toggle-menu {
  float: left;
  width: 24px;
  height: 48px;
  line-height: 48px;
  font-size: 24px;
  color: @navbar-default-link-color;
  border: 0 none;
  margin: @navbar-margin-vertical 0;
  padding: 0;
  background: none;
  position: relative;

  span {
    display: block;
    background: #2ade75;
    height: 2px;
    width: 20px;
    position: absolute;
    left: 0;
    top: 23px;
    .transition(@transition);

    &:first-child {
      top: 17px;
    }

    &:last-child {
      top: 29px;
      width: 16px;
    }
  }

  &:focus {
    outline: 0 none;
  }

  &:hover {

    span {
      background: #fff;

      &:first-child {
        width: 16px;
      }

      &:last-child {
        width: 18px;
      }
    }
  }
}

.b-nav__toggle-search {
  float: right;
  width: 24px;
  height: 48px;
  line-height: 48px;
  font-size: 24px;
  color: @navbar-default-link-color;
  border: 0 none;
  margin: @navbar-margin-vertical 0 @navbar-margin-vertical 30px;
  padding: 0;
  background: none;
  .transition(@transition);

  &:hover {
    color: #fff;
  }

  &:focus {
    outline: 0 none;
  }

  .fe {
    top: -4px;
  }
}

.b-nav__social {
  float: right;
  line-height: 48px;
  margin: @navbar-margin-vertical 0;
  border-right: 1px solid fade(#eaf2f5, 10%);
  padding-right: 30px;

  a {
    float: left;
    font-size: 16px;
    margin-left: 20px;
    .transition(@transition);

    &,
    &:focus {
      color: @navbar-default-link-color;
      text-decoration: none;
    }

    &:hover {
      color: #fff;
    }
  }
}

.b-nav__account {
  float: left;
  margin: @navbar-margin-vertical 0 @navbar-margin-vertical 30px;
  padding: 0 0 0 30px;
  list-style-type: none;
  border-left: 1px solid fade(#eaf2f5, 10%);

  > li {
    float: left;
    margin: 0 15px 0 0;

    > a {
      display: block;
      line-height: 48px;

      > img {
        width: 24px;
        height: 24px;
        display: inline-block;
        margin-right: 6px;
      }

      &,
      &:focus {
        text-decoration: none;
        color: @navbar-default-link-color;
      }

      &:hover {
        color: @brand-accent;
      }
    }

    .dropdown-menu {
      padding: 10px 0;
      display: block;
      visibility: hidden;
      top: 80%;
      .opacity(0);
      .transition(all .15s ease-in-out);

      &::before {
        content: '';
        display: block;
        position: absolute;
        left: 50%;
        top: -8px;
        margin-left: -4px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 0 8px 8px 8px;
        border-color: transparent transparent #fff transparent;
      }

      > li {
        
        > a {
          padding: 10px 30px;
        }
      }
    }

    &.open .dropdown-menu {
      visibility: visible;
      .opacity(1);
      top: 100%;
    }
  }
}

.b-nav__search {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: fade(@brand-accent, 95%);
  margin: 0;
  padding: 0;
  .transition(@transition);
  visibility: hidden;
  .opacity(0);

  &.is-visible {
    visibility: visible;
    .opacity(1)
  }

  &__close {
    float: right;
    width: 24px;
    height: 48px;
    line-height: 48px;
    font-size: 24px;
    color: @navbar-default-link-color;
    border: 0 none;
    margin: @navbar-margin-vertical 0 @navbar-margin-vertical 30px;
    padding: 0;
    background: none;
    .transition(@transition);

    &:hover {
      color: #fff;
    }

    &:focus {
      outline: 0 none;
    }

    .fe {
      top: -4px;
    }
  }

  &__wrp {
    position: absolute;
    left: 50%;
    width: 500px;
    top: 50%;
    .translate(-50%,-50%);

    input {
      height: 60px;
      background: transparent;
      border: 0 none;
      padding: 0 40px 0 0;
      border: 0 none;
      border-bottom: 2px solid fade(#fff, 30%);
      width: 100%;
      font-size: 24px;
      color: #fff;
      .transition(@transition);
      .placeholder(fade(#fff, 30%));

      &:focus {
        outline: 0 none;
        border-bottom-color: #fff;
      }
    }

    button {
      display: block;
      border: 0 none;
      background: none;
      padding: 0;
      margin: 0;
      position: absolute;
      right: 0;
      top: 15px;
      width: 30px;
      height: 30px;
      line-height: 30px;
      font-size: 22px;
      color: #fff;

      &:focus {
        outline: 0 none;
      }
    }
  }
}