@import "../../../style/themes/default";

@search-bar-prefix-cls: ~"@{antui-prefix}-search-bar";

.@{search-bar-prefix-cls} {
  position: relative;
  padding: .16rem .2rem;
  display: flex;
  box-sizing: border-box;
  background-color: #efeff4;
  width: 100%;
  border-top: 1PX solid #d7d6dc;
  border-bottom: 1PX solid #d7d6dc;

  &_focusing &__cancel-btn {
    display: flex;
    align-items: center;
  }

  &_focusing &__label {
    display: none
  }

  &__form {
    position: relative;
    flex: auto;
    background-color: #efeff4
  }

  &__form:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 200%;
    height: 200%;
    transform: scale(.5);
    transform-origin: 0 0;
    border-radius: .2rem;
    border: 1PX solid #e6e6ea;
    box-sizing: border-box;
    background: #fff
  }

  &__box {
    position: relative;
    padding-left: .6rem;
    padding-right: .6rem;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    z-index: 1
  }

  &__box &__input {
    padding: .08rem 0;
    width: 100%;
    height: 1.42857143em;
    border: 0;
    line-height: 1.42857143em;
    box-sizing: content-box;
    background: transparent
  }

  &__box &__input:focus {
    outline: none
  }

  &__box .antui-icon-search {
    position: absolute;
    margin-top: .13rem;
    margin-left: -.47rem;
  }

  .antui-icon-search {
    color: #b2b2b2;
    width: .38rem;
    height: .38rem;
  }

  &__box .antui-icon-clear {
    position: absolute;
    top: .13rem;
    right: .13rem;
    width: .38rem;
    height: .38rem;
    color: #b2b2b2;
  }

  &__label {
    position: absolute;
    top: 1PX;
    right: 1PX;
    bottom: 1PX;
    left: 1PX;
    z-index: 2;
    border-radius: 3PX;
    text-align: center;
    color: #9b9b9b;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  &__label span {
    display: flex;
    align-items: center;
  }

  &__label .antui-icon-search {
    margin-right: 5PX;
    vertical-align: bottom;
  }

  &__cancel-btn {
    display: none;
    margin-left: .2rem;
    color: @primary-color;
    white-space: nowrap
  }

  &__input:not(:valid)~.antui-icon-clear {
    display: none
  }

  input[type=search]::-webkit-search-cancel-button,
  input[type=search]::-webkit-search-decoration,
  input[type=search]::-webkit-search-results-button,
  input[type=search]::-webkit-search-results-decoration {
    display: none
  }
}