/* Domus Suisse - equipements de la recherche en tuiles (26.11.2026).
   Gabarit : template-parts/search/fields/feature-field.php ; repli "N de plus" : js/domus-feature-tiles.js.
   Etats inclure / exclure : module domus-feature-exclude (classe .domus-fx-excluded sur la tuile).
   Charte : #1E4D59 seule couleur d'action, filets ambre 14 %, rayon 6 px, Raleway 600 / Inter 400.
   Tout est scope a .dfx. */

.dfx {
  --dfx-accent: #1E4D59;
  --dfx-deep: #163A46;
  --dfx-ink: #214847;
  --dfx-muted: #51686A;
  --dfx-tint: #F3EDE4;
  --dfx-line: rgba(84, 62, 36, 0.14);
  --dfx-line-strong: rgba(84, 62, 36, 0.28);
  --dfx-no: #A4302A;
}

/* Le gabarit parent place la liste dans une grille Bootstrap a 5 colonnes : on la neutralise. */
.features-list > .dfx {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
}
.features-list:has(> .dfx) { padding-top: 8px !important; }

.dfx-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.dfx { padding-top: 14px; }
.dfx-group + .dfx-group { margin-top: 24px; }

.dfx .dfx-legend {
  float: none;
  width: auto;
  margin: 0 0 10px;
  padding: 0;
  font: 700 15px/1.3 Raleway, sans-serif !important;
  color: var(--dfx-ink);
  letter-spacing: 0;
  text-transform: none;
}

.dfx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 188px), 1fr));
  gap: 8px;
}
.dfx { container-type: inline-size; }
@container (max-width: 520px) {
  .dfx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dfx-tile { gap: 8px; padding: 8px 10px; }
}

/* ---------------------------------------------------------------- *
 * Tuile
 * ---------------------------------------------------------------- */
.dfx-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--dfx-line-strong);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--dfx-ink);
  font: 400 14px/1.25 Inter, sans-serif;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
@media (pointer: coarse) {
  .dfx-tile { min-height: 56px; }
}

.dfx-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.dfx-ico {
  --domus-ico-size: 22px;
  display: inline-flex;
  flex: 0 0 22px;
  color: var(--dfx-muted);
  transition: color 0.15s ease-out;
}

.dfx-name {
  min-width: 0;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  text-wrap: pretty;
}

@media (hover: hover) {
  .dfx-tile:hover {
    border-color: var(--dfx-accent);
    background: var(--dfx-tint);
  }
  .dfx-tile:hover .dfx-ico { color: var(--dfx-accent); }
}

.dfx-tile:has(.dfx-input:focus-visible) {
  outline: 2px solid #4C90A8;
  outline-offset: 2px;
}

/* Marque d'etat (coin haut droit), commune a inclus / exclu. */
.dfx-tile::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dfx-accent) center / 12px 12px no-repeat;
  box-shadow: 0 0 0 2px #FFFFFF;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Inclus : l'annonce doit avoir l'equipement. */
.dfx-tile:has(.dfx-input:checked) {
  border-color: var(--dfx-accent);
  background: rgba(30, 77, 89, 0.07);
  box-shadow: inset 0 0 0 1px var(--dfx-accent);
  font-weight: 500;
}
.dfx-tile:has(.dfx-input:checked) .dfx-ico { color: var(--dfx-accent); }
.dfx-tile:has(.dfx-input:checked)::after {
  opacity: 1;
  transform: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2l2.3 2.3L9.5 3.8'/%3E%3C/svg%3E");
}

/* Exclu : l'annonce ne doit pas l'avoir. */
.dfx-tile.domus-fx-excluded {
  border-color: var(--dfx-no);
  background: rgba(164, 48, 42, 0.05);
  box-shadow: inset 0 0 0 1px var(--dfx-no);
  color: var(--dfx-no);
}
.dfx-tile.domus-fx-excluded .dfx-name {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.dfx-tile.domus-fx-excluded .dfx-ico { color: var(--dfx-no); }
.dfx-tile.domus-fx-excluded::after {
  opacity: 1;
  transform: none;
  background-color: var(--dfx-no);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 6h6'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- *
 * Repli "N de plus" (actif seulement quand le script a pris la main)
 * ---------------------------------------------------------------- */
.dfx.dfx-ready .dfx-group:not(.is-open) .dfx-extra:not(:has(.dfx-input:checked)):not(.domus-fx-excluded) {
  display: none;
}

.dfx .dfx-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 6px 0 0 -8px;
  padding: 0 8px;
  border: 0 !important;
  border-radius: 6px;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dfx-accent) !important;
  font: 500 14px/1 Inter, sans-serif !important;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.dfx .dfx-more[hidden] { display: none; }
.dfx-more::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dfx-more[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}
@media (hover: hover) {
  .dfx .dfx-more:hover { background: var(--dfx-tint) !important; }
}
.dfx-more:focus-visible {
  outline: 2px solid var(--dfx-accent);
  outline-offset: 1px;
}

/* Indication "un clic : inclure..." du module d'exclusion, alignee sur les tuiles. */
.features-list:has(> .dfx) ~ .domus-fx-hint,
.domus-fx-hint:has(+ .features-list > .dfx) {
  margin: 4px 0 0;
  color: var(--dfx-muted, #51686A);
}


/* ---------------------------------------------------------------- *
 * Widget de recherche Elementor : bouton "Equipements" + panneau
 * ---------------------------------------------------------------- */
.dfx-pop {
  --dfx-accent: #1E4D59;
  --dfx-deep: #163A46;
  --dfx-ink: #214847;
  --dfx-muted: #51686A;
  --dfx-tint: #F3EDE4;
  --dfx-line: rgba(84, 62, 36, 0.14);
  position: relative;
  width: 100%;
}
/* La fleche dessinee par Elementor sur ses listes deroulantes ne sert plus. */
.elementor-select-wrapper:has(> .dfx-pop)::before,
.elementor-select-wrapper:has(> .dfx-pop)::after { display: none !important; content: none !important; }

.dfx-pop .dfx-pop-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-right: 36px;
  text-align: left;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  height: auto;
  min-height: 48px;
  line-height: 1.2;
  color: #6B7778;
  background-color: #FFFFFF;
}
.dfx-pop .dfx-pop-toggle::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.7;
}
.dfx-pop.is-open .dfx-pop-toggle::after {
  margin-top: -2px;
  transform: rotate(-135deg);
}
.dfx-pop .dfx-pop-toggle:focus-visible {
  outline: 2px solid var(--dfx-accent);
  outline-offset: 2px;
}
.dfx-pop-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dfx-pop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--dfx-accent);
  color: #FFFFFF;
  font: 600 12px/1 Inter, sans-serif;
}
.dfx-pop-badge[hidden] { display: none; }
.dfx-pop.has-value .dfx-pop-toggle { border-color: var(--dfx-accent) !important; color: var(--dfx-ink); }

.dfx-pop-panel {
  position: fixed;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  border: 1px solid var(--dfx-line);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 24px 48px -16px rgba(30, 77, 89, 0.28), 0 2px 6px rgba(30, 77, 89, 0.08);
  text-align: left;
  color: var(--dfx-ink);
}
.dfx-pop-panel[hidden] { display: none; }

.dfx-pop-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 77, 89, 0.35) transparent;
}
.dfx-pop-body .features-list { display: block; margin: 0; padding: 0; }
.dfx-pop-body .domus-fx-hint { margin: 12px 0 0; font: 400 13px/1.4 Inter, sans-serif; color: var(--dfx-muted); }

.dfx-pop-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--dfx-line);
  background: #FFFFFF;
  border-radius: 0 0 8px 8px;
}
.dfx-pop .dfx-pop-clear,
.dfx-pop .dfx-pop-apply {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  font: 600 14px/1 Inter, sans-serif !important;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: none !important;
}
.dfx-pop .dfx-pop-clear {
  margin-left: -12px;
  padding: 0 12px;
  border: 0 !important;
  background: transparent !important;
  color: var(--dfx-accent) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dfx-pop .dfx-pop-clear:disabled { color: #9AA9A9 !important; text-decoration: none; cursor: default; }
.dfx-pop .dfx-pop-apply {
  min-width: 120px;
  border: 1px solid var(--dfx-accent) !important;
  background: var(--dfx-accent) !important;
  color: #FFFFFF !important;
}
@media (hover: hover) {
  .dfx-pop .dfx-pop-apply:hover { background: var(--dfx-deep) !important; border-color: var(--dfx-deep) !important; }
}
.dfx-pop .dfx-pop-clear:focus-visible,
.dfx-pop .dfx-pop-apply:focus-visible {
  outline: 2px solid var(--dfx-accent);
  outline-offset: 2px;
}

.dfx-pop-scrim { display: none; }

/* Telephone : feuille en bas d'ecran, voile derriere. */
@media (max-width: 575.98px) {
  .dfx-pop-panel {
    left: 0 !important;
    right: 0;
    bottom: 0;
    top: auto !important;
    width: auto !important;
    max-height: 86vh !important;
    max-height: 86dvh !important;
    border-radius: 14px 14px 0 0;
    z-index: 100001;
  }
  .dfx-pop-body { padding: 4px 16px 16px; }
  .dfx-pop-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .dfx-pop.is-open .dfx-pop-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(22, 58, 70, 0.45);
  }
  html.dfx-sheet-open, html.dfx-sheet-open body { overflow: hidden; }
}

/* ---------------------------------------------------------------- *
 * Salles de bain : boutons 1+ ... 5+ (radios), 26.11.2026
 * ---------------------------------------------------------------- */
.dfx-seg {
  display: flex;
  gap: 6px;
  width: 100%;
}
.dfx-pill {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 48px;
  margin: 0;
  border: 1px solid rgba(84, 62, 36, 0.28);
  border-radius: 6px;
  background: #FFFFFF;
  color: #214847;
  font: 600 15px/1 Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out, color 0.15s ease-out;
}
@media (hover: hover) {
  .dfx-pill:hover { border-color: #1E4D59; background: #F3EDE4; }
}
.dfx-pill:has(.dfx-input:checked) {
  border-color: #1E4D59;
  background: #1E4D59;
  color: #FFFFFF;
}
.dfx-pill:has(.dfx-input:focus-visible) {
  outline: 2px solid #1E4D59;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- *
 * Liste a choix unique (Lex Koller)
 * ---------------------------------------------------------------- */
.dfx-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dfx-pop--single .dfx-pop-body { padding: 12px; }
.dfx-pop--single .dfx-pop-panel { border-radius: 8px; }
.dfx-tile.dfx-row { min-height: 48px; }
.dfx-ico--none { width: 22px; flex: 0 0 22px; }
@media (max-width: 575.98px) {
  .dfx-pop--single .dfx-pop-body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- *
 * Type de bien (menu de l'accueil, construit par domus-home-search.js)
 * ---------------------------------------------------------------- */
.dhs .dhs-pop.dhs-pop--type {
  width: min(92vw, 640px);
  max-width: none;
  max-height: min(72vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
}
.dfx.dfx--type { padding-top: 0; }
.dfx--type .dfx-group + .dfx-group { margin-top: 16px; }
.dfx--type .dfx-legend { margin-bottom: 8px; font-size: 14px !important; }
.dfx--type .dfx-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); }
.dfx-tile.dfx-all {
  grid-column: 1 / -1;
  min-height: 44px;
  font-weight: 600;
}
/* Famille entiere choisie : ses types sont compris dedans. */
.dfx-group:has(.dfx-all .dfx-input:checked) .dfx-tile:not(.dfx-all) {
  border-color: rgba(30, 77, 89, 0.45);
  background: rgba(30, 77, 89, 0.04);
}
.dfx-group:has(.dfx-all .dfx-input:checked) .dfx-tile:not(.dfx-all) .dfx-ico { color: #1E4D59; }
@media (max-width: 767px) {
  .dhs .dhs-pop.dhs-pop--type { width: auto; max-height: none; padding: 12px 0 0; }
}

/* Dans le widget Elementor : les regles des libelles de champ (majuscules, interlettrage, largeur auto)
   ne doivent pas toucher les tuiles ni les boutons ; les controles prennent toute la colonne. */
.elementor-field-group > .dfx-seg,
.elementor-field-group > .dfx-pop { flex: 1 1 100%; width: 100%; max-width: 100%; }
.elementor-field-group .dfx-pill,
.elementor-field-group .dfx-tile,
.dfx-pop-panel .dfx-tile {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 14px !important;
  width: auto;
  max-width: none;
  margin: 0 !important;
}
.elementor-field-group .dfx-pill { flex: 1 1 0; padding: 0 !important; font-size: 15px !important; font-weight: 600 !important; }
.elementor-field-group .dfx-tile { font-weight: 400 !important; }
.elementor-field-group .dfx-tile:has(.dfx-input:checked) { font-weight: 500 !important; }

/* Le theme remplit les boutons au survol et au focus : le champ garde l'apparence d'un champ. */
.dfx-pop .dfx-pop-toggle,
.dfx-pop .dfx-pop-toggle:hover,
.dfx-pop .dfx-pop-toggle:focus,
.dfx-pop .dfx-pop-toggle:active {
  background: #FFFFFF !important;
  box-shadow: none !important;
}
.dfx-pop.has-value .dfx-pop-toggle,
.dfx-pop.has-value .dfx-pop-toggle:hover,
.dfx-pop.has-value .dfx-pop-toggle:focus { color: #214847 !important; }
.dfx-pop .dfx-pop-toggle:hover { border-color: #1E4D59 !important; }

/* Panneau a boutons (pieces, salles de bain, garage) des recherches Houzez : Indifferent sur une ligne, puis 1+ ... 5+. */
.dfx-seg.dfx-seg--pop {
  flex-wrap: wrap;
  gap: 8px;
}
.dfx-seg--pop .dfx-pill {
  flex: 1 1 0;
  min-width: 48px;
  height: 44px;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 15px !important;
}
.dfx-seg--pop .dfx-pill--any {
  flex: 1 1 100%;
  font-weight: 500 !important;
}
.dfx-pop--num .dfx-pop-body { padding: 12px; }

/* Ameublement dans la barre d'en-tete (domus-furnishing) : bouton compact comme Type / Statut, rempli quand un choix est fait. */
.dfu-pop { width: auto; }
.dfu-pop .dfx-pop-toggle {
  width: auto;
  min-width: 140px;
  min-height: 42px;
  height: 42px;
  font-size: 14px;
  color: #1E4D59;
}
.dfu-pop.has-value .dfx-pop-toggle,
.dfu-pop.has-value .dfx-pop-toggle:hover,
.dfu-pop.has-value .dfx-pop-toggle:focus {
  background: #1E4D59 !important;
  border-color: #1E4D59 !important;
  color: #FFFFFF !important;
}

@media (prefers-reduced-motion: reduce) {
  .dfx-tile, .dfx-tile::after, .dfx-ico, .dfx-more::after, .dfx-pop .dfx-pop-toggle::after, .dfx-pill { transition: none; }
}

/* Uniformisation avec les champs voisins (26.11.2026) : meme bordure que les champs Houzez,
   et meme graisse qu'un texte d'invite tant qu'aucune valeur n'est choisie.
   La barre de l'en-tete garde sa graisse (tout y est en 600). */
.dfx-pop:not(.has-value) .dfx-pop-toggle:not(:hover):not(:focus-visible) { border-color: #78949B !important; }
.dfx-pop:not(.has-value) .dfx-pop-toggle:not(.advanced-search-nav .dfx-pop-toggle) { font-weight: 400; }

/* Barre de recherche de l'en-tete (26.11.2026) : tous les controles avec la meme police, taille, graisse
   et la meme bordure que les champs (mot-cle et Ameublement etaient en Inter 15 px,
   Type \/ Statut \/ Prix \/ Avance en bordure tres claire). Survol, focus et etat ouvert inchanges. */
#desktop-header-search .houzez-keyword-autocomplete,
#desktop-header-search .houzez-keyword-autocomplete::placeholder,
#desktop-header-search .dfx-pop .dfx-pop-toggle {
  font-family: Raleway, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
#desktop-header-search .btn-light-grey-outlined:not(:hover):not(:focus-visible):not(.active):not(.show):not([aria-expanded="true"]) {
  border-color: #78949B;
}
