/* Styles pour les checkboxes de sélection multiple */

/* Styles généraux pour les checkboxes */
.hektor-type-bien-option input[type="checkbox"],
.hektor-localisation-option input[type="checkbox"],
.hektor-type-bien-results-option input[type="checkbox"],
.hektor-localisation-results-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Créer des checkboxes personnalisées */
.hektor-type-bien-option,
.hektor-localisation-option,
.hektor-type-bien-results-option,
.hektor-localisation-results-option {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    margin: 1px 0;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 32px;
    line-height: 1.4;
}

/* Créer la case à cocher visible */
.hektor-type-bien-option::before,
.hektor-localisation-option::before,
.hektor-type-bien-results-option::before,
.hektor-localisation-results-option::before {
    content: '';
    position: relative;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border: 2px solid #ccc;
    background-color: #fff;
    border-radius: 3px;
    margin-right: 10px;
    transition: all 0.2s ease;
    display: inline-block;
    box-sizing: border-box;
    align-self: center;
}

/* Texte des options */
.hektor-type-bien-option span,
.hektor-localisation-option span,
.hektor-type-bien-results-option span,
.hektor-localisation-results-option span {
    line-height: 1.4;
    vertical-align: middle;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 16px;
}

/* ===============================================
   CHECKMARKS ULTRA-SPÉCIFIQUES PAR PANNEAU
   =============================================== */

/* PAGE D'ACCUEIL - Panneau Type de bien spécifique */
#dropdown-type-bien .hektor-type-bien-option::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    color: #007cba;
    font-weight: bold;
    font-size: 11px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    width: 10px;
    height: 10px;
    text-align: center;
    line-height: 10px;
}

/* PAGE D'ACCUEIL - Panneau Localisation spécifique */
#dropdown-localisation .hektor-localisation-option::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    color: #007cba;
    font-weight: bold;
    font-size: 11px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    width: 10px;
    height: 10px;
    text-align: center;
    line-height: 10px;
}

/* PAGE DE RÉSULTATS - Panneau Type de bien spécifique */
#dropdown-type-bien-results .hektor-type-bien-results-option::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #007cba;
    font-weight: bold;
    font-size: 11px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    width: 10px;
    height: 10px;
    text-align: center;
    line-height: 10px;
}

/* PAGE DE RÉSULTATS - Panneau Localisation spécifique */
#dropdown-localisation-results .hektor-localisation-results-option::after {
    content: '';
    position: absolute;
    left: 15px;
    /* Ajustement spécifique pour le panneau Localisation sur la page de résultats */
    top: 50%;
    transform: translateY(-50%);
    color: #007cba;
    font-weight: bold;
    font-size: 11px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    width: 10px;
    height: 10px;
    text-align: center;
    line-height: 10px;
}

/* ===============================================
   AFFICHAGE DES COCHES ULTRA-SPÉCIFIQUES PAR PANNEAU
   =============================================== */

/* PAGE D'ACCUEIL - Panneau Type de bien */
#dropdown-type-bien .hektor-type-bien-option:has(input[type="checkbox"]:checked)::after {
    content: '✓';
    opacity: 1;
}

/* PAGE D'ACCUEIL - Panneau Localisation */
#dropdown-localisation .hektor-localisation-option:has(input[type="checkbox"]:checked)::after {
    content: '✓';
    opacity: 1;
}

/* PAGE DE RÉSULTATS - Panneau Type de bien */
#dropdown-type-bien-results .hektor-type-bien-results-option:has(input[type="checkbox"]:checked)::after {
    content: '✓';
    opacity: 1;
}

/* PAGE DE RÉSULTATS - Panneau Localisation */
#dropdown-localisation-results .hektor-localisation-results-option:has(input[type="checkbox"]:checked)::after {
    content: '✓';
    opacity: 1;
}

/* État coché - changer la couleur de la bordure */
.hektor-type-bien-option:has(input[type="checkbox"]:checked)::before,
.hektor-localisation-option:has(input[type="checkbox"]:checked)::before,
.hektor-type-bien-results-option:has(input[type="checkbox"]:checked)::before,
.hektor-localisation-results-option:has(input[type="checkbox"]:checked)::before {
    border-color: #007cba;
    background-color: #f0f8ff;
}

/* Hover sur les options */
.hektor-type-bien-option:hover,
.hektor-localisation-option:hover,
.hektor-type-bien-results-option:hover,
.hektor-localisation-results-option:hover {
    /*background-color: #333333 !important;*/
    color: #ffffff;
}

/* Style spécial pour l'option "Toutes les villes" */
.hektor-option-all {
    border-bottom: 1px solid #444;
    margin-bottom: 5px;
    padding-bottom: 8px;
}

.hektor-option-all span {
    font-weight: 600;
}

/* Ajustements pour les panneaux */
.hektor-panel-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px 8px;
    border-top: 1px solid #333;
    margin-top: 8px;
}

.hektor-btn-secondary {
    background-color: #666;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}



.hektor-btn-primary {
    background: #FFFFFF;
    color: #000000;
    border: none;
    cursor: pointer;
    font-size: 12px;

}

.hektor-btn-primary:hover {
    background: #FFFFFF;
    color: #000000;
}

/* Animation pour les checkboxes */
.hektor-type-bien-option::before,
.hektor-localisation-option::before,
.hektor-type-bien-results-option::before,
.hektor-localisation-results-option::before {
    transition: all 0.2s ease;
}

/* État coché avec animation */
.hektor-type-bien-option:has(input[type="checkbox"]:checked)::before,
.hektor-localisation-option:has(input[type="checkbox"]:checked)::before,
.hektor-type-bien-results-option:has(input[type="checkbox"]:checked)::before,
.hektor-localisation-results-option:has(input[type="checkbox"]:checked)::before {
    transform: scale(1.05);
}

/* Fallback pour les navigateurs qui ne supportent pas :has() */
.hektor-checkbox-checked::before {
    border-color: #007cba !important;
    background-color: #f0f8ff !important;
    transform: scale(1.05) !important;
}

.hektor-checkbox-checked::after {
    content: '✓' !important;
    opacity: 1 !important;
}

/* ===============================================
   FALLBACK ULTRA-SPÉCIFIQUES PAR PANNEAU (navigateurs sans :has())
   =============================================== */

/* PAGE D'ACCUEIL - Panneau Type de bien */
#dropdown-type-bien .hektor-type-bien-option.hektor-checkbox-checked::after {
    top: 50% !important;
    left: 11px !important;
    transform: translateY(-50%) !important;
}

/* PAGE D'ACCUEIL - Panneau Localisation */
#dropdown-localisation .hektor-localisation-option.hektor-checkbox-checked::after {
    top: 50% !important;
    left: 7px !important;
    transform: translateY(-50%) !important;
}

/* PAGE DE RÉSULTATS - Panneau Type de bien */
#dropdown-type-bien-results .hektor-type-bien-results-option.hektor-checkbox-checked::after {
    top: 50% !important;
    left: 15px !important;
    transform: translateY(-50%) !important;
}

/* PAGE DE RÉSULTATS - Panneau Localisation */
#dropdown-localisation-results .hektor-localisation-results-option.hektor-checkbox-checked::after {
    top: 50% !important;
    left: 15px !important;
    transform: translateY(-50%) !important;
}

/* Règles de reset pour éviter les conflits */
.hektor-type-bien-option::before,
.hektor-localisation-option::before,
.hektor-type-bien-results-option::before,
.hektor-localisation-results-option::before,
.hektor-type-bien-option::after,
.hektor-localisation-option::after,
.hektor-type-bien-results-option::after,
.hektor-localisation-results-option::after {
    font-family: inherit;
    vertical-align: baseline;
    box-shadow: none;
    outline: none;
}

/* ============================================
   STYLES SPÉCIFIQUES POUR LE SHORTCODE MAQUETTE
   [hektor_recherche_maquette] - Page d'accueil
   ============================================ */

/* Conteneurs pour les checkboxes dans la maquette */
.hektor-maquette-search-wrapper .hektor-type-bien-container,
.hektor-maquette-search-wrapper .hektor-localisation-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 250px;
    /* Largeur minimale pour éviter le wrapping */
    height: auto;
    /* Hauteur automatique pour s'adapter au contenu */
    overflow: visible;
    /* Pas d'ascenseur, contenu visible */
}

/* Options de checkbox dans le contexte maquette */
.hektor-maquette-search-wrapper .hektor-type-bien-option,
.hektor-maquette-search-wrapper .hektor-localisation-option {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    /* IMPORTANT: Empêcher le retour à la ligne */
    width: 100%;
    min-width: 0;
    /* Permettre la compression du texte si nécessaire */
    padding: 6px 8px;
    margin: 1px 0;
    white-space: nowrap;
    /* Empêcher le texte de passer à la ligne */
    overflow: hidden;
    /* Cacher le débordement */
    text-overflow: ellipsis;
    /* Ajouter des points de suspension si nécessaire */
}

/* Texte des options dans la maquette - force sur une ligne */
.hektor-maquette-search-wrapper .hektor-type-bien-option span,
.hektor-maquette-search-wrapper .hektor-localisation-option span {
    flex: 1;
    min-width: 0;
    /* Important pour permettre la compression */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-left: 8px;
    /* Espacement avec la checkbox */
}

/* Checkbox avant dans le contexte maquette */
.hektor-maquette-search-wrapper .hektor-type-bien-option::before,
.hektor-maquette-search-wrapper .hektor-localisation-option::before {
    flex-shrink: 0;
    /* Empêcher la compression de la checkbox */
    margin-right: 8px;
}

/* Panneaux déroulants dans la maquette - largeur suffisante */
.hektor-maquette-search-wrapper .hektor-dropdown-panel {
    min-width: 280px;
    /* Largeur minimale pour éviter le wrapping */
    max-width: 350px;
    height: auto;
    /* Hauteur automatique */
    overflow: visible;
    /* Contenu toujours visible sans ascenseur */
}

/* Responsive - adaptation pour les écrans plus petits */
@media (max-width: 768px) {

    .hektor-maquette-search-wrapper .hektor-type-bien-option span,
    .hektor-maquette-search-wrapper .hektor-localisation-option span {
        font-size: 13px;
        /* Réduire légèrement la taille sur mobile */
    }

    .hektor-maquette-search-wrapper .hektor-dropdown-panel {
        min-width: 250px;
        max-width: 300px;
    }
}