.#{$search-bar-prefix-cls} {
  position: relative;
  display: flex;
  align-items: center;
  height: $search-bar-height;
  padding: 0 $search-bar-padding-x;
  overflow: hidden;
  background-color: $gray-5;

  &__input {
    position: relative;
    flex: 1;
    width: 100%;
    height: $search-bar-input-height;
    overflow: hidden;
    background-color: $white;
    background-clip: padding-box;
    border-radius: $border-width;

    .#{$search-bar-prefix-cls}__synthetic-ph,
    input[type="search"] {
      position: absolute;
      top: 0;
      left: 0;
    }

    .#{$search-bar-prefix-cls}__synthetic-ph {
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      padding-left: nth($search-bar-input-padding-x,1);
      transition: width $transition-time;

      &-icon {
        margin-right: $search-bar-input-icon-margin-x;
        font-size: $search-bar-input-icon-font-size;
        color: $gray-11;
        @extend %aid-icon;
        &::before{
          content: "\F54E";
        }
      }

      &-placeholder {
        font-size: $search-bar-input-placeholder-font-size;
        color: $gray-11;
      }
    }

    input[type="search"] {
      z-index: 2;
      display: block;
      width: 100%;
      height: 100%;
      font-size: $search-bar-input-font-size;
      color: $gray-9;
      text-align: left;
      background: transparent;
      border: 0;
      opacity: 0;

      &::placeholder {
        color: transparent;
      }

      &::-webkit-search-cancel-button {
        // stylelint-disable property-no-vendor-prefix
        -webkit-appearance: none;
      }
    }

    .#{$search-bar-prefix-cls}__clear {
      position: absolute;
      top: 50%;
      right: 0;
      z-index: 3;
      display: none;
      padding-right: nth($search-bar-input-padding-x,2);
      font-size: $search-bar-input-icon-font-size;
      color: $gray-11;
      transition: all $transition-time;
      transform: translate(0,-50%);
      @extend %aid-icon;

      &::before{
        content: "\F2B0";
      }

      &--show {
        display: block;
      }
    }
  }

  &__cancel {
    display: none;
    flex: none;
    height: $search-bar-height;
    padding-left: $search-bar-cancel-margin-x;
    margin-right: -.4rem;
    line-height: $search-bar-height;
    color: $gray-9;
    text-align: right;
    opacity: 0;

    &--anim {
      transition: margin-right $transition-time, opacity $transition-time;
      transition-delay: .1s;
    }

    &--show {
      display: block;
      margin-right: 0;
      opacity: 1;
    }
  }

  &--start {
    .#{$search-bar-prefix-cls}__input {
      input[type="search"] {
        padding-left: calc(#{nth($search-bar-input-padding-x,1)} + #{$search-bar-input-icon-font-size}  + #{$search-bar-input-icon-margin-x});
        opacity: 1;

        &::placeholder {
          color: $gray-11;
          text-align: left;
        }
      }
      .#{$search-bar-prefix-cls}__synthetic-ph{
        justify-content: flex-start;

        &-placeholder {
          visibility: hidden;
        }
      }
    }
  }
}
