/* ==================================================
   I. RESPONSIVITÉ & BREAKPOINTS (FUSIONNÉS)
   ================================================== */
@media (max-width: 768px) {
    .tbg-hide-on-mobile {
        display: none !important;
    }

    .alignwide .is-content-justification-space-between {
        justify-content: end;
    }
}

@media (min-width: 769px) {
    .tbg-mobile-filter {
        display: none !important;
    }
}

/* ==================================================
   II. STYLES DES SELECTS DÉROULANTS DESKTOP
   ================================================== */
#annees,
#langue {
    position: relative;
    z-index: 100;
}

.custom-select {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 180px;
    font-family: inherit;
    cursor: pointer;
    margin-right: 15px;
    z-index: 101;
}

/* Protection d'empilement quand le menu est ouvert */
.custom-select.open {
    z-index: 9999 !important;
}

/* BORDURE AUTOUR DU CHAMP FILTER (TRIGGER) */
.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    user-select: none;
    border: 1px solid #ff5100;
    background-color: transparent;
}

.dropdown-arrow {
    border: solid #ff5100;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-left: 10px;
    transition: transform 0.2s ease;
}

.custom-select.open .dropdown-arrow {
    transform: rotate(-135deg);
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 150px;
    background: #ff5100;
    border: 1px solid #ff5100;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    padding: 8px 0;
    z-index: 10000 !important;
    display: none !important;
}

.custom-select.open .select-options {
    display: block !important;
}

.select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
    margin: 0;
}

.select-option:hover {
    background: #f5f5f5;
}

.select-option input[type="checkbox"],
.select-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* ==================================================
   III. STYLES DU TIROIR MOBILE PANEL (HARMONISÉ)
   ================================================== */
/* Bouton d'ouverture du menu sur mobile */
.tbg-mobile-filter-button {
    display: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: white;
    border: 1px solid #ff5100;
    /* Bordure cohérente */
    background-color: #000;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tbg-filter-icon {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .tbg-mobile-filter-button {
        display: flex;
    }
}

/* Conteneur d'arrière-plan sombre */
#tbg-filter-panel-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background-color: rgba(0, 0, 0, 0.5);
    padding-top: 113px;
    display: none;
    overflow: hidden;
}

/* VERSION PANEL AVEC FOND MOBILE ORANGE UNIQUE */
.filter-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #ff5100;
    /* Fond orange global mobile */
    color: black;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.filter-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 20px;
}

.tbg-close-filter-button {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: black;
    line-height: 1;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 1.1em;
    cursor: pointer;
}

.arrow-icon {
    font-size: 1.2em;
}

.filter-options {
    display: none;
    margin-top: 10px;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    padding-left: 5px;
}

.filter-group.open .filter-options {
    display: flex;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 15px;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid black;
    margin-right: 15px;
    background-color: transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.checkbox-option input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: black;
    font-size: 14px;
}

.see-more-container {
    width: 100%;
    margin-top: auto;
    box-sizing: border-box;
}

.see-more-button {
    width: 100%;
    padding: 15px;
    background-color: black;
    color: white;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}