//
// _select2.scss
//

@use "../variables" as *;

.select2-container {
    width: 100% !important;

    .select2-selection--single {
        border: 1px solid $border-color;
        height: 38px;
        background-color: $white;
        outline: none;
        border-radius: 5px;

        .select2-selection__rendered {
            line-height: 38px;
            padding-left: 12px;
            padding-right: 28px;
            color: $body-color;
        }

        .select2-selection__arrow {
            height: 34px;
            width: 38px;
            position: absolute;
            top: 1px;
            /*rtl:ignore*/
            right: 3px;

            b {
                border-color: $gray-900;
                border-width: 0 1px 1px 0;
                padding: 3px;
                height: 0;
                left: 50%;
                transform: rotate(45deg) translateY(-50%);
                margin-left: -4px;
                margin-top: -2px;
                position: absolute;
                top: 50%;
                width: 0;
                border-style: solid;
            }
        }
    }
}

.select2-container--open {
    .select2-selection--single {
        .select2-selection__arrow {
            b {
                border-color: $gray-900 !important;
                border-width: 1px 0 0 1px !important;
                margin-top: 3px;
            }
        }
    }
}

.select2-results__option {
    padding: 6px 12px;


}

.select2-dropdown {
    border: 1px solid $border-color;
    box-shadow: $box-shadow;
    background-color: $white;
    z-index: 1056;
}


.select2-results__options {
    scrollbar-width: thin;
}


.select2-container--default {
    .select2-results__option--selected {
        background-color: $light;
    }

    .select2-search--dropdown {
        padding: 10px;
        background-color: $white;

        .select2-search__field {
            outline: none;
            border: 1px solid $border-color;
            background-color: $white;
            color: $body-color;
            border-radius: 5px;
        }
    }

    .select2-results__option--highlighted[aria-selected] {
        background-color: $primary;
    }

    .select2-results__option[aria-selected="true"] {
        background-color: $white;
        color: $body-color;

        &:hover {
            background-color: $primary;
            color: $white;
        }
    }

    .select2-selection--multiple {
        .select2-selection__choice__display {
            padding-left: 28px;
            padding-right: 5px;
        }
    }

    .select2-selection--single {
        .select2-selection__arrow {
            border-radius: 4px;
            cursor: text;
            /*rtl:ignore*/
            right: 1px;
            /*rtl:ignore*/
            left: auto;
        }
    }
}

.select2-container {
    .select2-selection--multiple {
        min-height: 38px;
        border: 1px solid $border-color !important;
        background-color: $white;

        .select2-selection__rendered {
            padding: 1px 12px;
        }

        .select2-search__field {
            border: 0;
            color: $body-color;
        }

        .select2-selection__choice {
            background-color: $light;
            border: none;
            color: $white;
            border-radius: 3px;
            padding: 0px 7px 0 0;
            margin-top: 6px;
        }

        .select2-selection__choice__remove {
            color: $white;
            margin-right: 7px;
            border-color: $light;
            padding: 0 8px;

            // position: relative;
            &:hover {
                color: $white;
                background-color: $primary;
            }
        }
    }

    .select2-search--inline {
        .select2-search__field {
            margin-top: 7px;
            font-family: $font-family-base;
        }
    }

    .select2-search {
        textarea {
            &::placeholder {
                color: $gray-400;
            }
        }
    }
}

[dir="rtl"] {
    .select2-container {
        .select2-selection--multiple {
            .select2-selection__choice {
                padding: 0 0 0 7px;
            }
        }
    }
}
.select2-container--default {
  .select2-selection--multiple {
    padding-bottom: 4px;
    margin-top: 4px;

    .select2-selection__choice {
      background: $light !important;
      color: $gray-500 !important;
      border-color: $gray-100 !important;

      .select2-selection__choice__remove {
        background: $light !important;
        color: $gray-500 !important;
        border-color: $light !important;
        right: 0;
        left: unset;
        top: 0;
        margin: 0;
        padding-left: 0 !important;
      }

      .select2-selection__choice__display {
        padding-right: 16px;
        padding-left: 5px;
        font-size: 12px;
      }
    }
  }
}

.select2-container {
  .select2-selection--multiple {
    .select2-selection__rendered {
      display: inline;
      list-style: none;
      padding: 0;
    }
  }
}

.choices__list--multiple {
  .choices__item {
    vertical-align: initial;
    border-radius: 7px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 400;
    margin: 2px 5px 2px 0;
    background-color: $primary;
    border: 1px solid $primary;
    color: #fff;
    box-shadow: $box-shadow;
  }
}

.is-disabled {
  .choices__list--multiple {
    .choices__item {
      background-color: #00D3C7;
      border: 1px solid #00D3C7;
    }
  }
}
.choices[data-type*=select-one] .choices__inner {
    padding: 0.65rem 2rem 0.65rem 0.77rem !important;
    line-height: 1;
}