/* === Search Bar === */
@searchbarBorderColor: #b4b4b4;
@searchbarSize: 2.2rem;
.searchbar {
  padding: 8px 0;
  overflow: hidden;
  height: @searchbarSize;
  .align-items(center);

  .searchbar-cancel {
    margin-right: -3rem;
    width: 2.2rem;  //注意，这里比 2.5rem 要小，因为如果位置刚好一样，可能在动画的过程中出现抖动
    float: right;
    height: 1.4rem;
    line-height: 1.4rem;
    text-align: center;
    transition: all .3s;
    opacity: 0;
    transform: translate3d(0,0,0);
  }

  .search-input {
    transform: translate3d(0,0,0);
    margin-right: 0;
    transition: all .3s;

    input {
      margin: 0;
      height: 1.4rem;
    }
  }

  &.searchbar-active {
    .searchbar-cancel {
      margin-right: 0;
      opacity: 1;
      
      + .search-input {
        margin-right: 2.5rem;
      }
    }
  }
}

.search-input {
  position: relative;
  input {
    box-sizing: border-box;
    width: 100%;
    height: 1.4rem;
    display: block;
    border: none;
    appearance: none;
    border-radius: 0.25rem;
    font-family: inherit;
    color: @color-text;
    font-size: 0.7rem;
    font-weight: normal;
    padding: 0 0.5rem;
    background-color: #fff;
    border: 1px solid @searchbarBorderColor;
    &::-webkit-input-placeholder {
      color: @color-text-gray-light;
      opacity: 1;
    }
  }
  .icon {
    position: absolute;
    font-size: 0.9rem;
    color: @searchbarBorderColor;
    top: 50%;
    left: 0.3rem;
    transform: translate3D(0,-50%,0);
  }

  label + input {
    padding-left: 1.4rem;
  }

}

.bar .searchbar {
  margin: 0 -0.5rem;
  padding: 0.4rem 0.5rem;
  background: rgba(0, 0, 0, .1);

  .search-input input {
    border: 0;
  }
  .searchbar-cancel {
    color: @color-text-secondary;
  }
}
