/* Domus Suisse - filtre "Villes" groupe par canton (menu bootstrap-select de location[]).
   Module : domus-core/modules/domus-city-groups.php, comportement : js/domus-city-groups.js.
   Un canton = une ligne d'en-tete (option desactivee .dcg-head) suivie de ses villes.
   Charte : #1E4D59 (action unique), rayon 6px, filets 1px, Raleway 600 pour les titres de canton.
   Scope .houzez-city-js : aucun autre menu du site n'est touche. Pas d'animation. */

.bootstrap-select.houzez-city-js {
  --dcg-accent: #1E4D59;
  --dcg-ink: #214847;
  --dcg-soft: #4C90A8;
  --dcg-tint: #F1F5F6;
  --dcg-line: rgba(30, 77, 89, 0.14);
  --dcg-row: 40px;
}
@media (pointer: coarse), (max-width: 767.98px) {
  .bootstrap-select.houzez-city-js { --dcg-row: 48px; }
}

/* ------------------------------------------------------------------ *
 * Menu : plus large, plus haut (la liste est courte : une centaine de villes)
 * ------------------------------------------------------------------ */
.bootstrap-select.houzez-city-js > .dropdown-menu {
  min-width: 300px;
  max-width: calc(100vw - 24px);
  max-height: none !important;
  border: 1px solid var(--dcg-line);
  border-radius: 6px;
  overflow: hidden !important;
}
.bootstrap-select.houzez-city-js > .dropdown-menu > .inner {
  max-height: min(56vh, 420px) !important;
  max-height: min(56dvh, 420px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------------ *
 * Lignes : toute la ligne est la zone de tap ; nombre d'annonces en retrait
 * ------------------------------------------------------------------ */
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: var(--dcg-row);
  padding-top: 6px;
  padding-bottom: 6px;
  color: var(--dcg-ink);
  font: 400 15px/1.3 Inter, sans-serif;
  white-space: normal;
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item .text {
  flex: 1 1 auto;
  min-width: 0;
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item small.text-muted {
  margin-left: 8px;
  color: #6B7778 !important;
  font-size: 13px;
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item:not(.dcg-head):hover {
  background: var(--dcg-tint);
}
.bootstrap-select.houzez-city-js .dropdown-menu li.selected a.dropdown-item:not(.dcg-head),
.bootstrap-select.houzez-city-js .dropdown-menu li.active a.dropdown-item:not(.dcg-head) {
  background: var(--dcg-accent);
  color: #FFFFFF;
}
.bootstrap-select.houzez-city-js .dropdown-menu li.selected a.dropdown-item:not(.dcg-head) small.text-muted,
.bootstrap-select.houzez-city-js .dropdown-menu li.active a.dropdown-item:not(.dcg-head) small.text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item:focus-visible {
  outline: 2px solid var(--dcg-soft);
  outline-offset: -2px;
}

/* ------------------------------------------------------------------ *
 * Titres de canton : cliquables (coche / decoche toutes les villes du canton)
 * ------------------------------------------------------------------ */
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item.dcg-head,
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item.dcg-head.disabled {
  justify-content: space-between;
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--dcg-line);
  background: var(--dcg-tint);
  color: var(--dcg-accent);
  font: 600 12px/1.2 Raleway, sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}
.bootstrap-select.houzez-city-js .dropdown-menu li:first-child a.dropdown-item.dcg-head {
  border-top: 0;
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item.dcg-head:hover {
  background: #E6EDEF;
  color: var(--dcg-accent);
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item.dcg-head .check-mark {
  display: none;
}
.bootstrap-select.houzez-city-js .dropdown-menu li a.dropdown-item.dcg-head::after {
  content: attr(data-dcg);
  flex: none;
  margin-left: 12px;
  font: 600 12px/1 Inter, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Recherche et "tout cocher" du menu : meme gabarit que le reste de la barre. */
.bootstrap-select.houzez-city-js .bs-actionsbox .btn {
  min-height: 36px;
  font-family: Raleway, sans-serif;
  font-weight: 600;
  color: var(--dcg-accent);
}
/* Survol / focus / appui : le fond passe en teal fonce, le texte doit rester lisible. */
.bootstrap-select.houzez-city-js .bs-actionsbox .btn:hover,
.bootstrap-select.houzez-city-js .bs-actionsbox .btn:focus,
.bootstrap-select.houzez-city-js .bs-actionsbox .btn:focus-visible,
.bootstrap-select.houzez-city-js .bs-actionsbox .btn:active {
  background: var(--dcg-accent);
  border-color: var(--dcg-accent);
  color: #FFFFFF;
}

/* Texte lisible sur ligne selectionnee (bootstrap-select pose #222 sur .text). */
.bootstrap-select.houzez-city-js .dropdown-menu li.selected a.dropdown-item:not(.dcg-head) .text,
.bootstrap-select.houzez-city-js .dropdown-menu li.active a.dropdown-item:not(.dcg-head) .text {
  color: #FFFFFF;
}
