/**
 * Global Select2 optional clear (×): right side, large tap target, separate from “open dropdown”.
 * Load after select2.min.css (included on pages that use Select2).
 */

.select2-selection {
    overflow: visible;
}

.select2-selection--single {
    display: flex !important;
    align-items: stretch;
    padding-right: 0;
}

.select2-selection--single .select2-selection__rendered {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.35rem;
    order: 1;
}

.select2-selection--single .select2-selection__arrow {
    flex: 0 0 auto;
    position: relative;
    height: auto;
    top: auto;
    width: 1.75rem;
    order: 2;
}

/* × on the far right (after chevron) */
.select2-selection--single .select2-selection__clear {
    order: 3;
    border-left: 1px solid var(--bs-border-color, #dee2e6);
    border-right: none;
}

.select2-selection__clear {
    float: none !important;
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-width: 3rem;
    margin: 0 !important;
    padding: 0 0.55rem;
    cursor: pointer;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 800;
    font-size: 1.625rem;
    line-height: 1;
    color: #212529;
    -webkit-font-smoothing: antialiased;
    border-left: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-light, #f8f9fa);
    box-sizing: border-box;
}

.select2-selection--multiple {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
}

.select2-selection--multiple .select2-selection__clear {
    float: none !important;
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    margin: 0.2rem 0 0.2rem auto !important;
    padding: 0.3rem 0.5rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.625rem;
    font-weight: 800;
    color: #212529;
    -webkit-font-smoothing: antialiased;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.25rem;
    background-color: var(--bs-light, #f8f9fa);
    box-sizing: border-box;
    order: 99;
}
