@layer select2 {
    .select2-container {
        width: 320px !important;
        max-width: 100%;
        min-height: var(--ui-field-size);
        box-sizing: border-box;
        display: inline-block;
        margin: 0;
        position: relative;
        vertical-align: middle;
    }

    .select2-container .select2-selection--single {
        width: 100%;
        height: var(--ui-field-size);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        box-sizing: border-box;
        padding: 0 11px;
        padding-right: calc(var(--ui-field-size) - 5px) !important;
        font: 400 14px var(--ui-font-family-primary, var(--ui-font-family-helvetica));
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        position: relative;
        vertical-align: middle;
        border: 1px solid rgb(var(--ui-field-color-border-default));
        border-radius: var(--ui-border-radius-2xs);
        color: var(--ui-color-palette-black-base);
        background-color: var(--ui-color-palette-white-base);
        transition: border .3s ease, background-color .3s ease, color .3s ease, padding .3s ease;
    }

    .select2-container .select2-selection--single .select2-selection__rendered {
        display: block;
        padding: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
        padding-right: 8px;
        padding-left: 20px;
    }

    .select2-container .select2-selection--multiple {
        box-sizing: border-box;
        cursor: pointer;
        display: block;
        min-height: 38px;
        user-select: none;
        -webkit-user-select: none;
    }

    .select2-container .select2-selection--multiple .select2-selection__rendered {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        height: auto;
        min-height: 38px;
        padding: 3px 50px 3px 3px;
        color: #535c69;
        box-sizing: border-box;
        background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNSIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI1IDE2Ij4gIDxwb2x5Z29uIGZpbGw9IiM1MzVDNjkiIGZpbGwtcnVsZT0iZXZlbm9kZCIgcG9pbnRzPSIzLjU0NiA3LjQyNSAzLjU0NiAxLjYwNyAxLjYwNyAxLjYwNyAxLjYwNyA4LjM5NCAxLjYwNyA5LjM2NCA5LjM2NCA5LjM2NCA5LjM2NCA3LjQyNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTQ1IDkuOSAxLjY1NykiLz48L3N2Zz4=');
        background-repeat: no-repeat;
        background-position: right center;
    }

    .select2-container .select2-search--inline .select2-search__field {
        box-sizing: border-box;
        border: none;
        font-size: 100%;
        margin-top: 5px;
        margin-left: 5px;
        padding: 0;
        max-width: 100%;
        resize: none;
        height: 18px;
        vertical-align: bottom;
        font-family: sans-serif;
        overflow: hidden;
        word-break: keep-all; }

    .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
        -webkit-appearance: none;
    }

    .select2-dropdown {
        background-color: white;
        border-radius: var(--popup-window-border-radius);
        box-sizing: border-box;
        margin: 1px 0 0 0;
        padding: 6px;
        box-shadow: 0 6px 21px 0 rgba(0,0,0,0.15);
        display: block;
        position: absolute;
        left: -100000px;
        font: 13px var(--ui-font-family-primary, var(--ui-font-family-helvetica));
        width: 100%;
        z-index: 1051;
    }

    .select2-results {
        display: block;
    }

    .select2-results__options {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .select2-results__option {
        width: 100%;
        height: 36px;
        padding: 0 15px;
        display: flex;
        align-items: center;
        cursor: pointer;
        position: relative;
        text-decoration: none;
        -o-text-overflow: ellipsis;
        text-overflow: ellipsis;
        overflow: hidden;
        box-sizing: border-box;
        outline: none;
        white-space: nowrap;
        background-color: transparent;
    }

    .select2-results__option:hover {
        background-color: #f5f5f6;
    }

    .select2-results__option--selectable {
        cursor: pointer;
    }

    .select2-results__message {
        height: auto;
        white-space: normal;
    }

    .select2-container--open .select2-dropdown {
        left: 0;
    }

    .select2-search--dropdown {
        display: block;
        padding: 6px;
    }

    .select2-search--dropdown .select2-search__field {
        width: 100%;
        height: var(--ui-field-size);
        margin: 0;
        padding: 0 11px;
        box-sizing: border-box;
        display: block;
        overflow: hidden;
        outline: 0;
        border: 1px solid rgb(var(--ui-field-color-border-default));
        font: 400 14px var(--ui-font-family-primary,var(--ui-font-family-helvetica));
        border-radius: var(--ui-border-radius-2xs);
        vertical-align: middle;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
        transition: border .3s ease, background-color .3s ease, color .3s ease;
        z-index: 1;
        color: var(--ui-color-palette-black-base);
        background-color: var(--ui-color-palette-white-base);
    }

    .select2-search--dropdown .select2-search__field:hover {
        color: #535c69;
        border-color: var(--ui-field-color-primary);
    }

    .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
        -webkit-appearance: none;
    }

    .select2-search--dropdown.select2-search--hide {
        display: none;
    }

    .select2-close-mask {
        border: 0;
        margin: 0;
        padding: 0;
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        min-height: 100%;
        min-width: 100%;
        height: auto;
        width: auto;
        opacity: 0;
        z-index: 99;
        background-color: #fff;
        filter: alpha(opacity=0);
    }

    .select2-hidden-accessible {
        border: 0 !important;
        clip: rect(0 0 0 0) !important;
        -webkit-clip-path: inset(50%) !important;
        clip-path: inset(50%) !important;
        height: 1px !important;
        overflow: hidden !important;
        padding: 0 !important;
        position: absolute !important;
        width: 1px !important;
        white-space: nowrap !important;
    }

    .select2-container--default .select2-selection--single {
        background-color: var(--ui-color-palette-white-base);
        border: 1px solid rgb(var(--ui-field-color-border-default));
        border-radius: var(--ui-border-radius-2xs);
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: #535c69;
        line-height: 38px;
    }

    .select2-container--default .select2-selection--single .select2-selection__clear,
    .select2-container--default .select2-selection--multiple .select2-selection__clear {
        width: 18px;
        height: 18px;
        display: inline-block;
        margin-right: 20px;
        padding-right: 0;
        float: right;
        cursor: pointer;
        font-weight: bold;
        font-size: 0;
        position: absolute;
        right: 34px;
        background: url('/bitrix/js/main/core/images/ui/main-ui-control.svg') 0 -312px no-repeat;
        transition: opacity .3s;
        opacity: 0;
        top: 50%;
        transform: translate(0,-50%);
    }

    .select2-container--default .select2-selection--single:hover .select2-selection__clear,
    .select2-container--default .select2-selection--multiple:hover .select2-selection__clear,
    .select2-container--default .select2-selection--single:focus-visible .select2-selection__clear,
    .select2-container--default .select2-selection--multiple:focus-visible .select2-selection__clear {
        opacity: 1;
    }

    .select2-container--default .select2-selection--single .select2-selection__placeholder,
    .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
        color: #535c69;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        position: absolute;
        top: 1px;
        right: -2px;
        z-index: 10;
        display: flex;
        border: none;
        background-color: var(--ui-color-background-transparent);
        width: var(--ui-field-size);
        height: calc(var(--ui-field-size) - 2px);
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow b {
        width: 100%;
        height: 100%;
        background-image: url("data:image/svg+xml,%3Csvg width='26' height='26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23828B95'%3E%3Cpath d='M7.071 10.858l1.414-1.414 5.657 5.656-1.414 1.414z'/%3E%3Cpath d='M16.97 9.444l1.415 1.414-5.657 5.657-1.414-1.415z'/%3E%3C/g%3E%3C/svg%3E");
        background-position: center;
        background-size: 26px auto;
        background-repeat: no-repeat;
        pointer-events: none;
        transition: transform 0.150s ease-in-out;
    }

    .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
        float: left; }

    .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
        left: 1px;
        right: auto; }

    .select2-container--default.select2-container--disabled .select2-selection--single {
        background-color: #eee;
        cursor: default; }
    .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
        display: none; }

    .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
        border-color: transparent transparent #888 transparent;
        border-width: 0 4px 5px 4px; }

    .select2-container--default .select2-selection--multiple {
        background-color: white;
        border: 1px solid #aaa;
        border-radius: 4px;
        cursor: text;
        position: relative;
    }

    .select2-container--default .select2-selection--multiple.select2-selection--clearable {
        padding-right: 25px; }

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        position: relative;
        display: inline-block;
        float: left;
        box-sizing: border-box;
        padding: 0 30px 0 13px;
        margin: 0 3px 3px 0;
        height: 30px;
        border-radius: 2px;
        background: #bcedfc;
        font: 15px/30px var(--ui-font-family-primary, var(--ui-font-family-helvetica));
        vertical-align: middle;
        -webkit-transition: background 0.2s linear;
        transition: background 0.2s linear;
        z-index: 2;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
        cursor: default;
        padding-left: 2px;
        padding-right: 5px;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
        position: absolute;
        right: 0;
        top: 0;
        width: 20px;
        height: 100%;
        font-size: 0;
        -webkit-transition: opacity .3s ease;
        transition: opacity .3s ease;
        opacity: .3;
        cursor: pointer;
        background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2210%22%20height%3D%2210%22%20viewBox%3D%220%200%2010%2010%22%3E%3Cpath%20fill%3D%22%23535C69%22%20fill-rule%3D%22evenodd%22%20d%3D%22M5.065%203.682L2.377.994%201.01%202.362%203.696%205.05.99%207.757l1.368%201.37%202.708-2.71%202.7%202.703%201.37-1.368-2.702-2.7%202.682-2.684L7.748%201%205.065%203.682z%22/%3E%3C/svg%3E');
        background-repeat: no-repeat;
        background-position: center;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
        opacity: 1;
    }

    .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
        margin-left: 5px;
        margin-right: auto; }

    .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__display {
        padding-left: 5px;
        padding-right: 2px; }

    .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
        border-left: 1px solid #aaa;
        border-right: none;
        border-radius: 0 4px 4px 0;
    }

    .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__clear {
        float: left;
        margin-left: 10px;
        margin-right: auto; }

    .select2-container--default.select2-container--focus .select2-selection--multiple {
        border: 1px solid var(--ui-field-color-primary);
        outline: 0;
    }

    .select2-container--default.select2-container--disabled .select2-selection--multiple {
        background-color: #eee;
        cursor: default; }

    .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
        display: none; }

    .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
        border-top-left-radius: 0;
        border-top-right-radius: 0; }

    .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0; }

    .select2-container--default .select2-search--inline .select2-search__field {
        background: transparent;
        border: none;
        outline: 0;
        box-shadow: none;
        -webkit-appearance: textfield; }

    .select2-container--default .select2-results > .select2-results__options {
        max-height: 177px;
        overflow-y: auto;
    }

    .select2-container--default .select2-results__option .select2-results__option {
        padding-left: 1em; }
    .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
        padding-left: 0; }
    .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
        margin-left: -1em;
        padding-left: 2em; }
    .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
        margin-left: -2em;
        padding-left: 3em; }
    .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
        margin-left: -3em;
        padding-left: 4em; }
    .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
        margin-left: -4em;
        padding-left: 5em; }
    .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
        margin-left: -5em;
        padding-left: 6em; }

    .select2-container--default .select2-results__option--group {
        padding: 0; }

    .select2-container--default .select2-results__option--disabled {
        color: #999; }

    .select2-container--default .select2-results__option--selected {
        background-color: #ddd;
    }

    .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
        background-color: #5897fb;
        color: white;
    }

    .select2-container--default .select2-results__group {
        cursor: default;
        display: block;
        padding: 6px;
    }
}
