@import '../../_style/index.less';

@searchPrefixCls: mdf-search;

.@{searchPrefixCls} {
  position: relative;
  display: flex;
  align-items: center;
  height: @search-bar-height;
  overflow: hidden;
  background-color: #F3F3F3;
  border-radius: @hd * 18;
  padding: 0;
  caret-color: @brand-primary;
  color: @color-text-base;

  .icon () {
    position: absolute;
    top: 0;
    height: @search-bar-height;
    display: flex;
    align-items: center;
    overflow: hidden;

    svg {
      height: 0.32rem;
      width: 0.32rem;
    }
  }

  &-icon {
    .icon();
    left: 0.2rem;
    color: #bfbfbf;
  }

  &-clear {
    .icon();
    z-index: 3;
    right: 0.5rem;
    color: @color-text-caption;
    opacity: 0;
    transition: .3s opacity;

    &-show {
      opacity: 1;
    }

    i {
      background-image: url('./clear.png');
      width: 24*@hd;
      height: 24*@hd;
      background-size: 24*@hd;
      margin-left: 10*@hd;
    }
  }

  &-voice {
    .icon();
    z-index: 3;
    right: 0.2rem;
    color: #bfbfbf;
  }

  &-input {
    z-index: 2;
    display: block;
    padding: 0 @search-bar-height * 2 0 @search-bar-height;
    border: 0;
    background-color: transparent;
    text-align: left;
    font-size: @hd * 14;
    color: currentColor;
  }
}

input::-webkit-input-placeholder {
  /* placeholder颜色 */
  color: #BFBFBF;
}
