/**************/
/** Select 2 **/
/**************/

.select2-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    min-width: 300px;
    max-width: 100%;
    outline: none;
    font-family: var(--app-font-family);
}
.select2-container--default .select2-selection--single {
    height: var(--app-input-height);
    background: var(--Background-Secondary);
    outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
    height: var(--app-input-height);
    line-height: var(--app-input-height);
    color: var(--app-color-dark);
    font-size: var(--app-font-size);
    padding-left: 16px;
    padding-right: 30px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    line-height: 20px;
    box-shadow: none;
}
.select2-container--default .select2-search--inline .select2-search__field {
    font-family: var(--app-font-family);
    font-style: normal;
    font-weight: var(--app-font-weight);
    font-size: var(--app-font-size) !important;
    line-height: var(--app-font-size);
    color: var(--app-input-placeholder);
    padding-left: 8px;
    margin-top: 0;
}
.input-group .select2-container--default .select2-selection--single {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    background: none;
    border: none;
    border-radius: 0 !important;
    color: var(--app-color-dark);
    height: calc(var(--app-input-height) - 2px);
    line-height: var(--app-input-height);
    padding: 0 0 0 39px;
    outline: none;
}
.select2-container--default .select2-results>.select2-results__options {
    border: none;
    box-shadow: none;
    padding: 8px 6px;
}
.select2-results__option {
    font-size: 14px;
    font-weight: 300;
    color: var(--app-color-dark);
    padding: var(--app-dropdown-item-padding) !important;
    background-color: #FFFFFF;
    border-radius: 8px;
}

.select2-container--default .select2-results__option[role="group"] {
    padding: 8px 16px !important;
}

.select2-container--default .select2-results__group {
    color: var(--app-color-dark);
    font-weight: 600;
}

.select2-container--default .select2-results__option[role="group"] ~ li:not(.select2-results__option[role="group"]) {
    padding-left: 32px !important;
}

.select2-container--open .select2-dropdown--below {
    border: none;
}
.select2-container--open .select2-dropdown--above {
    border: none;
}
.dropdown-menu .select2-container--open .select2-dropdown--below{
    width: calc(100% + 4px)!important;
    margin-left: -2px;
    border-radius: var(--app-input-radius);
}
.select2-container--open .select2-dropdown--below .select2-results__options {
    border-radius: 0 0 var(--app-input-radius) var(--app-input-radius);
}
.dropdown-menu:not(.filters-inputs) .select2-container{
    top:0px!important;
}

/* --- Selects ouverts -------------------------------------------------------
   Deux comportements bien distincts, à ne pas mélanger :

   · Simple : la boîte de recherche vient se poser PAR-DESSUS le champ. Comme
     elle ne le recouvre pas au pixel près, le champ dépassait de un à trois
     pixels — sa bordure d'abord, puis son fond blanc, qui dessinaient deux
     petits coins sur le beige de la page. On efface donc le champ entièrement
     (bordure, fond, ombre) le temps de l'ouverture : il ne reste que la boîte
     de recherche, aucun coin ne peut réapparaître.

   · Multiple : il n'y a pas de boîte de recherche (elle est dans le champ) et
     la liste s'ouvre en dessous. Le champ reste donc visible et garde sa
     bordure complète — la lui couper en bas laissait deux angles pointus. */
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: transparent !important;
    background: transparent;
    box-shadow: none;
}

/* select2 coupe lui-même les coins du champ ouvert, avec un sélecteur à quatre
   classes (…--open.--below .select2-selection--multiple) : il faut le reprendre
   à l'identique pour rendre au champ son rayon et sa bordure du bas. */
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,
.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
    border: var(--app-input-border) !important;
    border-color: var(--common-primary-brand-navy-blue-100, #1E1E23) !important;
    border-radius: var(--app-input-radius) !important;
}

select[data-rel="select2"] {
    padding: 14px 12px;
    -webkit-box-shadow: none;
    box-shadow: none;
    border: var(--app-input-border);
    height: 50px;
    font-size: 16px;
    min-width: 300px;
}

.select2-dropdown {
    z-index:10010;
}

.select2-container--default .select2-selection--single {
    background: var(--Background-Secondary);
    border: var(--app-input-border);
    border-radius: var(--app-input-radius);
    box-shadow: var(--app-input-shadow);
    height: var(--app-input-height);
}
.select2-container:hover .select2-selection--single {
    border-color: var(--common-primary-brand-navy-blue-100, #1E1E23);
}

.select2-search--dropdown {
    color: var(--app-color-dark);
    padding: 0!important;
    box-shadow: none;
    border-radius: var(--app-input-radius);
    border: 0.6px solid var(--common-primary-brand-navy-blue-100, #1E1E23);
    background: #FFFFFF;
}

.select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: #A0A5AB;
}

.select2-container--default .select2-search--dropdown:before {
    color: var(--app-color-grey-medium);
    content: "\f002";
    font-family: FontAwesome, sans-serif;
    font-size: 13px;
    left: 14px;
    position: absolute;
    top: 18px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: var(--app-input-height);
    width: 16px;
}

/* Chevron = icône Font Awesome Light (et non un carré CSS pivoté), ferrée à droite.
   select2 positionne ce <b> en absolu dans une boîte de 0×0 (top/left 50 %) : il faut
   le remettre dans le flux, sinon le glyphe déborde de son point d'ancrage et se
   retrouve décalé vers le bas et la gauche du champ. */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    position: static;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    border: none;
    display: inline-block;
    padding: 0;
    margin: 0;
    transform: none;
    -webkit-transform: none;
    font-family: "Font Awesome 6 Pro";
    font-weight: 300;
    font-size: 16px;
    line-height: 1;
    color: var(--app-color-dark);
}
.select2-container--default .select2-selection--single .select2-selection__arrow b:before {
    content: "\f078"; /* chevron-down */
}
/* Ouvert : le chevron se retourne */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(180deg);
}

.select2-container--open .select2-dropdown {
    border: none;
    border-radius: var(--app-input-radius);
    background-color: transparent;
    box-shadow: none;
}

.select2-container--open .select2-dropdown--below {
    margin-top: -53px;
}
/*.modal .select2-container--open .select2-dropdown--below {
    margin-top: 0;
}*/

.select2-container--open .select2-dropdown--above {
    margin-top: 53px;
}
.modal .select2-container--open .select2-dropdown--above {
    margin-top: 0;
}

.select2-container--open .select2-dropdown--above .select2-search {
    bottom: 0;
    position: absolute;
    width: 100%;
}

.select2-container--open .select2-results {
    border-radius: 16px;
    background: var(--Background-Secondary, #FFF);
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.08);
}
.select2-container--open .select2-dropdown--above .select2-results {
    padding-bottom: 53px;
}
.select2-container--open .select2-dropdown--above .select2-results__options {
    border-radius: 0;
    box-shadow: none;
}
/* (l'ancien chevron « carré CSS pivoté » de l'état ouvert est remplacé plus haut
   par l'icône Font Awesome, qui se contente de se retourner) */

.select2-results__option img,
.select2-container--default .select2-selection--single .select2-selection__rendered img {
    max-height: 20px;
    margin-right: 8px;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background: #FFFFFF;
    color: var(--app-color-dark);
    font-weight: 700;
}
.select2-container--default .select2-results__option--highlighted[aria-selected]{
    background: var(--Background-Primary, #F9F5F1);
    color: var(--app-color-dark);
}
.select2-container--default .select2-selection--multiple {
    background: var(--Background-Secondary);
    border: var(--app-input-border) !important;
    border-radius: var(--app-input-radius);
    box-shadow: var(--app-input-shadow) !important;
    min-height: var(--app-input-height);
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: var(--app-input-height);
    padding: 2px 16px;
}
.select2-container--default .select2-selection--multiple ul.select2-selection__rendered li.select2-selection__choice {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 8px;
    margin: 4px !important;
    padding: 6px 8px!important;
    font-size: 12px!important;
    line-height: 14px!important;
    color: white;
    background: var(--common-primary-brand-cobalt-blue-100, #385FEB) !important;
    border: none!important;
    border-radius: 8px!important;
    white-space: normal;
    font-weight: 500;
}
.select2-container--default .select2-selection--multiple ul.select2-selection__rendered li.select2-selection__choice:hover {
    cursor: pointer;
    border: none !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    font-size: 20px;
    color: white;
    line-height: 12px;
    font-weight: normal;
    margin-right: 0;
    margin-top: -1px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: white;
}

.input-small + .select2.select2-container {
    min-width: 90px;
    max-width: 90px;
}
.input-xlarge + .select2.select2-container {
    min-width: 240px;
    max-width: 240px;
}

.input-xlarge-icon-select + .select2.select2-container {
    min-width: 280px;
    max-width: 280px;
}

select[data-rel="select2"].input-small {
    min-width: 90px;
}

@media (max-width: 768px) {
    .select2-container {
        width: auto;
        max-width: 100%;
    }
}

.select2-container--default.select2-container--disabled .select2-selection--single {
    background: var(--app-input-disabled-bg);
    border: none;
    cursor: not-allowed;
}
