.select2-container .select2-selection--multiple .select2-selection__rendered,
.select2-container.-acf .select2-selection--multiple .select2-selection__rendered {
    padding: 0.5em 2.5em 0.5em 0.5em;
    font-size: var(--theme--font-size--small);
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    position: relative;
}

.select2-container .select2-selection--multiple .select2-selection__rendered li {
    padding: 0.5em 0 0.5em 0.5em;
    margin: 0;
    border: 0;
    float: none;
}

.select2-container .select2-selection--multiple .select2-selection__choice,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    gap: 0.5em;
    align-items: center;
    border-radius: var(--theme--form--border-radius);
    background: none;
    color: var(--theme--color--text);
}

.select2-container .select2-selection--multiple .select2-selection__choice::after,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice::after {
    order: 3;
    content: ',';
    margin-left: -0.4em;
}

.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    order: 2;
    margin: 0;
    padding: 0;
    border: 0;
    float: none;
    font-size: 0;
    line-height: var(--theme--font-size--normal);
    display: flex;
}

.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove::after,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove::after {
    content: '\f00d';
    color: var(--theme--color--text);
    font-family: var(--theme--font-family--font-awesome);
    font-weight: 300;
    font-size: var(--theme--font-size--normal);
    opacity: 0.66;
}

.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover::after,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover::after {
    opacity: 1;
}

.select2-container.-acf .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover + .acf-selection {
    text-decoration: line-through;
}

.select2-container.-acf .select2-selection--multiple .select2-selection__choice .acf-selection {
    cursor: move;
}

.select2-container .select2-search--inline .select2-search__field {
    margin: 0;
}

.select2-container .select2-selection--multiple .select2-selection__clear {
    order: 2;
    padding: 0;
    margin: 0;
    border: 0;
    float: none;
    position: absolute;
    top: 50%;
    z-index: 1;
    right: 12px;
    font-size: 0;
    line-height: var(--theme--font-size--normal);
    display: flex;
    transform: translate(0, -50%);
}

.select2-container .select2-selection--multiple .select2-selection__clear::after {
    content: '\f00d';
    color: var(--theme--color--text);
    font-family: var(--theme--font-family--font-awesome);
    font-weight: 300;
    font-size: var(--theme--font-size--medium);
}

.select2-container .select2-selection--multiple .select2-selection__choice.ui-sortable-helper,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper {
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--theme--color--text);
}

.select2-container .select2-selection--multiple .select2-selection__choice.ui-sortable-helper::after,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper::after {
    content: none;
}

.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper .acf-selection {
    visibility: visible;
    color: var(--theme--color--text);
}

.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper .select2-selection__choice__remove {
    visibility: visible;
}

.select2-container .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder {
    border: 0;
    margin-left: 0.5em;
    height: 1.6em;
    margin-top: 0.5em;
    background: var(--theme--form--border-color);
}

.select2-container .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder::after,
.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder::after {
    content: none;
}

/* selection multiple is-style-fill */
.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__rendered {
    gap: 0.5em;
}

.acf-field.is-style-fill .select2-container .select2-selection--multiple .select2-selection__rendered li:not(:first-child, .select2-selection__choice) {
    padding: 0.5em 0;
}

.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice {
    padding: 0.5em 0.5em 0.5em 0.5em;
    background: var(--theme--color--primary);
    color: var(--theme--color--background);
}

.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice::after {
    content: none;
}

.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove::after {
    color: var(--theme--color--background);
}

.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper {
    background: var(--theme--color--primary);
    color: var(--theme--color--background);
}

.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper .acf-selection {
    color: var(--theme--color--background);
}

.acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder {
    margin-left: 0;
    height: auto;
    margin-top: 0;
    background: var(--theme--form--border-color);
}

@media (max-width: 767.98px) {
    /* selection multiple */
    .select2-container .select2-selection--multiple .select2-selection__rendered,
    .select2-container.-acf .select2-selection--multiple .select2-selection__rendered {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    select[data-allow_null='0'] + .select2-container.-acf .select2-selection--multiple .select2-selection__rendered {
        padding-right: 0.5em;
    }

    .select2-container .select2-selection--multiple .select2-selection__rendered li {
        padding: 0.5em 0.5em;
    }

    .select2-container.-acf .select2-selection--multiple .select2-selection__choice::after {
        content: none;
    }

    /* selection multiple is-style-fill */
    .acf-field.is-style-fill .select2-container .select2-selection--multiple .select2-selection__rendered li {
        width: 100%;
    }

    .acf-field.is-style-fill .select2-container.-acf .select2-selection--multiple .select2-selection__choice {
        width: 100%;
        justify-content: space-between;
    }
}
