.elementor-widget-ectf_loop_grid_taxonomy_filter {
    position: relative;
}

.ectf-taxonomy-filter-container {
    display: flex;
    flex-direction: inherit;
    gap: 10px;
}

.ectf-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Alignement avec les classes Elementor Pro */
.ectf-direction-vertical .ectf-taxonomy-filter-container {
    flex-direction: column;
}

.ectf-direction-vertical .ectf-filter {
    flex-direction: column;
}

.ectf-filter-item {
    cursor: pointer;
    border: 1px solid #ccc;
    background: #fff;
    padding: 8px 15px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.ectf-filter-item.is-active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.ectf-filter-item:hover {
    background: #f0f0f0;
}

/* Style spécifique inspiré de l'exemple utilisateur */
.ectf-filter-select,
.ectf-select2 + .select2-container .select2-selection--single,
.ectf-select2 + .select2-container .select2-selection--multiple {
    background-color: #ffcd00 !important;
    color: #000 !important;
    border: 0 !important;
    border-radius: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('https://reseau535.fr/wp-content/themes/blocksy-child/images/R535_Picto_F_Bas.svg') !important;
    background-repeat: no-repeat !important;
    background-position: center right 10px !important;
    background-size: 30px !important;
    padding-right: 40px !important;
}

/* Forcer l'affichage de l'icône sur le conteneur Select2 car le select natif est masqué */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-image: url('https://reseau535.fr/wp-content/themes/blocksy-child/images/R535_Picto_F_Bas.svg') !important;
    background-repeat: no-repeat !important;
    background-position: center right 10px !important;
    background-size: 30px !important;
}

/* Forcer le texte noir pour Select2 (simple et multiple) */
.ectf-select2 + .select2-container--default .select2-selection--single .select2-selection__rendered,
.ectf-select2 + .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.ectf-select2 + .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    color: #000 !important;
}

.ectf-filter-select {
    width: 100%;
    padding: 8px 15px;
    height: 48px;
}

/* Ajustements pour Select2 Single */
.ectf-select2 + .select2-container--default .select2-selection--single {
    height: 48px;
    display: flex;
    align-items: center;
}

.ectf-select2 + .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #000 !important;
    padding-left: 15px;
    line-height: 48px;
}

.ectf-select2 + .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important; /* On utilise l'image de fond du parent */
}

/* Ajustements pour Select2 Multiple */
.ectf-select2 + .select2-container--default .select2-selection--multiple {
    min-height: 48px !important;
    padding: 5px 40px 5px 5px !important; /* Espace pour la flèche à droite */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    height: auto !important; /* On laisse grandir en hauteur */
}

.ectf-select2 + .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ectf-select2 + .select2-container .select2-selection__choice {
    background-color: #000 !important;
    border: 1px solid #000 !important;
    color: #fff !important;
    border-radius: 0px !important;
    padding: 0 6px !important;
    margin: 1px 5px 1px 0 !important; /* Marge pour l'espacement entre les choix */
    display: flex;
    align-items: center;
    font-size: 14px;
    height: 32px !important;
    line-height: 32px !important;
    width: fit-content !important;
    max-width: 100% !important;
}

.ectf-select2 + .select2-container .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px !important;
    border-right: 1px solid rgba(255,255,255,0.2);
    padding-right: 3px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.ectf-select2 + .select2-container .select2-search--inline {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
}

.ectf-select2 + .select2-container .select2-search__field {
    background: transparent !important;
    margin: 0 !important;
    height: 100% !important;
    line-height: 48px !important;
}

/* Dropdown styling */
.elementor-widget-ectf_loop_grid_taxonomy_filter .select2-container--default .select2-dropdown {
    border: 1px solid #ffcd00 !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 999999;
}

/* Forcer l'alignement immédiat sous le champ */
.elementor-widget-ectf_loop_grid_taxonomy_filter .select2-container--open .select2-dropdown--below {
    margin-top: 0 !important;
    top: 100% !important;
    left: 0 !important;
    position: absolute !important;
}

.select2-container--open .select2-dropdown--above {
    margin-bottom: -1px !important;
}

/* S'assurer que le container de sélection ne déborde pas */
.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 !important;
    border-bottom-right-radius: 0 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #ffcd00 !important;
    color: #000 !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #eee;
}

/* Header with Title and Clear Button */
.ectf-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ectf-filters-title {
    margin: 0;
    font-size: 33px;
    font-weight: bold;
}

.ectf-clear-all-button {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 18px;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ectf-clear-all-button:after {
    content: " ";
    margin-left: 8px;
    padding-right: 40px;
    background-image: url(./images/R535_Picto_Croix.svg);
    background-repeat: no-repeat;
    background-position: center right;
    background-size: 48px;
}

.ectf-clear-all-button:hover {
    color: #000;
}

.ectf-clear-all-button i {
    font-size: 14px;
}
