@import "mixins/mixins";
@import "mixins/utils";
@import "common/var";
@import "select-dropdown";
@import "option";
@import "option-group";

@include b(select) {
  display: inline-block;
  position: relative;

  .xb-select__tags
    >span {
      display: contents;
    }

  .xb-input__inner {
    cursor: pointer;
    padding-right: 35px;
    &:hover{
      border-color: $--input-border-color;
    }
    &:focus {
      border-color: $--input-border-color;
    }
  }

  .xb-input {
    & .xb-select__caret {
      color: $--select-input-color;
      font-size: $--font-size-base - 2px;
      transition: transform .3s;
      transform: rotateZ(180deg);
      cursor: pointer;
      width:20px;

      @include when(reverse) {
        transform: rotateZ(0deg);
      }

      @include when(show-close) {
        font-size: $--font-size-base;
        text-align: center;
        transform: rotateZ(180deg);
        border-radius: $--border-radius-base;
        color: $--select-input-color;
        transition: $--color-transition-base;
      }

      @include when(close-icon){
        color:#C1C4CC;
        font-size: $--font-size-base;
      }
    }

    &.is-disabled {
      & .xb-input__inner {
        cursor: not-allowed;

        &:hover {
          border-color: $--select-disabled-border;
        }
      }
    }
  }

  > .xb-input {
    display: block;
  }

  @include e(input) {
    border: none;
    outline: none;
    padding: 0;
    margin-left: 15px;
    font-size: $--font-size-base;
    appearance: none;
    height: 28px;
    background-color: transparent;
    @include when(small) {
      height: 14px;
    }
  }

  @include e(close) {
    cursor: pointer;
    position: absolute;
    top: 8px;
    z-index: $--index-top;
    right: 25px;
    color: $--select-input-color;
    line-height: 18px;
    font-size: $--font-size-base;
  }

  @include e(tags) {
    position: absolute;
    line-height: normal;
    white-space: normal;
    z-index: $--index-normal;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding:5px;
    padding-right: 0;
  }

  .xb-tag__close {
    margin-top: -2px;
  }

  .xb-tag {
    box-sizing: border-box;
    border-color: transparent;
    margin: 3px 0 3px 6px;
    background-color: #f0f2f5;

    &__close.xb_icon_close_facet {
      right: -7px;
      top: 0;
      &::before {
        display: block;
        transform: translate(0, .5px);
      }
    }
  }
}
