/* stylelint-disable  selector-class-pattern, property-no-vendor-prefix, selector-max-type, selector-no-qualifying-type, declaration-no-important */
@import "../globals";

.select2-selection--multiple {
  min-height: $input-height;
  height: auto;

  background-color: $input-background-color !important;
  border: 1px solid $input-border-color;
  cursor: text;

  .select2-selection__rendered {
    width: 100%;
    margin: 0;
    padding: 0 5px;

    list-style: none;
    box-sizing: border-box;

    li {
      list-style-type: none;
    }
  }

  .select2-selection__clear {
    float: right;

    margin-top: 5px;
    margin-right: 10px;

    font-weight: bold;

    cursor: pointer;
  }

  .select2-selection__choice {
    float: left;

    margin-top: 5px;
    margin-right: 5px;
    padding: 3px 5px;

    font-size: 13px;
    line-height: normal;

    background-color: $input-contrast-background-color;
    border-radius: $button-border-radius;
    color: $input-contrast-text-color;
    cursor: default;
    list-style-type: none;
  }

  .select2-selection__choice__remove {
    display: inline-block;
    margin-right: 2px;

    font-weight: bold;

    color: $input-contrast-text-color;
    cursor: pointer;

    &:hover {
      color: $input-hover-background-color;
    }
  }
}

&[dir="rtl"] {
  .select2-selection--multiple {
    .select2-selection__choice, .select2-selection__placeholder {
      float: right;
    }

    .select2-selection__choice {
      margin-right: auto;
      margin-left: 5px;
    }

    .select2-selection__choice__remove {
      margin-right: auto;
      margin-left: 2px;
    }
  }
}

&.select2-container--disabled {
  .select2-selection--multiple {
    background-color: $input-contrast-background-color;
    cursor: default;
  }

  .select2-selection__choice__remove {
    display: none;
  }
}
