/*
 * WihdaTec Pro – Ajustements : flèche contrastée à l'intérieur du menu Lieu
 * sur l'accueil et du menu Trier par sur la page des résultats.
 * Modification : 2026-10-11_15-22-57 (heure de Montréal) – Version 1.0.11.
 * Aucun effet sur le choix des valeurs ou les autres menus déroulants.
 */

/* Select2 : réserver la place de la flèche sans déplacer le contenu hors du cadre. */
.wih-fleche-cible.select2-container .select2-selection--single {
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-right: 38px !important;
    overflow: hidden !important;
}
.wih-fleche-cible.select2-container .select2-selection--single .select2-selection__rendered {
    display: block !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-right: 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
.wih-fleche-cible.select2-container .select2-selection--single .select2-selection__arrow {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 5px !important;
    left: auto !important;
    width: 30px !important;
    height: 100% !important;
    margin: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: none !important;
}
.wih-fleche-cible.select2-container .select2-selection--single .select2-selection__arrow b {
    display: none !important;
}
.wih-fleche-cible.select2-container .select2-selection--single .select2-selection__arrow::after {
    content: '' !important;
    position: absolute !important;
    top: calc(50% - 4px) !important;
    left: calc(50% - 5px) !important;
    width: 10px !important;
    height: 10px !important;
    border: solid var(--wih-arrow-color, #044353) !important;
    border-width: 0 2.5px 2.5px 0 !important;
    border-radius: 1px !important;
    transform: rotate(45deg) !important;
    opacity: 1 !important;
}
.wih-fleche-cible.select2-container--open .select2-selection--single .select2-selection__arrow::after {
    top: calc(50% - 1px) !important;
    transform: rotate(225deg) !important;
}

/* Bootstrap Select : la flèche utilise la même couleur et reste dans le bouton. */
.wih-fleche-cible.bootstrap-select > .dropdown-toggle {
    position: relative !important;
    padding-right: 42px !important;
    box-sizing: border-box !important;
}
.wih-fleche-cible.bootstrap-select > .dropdown-toggle .caret,
.wih-fleche-cible.bootstrap-select > .dropdown-toggle .bs-caret { display: none !important; }
.wih-fleche-cible.bootstrap-select > .dropdown-toggle::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: calc(50% - 5px) !important;
    right: 15px !important;
    left: auto !important;
    width: 10px !important;
    height: 10px !important;
    border: solid var(--wih-arrow-color, #044353) !important;
    border-width: 0 2.5px 2.5px 0 !important;
    transform: rotate(45deg) !important;
    pointer-events: none !important;
}

/* Listes natives (si Select2 n'est pas utilisé). */
.wih-fleche-native-wrapper {
    position: relative !important;
}
.wih-fleche-native-wrapper > select.wih-fleche-native:not(.select2-hidden-accessible) {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding-right: 42px !important;
    box-sizing: border-box !important;
}
.wih-fleche-native-wrapper::after {
    content: '' !important;
    position: absolute !important;
    top: calc(50% - 5px) !important;
    right: 15px !important;
    left: auto !important;
    width: 10px !important;
    height: 10px !important;
    border: solid var(--wih-arrow-color, #044353) !important;
    border-width: 0 2.5px 2.5px 0 !important;
    transform: rotate(45deg) !important;
    pointer-events: none !important;
}
/* Une liste devenue Select2 n'affiche pas de seconde flèche native. */
.wih-fleche-native-wrapper:has(> select.select2-hidden-accessible)::after {display:none!important;}

@media (max-width: 767px) {
    .wih-fleche-cible.select2-container,
    .wih-fleche-cible.bootstrap-select {max-width:100%!important;box-sizing:border-box!important;}
    .wih-fleche-cible.select2-container .select2-selection--single .select2-selection__arrow::after,
    .wih-fleche-cible.bootstrap-select > .dropdown-toggle::after,
    .wih-fleche-native-wrapper::after {
        border-color: var(--wih-mobile-arrow-color, #044353) !important;
    }
}
/* Dans la version arabe RTL, conserver la flèche dans le bord gauche du champ. */
html[dir='rtl'] .wih-fleche-cible.select2-container .select2-selection--single {padding-left:38px!important;padding-right:8px!important;}
html[dir='rtl'] .wih-fleche-cible.select2-container .select2-selection--single .select2-selection__arrow {left:5px!important;right:auto!important;}
html[dir='rtl'] .wih-fleche-cible.bootstrap-select > .dropdown-toggle {padding-left:42px!important;padding-right:12px!important;}
html[dir='rtl'] .wih-fleche-cible.bootstrap-select > .dropdown-toggle::after,
html[dir='rtl'] .wih-fleche-native-wrapper::after {left:15px!important;right:auto!important;}
