/* ###### 4.10 Select2 ###### */

.select2-results__option {
  border-radius: 0;
  margin-bottom: 1px;
  font-size: inherit;
}

.select2-container--default {

  .select2-selection--single {
    background-color: #fff;
    border-color: $input-border-color;
    height: $height-base; //$input-height;
    outline: none;

    .select2-selection__rendered {
      color: $text-color-grey;

      padding-left: 20px;
      padding-right: 20px;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-size: 0.875rem;
    }

    .select2-selection__placeholder {
      color: $input-placeholder-color;
    }

    .select2-selection__arrow {
      width: 30px;
      height: $height-base; //$input-height;
      line-height: $input-height;

      @if $direction==ltr {

          right: 0;
      }

      @else {

           left: 0;
      }



      b { margin-top: -3px; }
    }

    .select2-selection__clear {
      font-size: 20px;
      font-weight: $font-weight-base;
      order: 2;
      margin-left: auto;
      margin-right: 5px;
      color: $color-text-03;
      position: relative;
      z-index: 100;

      @include hover() { color: $color-text-02; }
    }
  }

  .select2-selection--multiple {
    background-color: $input-bg;
    border-color: $input-border-color;
    border-radius: 2px;
    min-height: $height-base;
    outline: none;

    .select2-selection__rendered {
      padding: 0 4px;
      display: block;
    }

    .select2-selection__choice {
      position: relative;
      margin-top: 4px;
      margin-right: 4px;
      padding: 3px 10px 3px 20px;
      border-color: transparent;
      border-radius: 1px;
      background-color: $primary;
      color: #fff;
      font-size: 13px;
      line-height: 1.45;
    }

    .select2-selection__choice__remove {
      color: #fff;
      opacity: .5;
      font-size: 14px;
      font-weight: $font-weight-base;
      display: inline-block;
      position: absolute;
      top: 4px;
      left: 7px;
      line-height: 1.2;
    }
  }

  &.select2-container--focus .select2-selection--multiple {
    border-color: $input-border-color;
  }

  .select2-search--dropdown .select2-search__field {
    border-color: #e7e7ed;
    border-radius: 0;
    padding: 5px 10px;
      box-shadow: none;
      outline: none;
      direction: $direction;

    &::placeholder { color: $color-text-03; }
  }

  .select2-results__option[aria-selected="true"] {
    background-color: lighten($body-bg, 5%);
  }

  .select2-results__option--highlighted[aria-selected] {
    background-color: $primary;
  }

  .select2-results > .select2-results__options {
    margin: 0px;
  }

  .select2-search--inline .select2-search__field {
    margin-top: 6px;
    line-height: 26px;
    padding-left: 10px;
    opacity: 1;

    &::placeholder {
      color: $color-text-03;
      font-weight: $font-weight-base;
      opacity: 1;
    }
  }

  &.select2-container--disabled {

    .select2-selection--single { background-color: $bg-grey; }

    .select2-selection__choice {
      padding-left: 10px;
      background-color: $gray-500;

      .select2-selection__choice__remove { display: none; }
    }

  }
}

.select2-container--open {
  font-size: 14px;

  .select2-selection--single,
  .select2-selection--multiple {
    background-color: #fff;
    border-color: $input-border-color;
  }

  .select2-dropdown--above {
    @include border-top-radius(0);
  }

  .select2-dropdown--below {
    @include border-bottom-radius(0);
    top: 0; //$input-height - 1.15;
  }
}

.select2-dropdown {
   border: 0  ;
   // z-index: 200;
    box-shadow: 0 5px 50px 0 rgba(37,44,65,.12);

}

.select2-search--dropdown {
  padding: 12px;
}

.select2-results__option {
  padding: 6px 10px;
  font-size: inherit;
}


// Alert State
.has-success .select2-container--default .select2-selection--single { border-color: theme-color('success'); }
.has-warning .select2-container--default .select2-selection--single { border-color: theme-color('warning'); }
.has-danger .select2-container--default .select2-selection--single { border-color: theme-color('danger'); }


// Size
.select2-xs + .select2-container { font-size: 12px; }
.select2-dropdown-xs .select2-results__option {  font-size: 12px; }

.select2-sm + .select2-container { font-size: 14px; }
.select2-dropdown-sm .select2-results__option {  font-size: 14px; }

// Border
.select2-bd-0 + .select2-container--default .select2-selection--single { border-width: 0; }
.bg-gray + .select2-container--default .select2-selection--single {
  background-color: lighten($gray-800, 5%);
  .select2-selection__rendered { color: $gray-300; }
}


.select2.line + .select2-container .select2-selection--single
{
        height: 51px;
    background: none;
    border: 0;
    border: 1px solid $input-border-color;
         border-radius: .25rem;
}


.select2.line +
.select2-container--default .select2-selection--single .select2-selection__rendered
{

    padding-left: 0;
    padding-right: 0;

}



.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    margin-left: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px !important;;
    padding: 0 1rem !important;


}


.disabled.select2 {
    pointer-events: none;
    background-color: #e9ecef;
    opacity: 1;
}

.disabled.select2 .select2-selection__arrow {
    display: none;
}
