$dark1-color: #272939;
$dark2-color: #2E3044;
$dark3-color: #3B3D51;
$grey-color: #888aa3;
$grey-transparent-color: rgba(136, 138, 163, 0.3);
$white-color: #FFFFFF;
$light1-color: #C9CDDB;
$light2-color: #F0F1F5;
$light3-color: #F5F5F7;
$light4-color: #F9FAFC;
$blue-1-color: #47A7D7;
$blue-2-color: #7FDCF5;
$orange-1-color: #FC8054;
$orange-2-color: #FF9C4A;
$red-color: #e05151;
$green-1-color: #60ae5e;
$green-2-color: #98d177;
$pink-color: #F66F7B;
$shadow : 0 2px 4px 0 rgba(124,126,167,.3);

.stf-select {
  height: 40px;
  position: relative;
  background-color: $light2-color;
  border-radius: 2px;
  box-sizing: border-box;
  margin: 0;

  &__container {
    height: 100%;
    position: relative;
    box-sizing: border-box;
    cursor: text;
  }

  &__inner-wrapper {
    height: 100%;
    background-color: $light2-color;
    border-radius: 2px;
    padding: 0 9px;
  }

  &__value {
    display: none;
    height: 100%;
    font-size: 12px;
    font-weight: 700;
    line-height: 32px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  &__placeholder {
    height: 100%;
    width: 100%;
    font-size: 12px;
    line-height: 40px;
    color: $grey-color;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    padding-top: 1px;
  }

  &__options {
    width: 100%;
    min-height: 0;
    position: absolute;
    top: 50px;
    background-color: $white-color;
    border-radius: 0 0 2px 2px;
    visibility: hidden;
    z-index: -10;
  }
}

.stf-select_sm {
  height: 32px;

  .stf-select__placeholder {
    line-height: 32px;
  }

  .stf-select__value {
    line-height: 33px;
  }
}

.stf-select-options {
  display: block;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.stf-select-option {
  position: relative;
  font-size: 14px;
  line-height: 16px;
  padding: 12px 24px 12px 12px;
  border-bottom: 1px solid rgba(136,138,163,.3);
  box-sizing: border-box;
  cursor: pointer;
  outline: none;

  &_selected {
    font-weight: 700;

    &:after {
      content: '';
      display: inline-block;
      width: 20px;
      height: 20px;
      background: url("./icn-done-cargo.svg") center no-repeat;
      position: absolute;
      top: 50%;
      right: 4px;
      margin-top: -10px;
    }
  }

  &:hover, &:focus {
    background: rgba(135, 138, 163, .1);
  }
}

.stf-select__search-input {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 2px;
  z-index: -1;

  input {
    visibility: hidden;
    background-color: $white-color;
    border: none;
    border-radius: 2px;
    padding: 0 9px;
  }

  &:focus {
    outline: none;
  }
}

.stf-select_has-value {
  .stf-select {
    &__value {
      display: block;
    }

    &__placeholder {
      display: none;
    }
  }
}

.stf-select_opened {
  .stf-select {
    &__placeholder {
      display: none;
    }

    &__options {
      border-top: 1px solid $grey-transparent-color;
      visibility: visible;
      z-index: 9;
    }

    &__search-input {
      z-index: 1;

      input {
        visibility: visible;
        border-radius: 2px 2px 0 0;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
        width: 100%;
      }
    }
  }
}

.stf-select_opened.stf-select_empty {
  .stf-select__options {
    display: none;
  }

  .stf-select__search-input {
    input {
      border-radius: 2px;
    }
  }
}

