/* CSS pour le moteur de recherche maquette UBIFLOW - Style unifié HEKTOR */

/* S'assurer que le wrapper principal a un z-index approprié */
.ubiflow-maquette-search-wrapper {
    background: #00031b;
    padding: 0px;
    margin: 0px;
    position: relative;
    z-index: 100;
}

.ubiflow-maquette-container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 101;
}

/* Le formulaire a un z-index modéré */
form#ubiflow-maquette-form {
    padding-left: 10%;
    padding-right: 10%;
    box-sizing: border-box;
    background: #00031b;
    position: relative;
    z-index: 102;
}

.ubiflow-maquette-form {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr) 60px;
    gap: 0px;
    align-items: stretch;
}

/* Trait de séparation sous le moteur — aligné avec les marges de 10% */
.ubiflow-maquette-container::after {
    content: '';
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, 1);
    margin: 0 10%;
}

.ubiflow-maquette-fields {
    display: contents;
}

/* Chaque champ de filtre */
.ubiflow-filter-field {
    border-right: 1px solid rgba(255, 255, 255, 1);
    margin-bottom: 20px;
    position: relative;
    min-height: 40px;
    height: auto;
    min-width: 0;
    /* INDISPENSABLE : empêche la cellule grid de gonfler au-delà de 1fr */
}

/* Style des boutons dropdown */
.ubiflow-filter-select {
    width: 100%;
    min-height: 54px;
    height: auto;
    border: none;
    background: #00031b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    /* gap: 3px; */
    overflow: hidden;
    /* empêche tout débordement horizontal */
}

/* Flèche chevron via pseudo-élément */
.ubiflow-filter-select::after {
    content: '';
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='0.4' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 54px;
    transition: transform 0.3s ease;
    pointer-events: none;
}

/* Rotation de la flèche quand le panneau est actif */
.ubiflow-filter-select.active::after {
    transform: rotate(180deg);
}



/* Contenu des boutons dropdown */
.ubiflow-dropdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: auto;
    min-width: 0;
    overflow: hidden;
    margin: -5px;
    /* pour rapprocher le chevron du texte dans le moteur */
    ;
}

.ubiflow-dropdown-label {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.2;
}

.ubiflow-dropdown-value {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Quand une valeur est sélectionnée : masquer le libellé générique */
.ubiflow-dropdown-content:has(.ubiflow-dropdown-value:not(:empty)) .ubiflow-dropdown-label {
    display: none;
}

/* Valeur vide : ne pas occuper d'espace */
.ubiflow-dropdown-value:empty {
    display: none;
}

/* Bouton de recherche */
.ubiflow-filter-btn {
    background: #00031b;
    color: white;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    height: 54px;
    border-radius: 0 !important;
}

.ubiflow-filter-btn:hover {
    background: #00031b;
}

.ubiflow-filter-btn img {
    height: 50px;
    width: 50px;
}

/* ============================================================================
   STYLES POUR LES PANNEAUX DROPDOWN
   ============================================================================ */

/* Container pour tous les panneaux dropdown */
.ubiflow-dropdown-panels {
    position: relative;
    width: 100%;
    z-index: 9999;
}

/* Chaque panneau dropdown - CACHÉ PAR DÉFAUT */
.ubiflow-dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #00031b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 99999;
    pointer-events: auto;
    animation: slideDown 0.3s ease-out;
}

/* Animation d'apparition */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panneau visible */
.ubiflow-dropdown-panel.active {
    display: block;
}

/* Contenu du panneau */
.ubiflow-panel-content {
    padding: 10px;
    color: #FFFFFF;
    position: relative;
    z-index: 99990;
    pointer-events: auto;
}

.ubiflow-panel-content h4 {
    margin: 0 0 15px 0;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
}

/* Actions du panneau */
.ubiflow-panel-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    padding-top: 15px;
}

.ubiflow-btn-secondary {
    background: #999999;
    color: #ffffff;
    border: 1px solid #777777;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ubiflow-btn-secondary:hover {
    background: #777777;
}

.ubiflow-btn-primary {
    background: #00031b;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ubiflow-btn-primary:hover {
    background: #FFFFFF;
    color: #00031b;
}

/* Styles pour les inputs number dans les panneaux */
.ubiflow-number-inputs-container {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.ubiflow-number-inputs-container input[type="number"] {
    width: calc(50% - 6px);
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    background: #04071a;
    color: #ffffff;
    transition: all 0.3s ease;
    font-weight: 500;
}

.ubiflow-number-inputs-container input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: #04071a;
}

.ubiflow-number-inputs-container input[type="number"]::placeholder {
    color: #888888;
    font-weight: 400;
}

/* Suppression des flèches sur les inputs number */
.ubiflow-number-inputs-container input[type="number"]::-webkit-outer-spin-button,
.ubiflow-number-inputs-container input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ubiflow-number-inputs-container input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Styles pour les checkboxes dans les panneaux */
.ubiflow-checkbox-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

/* Scrollbar stylée pour les containers de checkboxes */
.ubiflow-checkbox-container::-webkit-scrollbar {
    width: 8px;
}

.ubiflow-checkbox-container::-webkit-scrollbar-track {
    background: #04071a;
}

.ubiflow-checkbox-container::-webkit-scrollbar-thumb {
    background: #555555;
}

.ubiflow-checkbox-container::-webkit-scrollbar-thumb:hover {
    background: #777777;
}

/* Style spécifique pour le panneau localisation avec potentiellement plus d'options */
#dropdown-localisation .ubiflow-checkbox-container {
    max-height: 450px;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: hidden;
    overflow-y: auto;
}

.ubiflow-checkbox-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.ubiflow-checkbox-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.ubiflow-checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    accent-color: #ffffff;
}

.ubiflow-checkbox-option.checked {
    color: #ffffff;
}

.ubiflow-checkbox-option span {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    color: #ffffff;
}

/* Style spécifique pour les labels de localisation */
#dropdown-localisation .ubiflow-checkbox-option span {
    min-width: 0;
    max-width: 100%;
}



/* Responsive Design */
@media (max-width: 1200px) {
    .ubiflow-maquette-form {
        grid-template-columns: repeat(3, 1fr) 60px;
    }

    .ubiflow-checkbox-container {
        grid-template-columns: 1fr;
    }

    .ubiflow-dropdown-panel {
        min-width: 350px;
        max-width: 450px;
    }

    #dropdown-localisation {
        min-width: 500px;
        max-width: 550px;
    }
}

@media (max-width: 768px) {
    .ubiflow-maquette-form {
        grid-template-columns: 1fr;
        gap: 0px;
    }

    /* Sur mobile : supprimer les marges latérales pour occuper tout l'écran */
    form#ubiflow-maquette-form {
        padding-left: 0;
        padding-right: 0;
    }

    .ubiflow-maquette-container::after {
        margin: 0;
    }

    .ubiflow-results-bar,
    .ubiflow-results-grid {
        margin: 0;
    }

    .ubiflow-filter-field {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .ubiflow-filter-btn {
        width: 100%;
        justify-content: center;
    }

    .ubiflow-maquette-search-wrapper {
        padding: 0px;
    }

    .ubiflow-checkbox-container {
        grid-template-columns: 1fr;
    }

    /* Sur mobile : les panneaux s'insèrent dans le flux normal juste sous leur filtre */
    .ubiflow-dropdown-panel {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border-left: none;
        border-right: none;
        box-shadow: none;
        animation: none;
    }

    .ubiflow-filter-btn {
        border-left: none
    }

}

@media (max-width: 480px) {
    .ubiflow-filter-select {
        padding: 10px 12px;
        font-size: 13px;
    }

    .ubiflow-filter-btn {
        padding: 15px;
        height: 50px;
    }
}

/* Style pour les champs label dans les panneaux */
.ubiflow-panel-content label {
    display: block;
    margin-bottom: 8px;
    color: #cccccc;
    font-size: 13px;
    font-weight: 500;
}

/* Style pour masquer les bordures du dernier élément */
.ubiflow-maquette-form>.ubiflow-filter-field:last-of-type {
    border-right: none;
}

/* S'assurer que les panneaux sont bien positionnés */
.ubiflow-dropdown-panels {
    position: relative;
}

.ubiflow-dropdown-panel {
    min-width: 450px;
    max-width: 550px;
}

/* Largeur spécifique pour le panneau localisation (noms de villes longs) */
#dropdown-localisation {
    min-width: 300px;
    max-width: 300px;
}

#dropdown-localisation .ubiflow-panel-content {
    overflow-x: hidden;
    padding: 0;
}

/* ============================================================================
   AUTOCOMPLETE LOCALISATION
   ============================================================================ */

/* Champ de saisie texte */
.ubiflow-localisation-input-wrapper {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ubiflow-localisation-input {
    width: 100%;
    padding: 10px 12px;
    background: #04071a;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.ubiflow-localisation-input:focus {
    border-color: rgba(255, 255, 255, 0.7);
}

.ubiflow-localisation-input::placeholder {
    color: #999999;
    font-weight: 400;
}

/* Tags des villes sélectionnées */
.ubiflow-localisation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ubiflow-localisation-tags:empty {
    display: none;
}

.ubiflow-localisation-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 4px 8px;
    font-size: 13px;
}

.ubiflow-localisation-tag-remove {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 0 0 4px;
    opacity: 0.7;
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.ubiflow-localisation-tag-remove:hover {
    opacity: 1;
}

/* Zone de suggestions */
.ubiflow-localisation-suggestions {
    max-height: 350px;
    overflow-y: auto;
}

.ubiflow-localisation-suggestions::-webkit-scrollbar {
    width: 6px;
}

.ubiflow-localisation-suggestions::-webkit-scrollbar-track {
    background: #04071a;
}

.ubiflow-localisation-suggestions::-webkit-scrollbar-thumb {
    background: #555555;
}

.ubiflow-localisation-suggestions::-webkit-scrollbar-thumb:hover {
    background: #777777;
}

/* En-tête "Villes" */
.ubiflow-localisation-suggestions-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #c0392b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Liste de suggestions */
.ubiflow-localisation-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Chaque suggestion */
.ubiflow-localisation-suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
    color: #ffffff;
}

.ubiflow-localisation-suggestion-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ubiflow-sug-name {
    font-size: 14px;
    font-weight: 400;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ubiflow-sug-count {
    font-size: 12px;
    color: #999999;
    flex-shrink: 0;
    margin-left: 16px;
    white-space: nowrap;
}

.ubiflow-localisation-no-results {
    padding: 16px 12px;
    color: #999999;
    font-size: 14px;
    text-align: center;
    font-style: italic;
    list-style: none;
}

/* Responsive : largeur réduite sur tablette */
@media (max-width: 1200px) {
    #dropdown-localisation {
        min-width: 300px;
        max-width: 300px;
    }
}

/* Responsive : pleine largeur sur mobile */
@media (max-width: 768px) {
    #dropdown-localisation {
        min-width: 0 !important;
        max-width: none !important;
    }

    .ubiflow-localisation-suggestions {
        max-height: 250px;
    }
}

/* Animation pour l'icône de recherche */
.ubiflow-filter-btn:active {
    transform: scale(0.95);
}

/* Container principal de recherche */
.ubiflow-search-container-maquette {
    width: 100%;
    background: #000000;
    padding: 0;
    margin: 0 auto 30px;
}

/* Titre de recherche */
.ubiflow-search-title-maquette {
    text-align: center;
    margin-bottom: 20px;
    color: white;
    font-size: 28px;
    padding: 20px 0 0 0;
}

/* ============================================================================
   BARRE DE RÉSULTATS (compteur + tri)
   ============================================================================ */
.ubiflow-results-bar {
    margin: 5% 9%;
    background: #00031b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: -20px;
}

.ubiflow-results-bar-left {
    display: flex;
    align-items: center;
    color: #ffffff;
    font-size: 14px;
    gap: 6px;
}

.ubiflow-results-count strong {
    font-weight: 700;
    color: #ffffff;
}

.ubiflow-results-sep {
    color: rgba(255, 255, 255, 0.5);
}

.ubiflow-results-sort {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
}

.ubiflow-results-sort strong {
    color: #ffffff;
    font-weight: 600;
}

/* ============================================================================
   GRILLE 3 COLONNES — résultats de recherche
   ============================================================================ */
.ubiflow-results-grid {
    margin: 0 9%;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    background: #00031b;
    box-sizing: border-box;
}

/* Colonne individuelle — 1/3 de la grille */
.ubiflow-result-col {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
    box-sizing: border-box;
    /* Empêche le débordement du contenu WPBakery */
    overflow: hidden;
}

/* Annuler les marges négatives et paddings qu'ajoute WPBakery aux .vc_row */
.ubiflow-result-col .vc_row,
.ubiflow-result-col .wpb_row,
.ubiflow-result-col .vc_row-fluid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    width: 100% !important;
    float: none !important;
    box-sizing: border-box;
}

/* Neutraliser le ::before WPBakery (utilisé pour les espacements de ligne) */
.ubiflow-result-col .vc_row::before,
.ubiflow-result-col .wpb_row::before {
    display: none !important;
    content: none !important;
}

/* Annuler la largeur forcée sur vc_column_container à l'intérieur */
.ubiflow-result-col .vc_column_container {
    box-sizing: border-box;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ── Photo principale : cadre quasi carré (ratio 1:1) ── */
/* aspect-ratio s'adapte automatiquement à la largeur de la colonne */
.ubiflow-result-col a:has(> img.ubiflow-photo-principale) {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

/* L'image remplit exactement ce bloc et se recadre sans se déformer */
.ubiflow-result-col img.ubiflow-photo-principale {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Supprimer le padding intérieur WPBakery qui désaligne le texte par rapport à la photo */
.ubiflow-result-col .vc_column-inner,
.ubiflow-result-col .wpb_column>.vc_column-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Supprimer également tout padding du vc_row lui-même (classes dynamiques vc_custom_XXXX) */
.ubiflow-result-col .vc_row[data-vc-full-width],
.ubiflow-result-col .vc_row {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}



/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* Tablette : 2 colonnes */
@media (max-width: 1024px) {
    .ubiflow-result-col {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

/* Mobile : 1 colonne */
@media (max-width: 640px) {
    .ubiflow-results-grid {
        padding: 16px;
        gap: 16px;
    }

    .ubiflow-result-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
