:root {
  --bleu: #06215C;
  --or: #c49900;
  --fond: #ECECEC;
  --blanc: #ffffff;
  --texte: #1c2333;
  --texte-doux: #5b6478;
  --trait: #d9dbe1;
  --hausse: #17663f;
  --baisse: #b3261e;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--fond);
  color: var(--texte);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 15px;
  display: flex;
  flex-direction: column;
}

::selection { background: #f1e3a8; color: var(--bleu); }

.invisible {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- En-tête ---------- */
.entete {
  /* Au-dessus des boutons de la carte, pour que les suggestions de recherche ne passent pas dessous. */
  position: relative;
  z-index: 1100;
  background: var(--bleu);
  color: var(--blanc);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
}
.marque {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 24px;
}
.marque span { color: var(--or); }
.titre h1 {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}
.titre p { margin: 2px 0 0; font-size: 13px; opacity: .85; }

/* ---------- Recherche ---------- */
.recherche { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.recherche input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--texte);
  background: var(--blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2306215C' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 12px center;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 9px 12px 9px 38px;
  outline: none;
  transition: border-color .2s ease-out;
}
.recherche input::placeholder { color: var(--texte-doux); }
.recherche input { padding-right: 46px; }

/* ---------- Micro (commande vocale) ---------- */
.micro {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--bleu);
  cursor: pointer;
  transition: background-color .2s ease-out, color .2s ease-out;
}
.micro[hidden] { display: none; }
.micro svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.micro svg rect { fill: currentColor; }
.micro:hover { background: #eef1f6; }
.micro:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }
.micro.ecoute { background: var(--or); color: var(--blanc); animation: ecoute 1.4s ease-out infinite; }
@keyframes ecoute {
  0% { box-shadow: 0 0 0 0 rgba(196,153,0,.55); }
  100% { box-shadow: 0 0 0 12px rgba(196,153,0,0); }
}
@media (prefers-reduced-motion: reduce) { .micro.ecoute { animation: none; } }
.aide-voix {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  margin: 0;
  padding: 8px 12px;
  background: var(--blanc);
  color: var(--bleu);
  font-size: 14px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(6,33,92,.25);
}
.aide-voix[hidden] { display: none; }
.champ-micro { position: relative; flex: 1; min-width: 0; display: flex; }
.champ-micro input { padding-right: 38px !important; }
.champ-micro .micro { width: 28px; height: 28px; right: 4px; }
.recherche input:focus { border-color: var(--or); }
.suggestions {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  left: 0; right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--blanc);
  color: var(--texte);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(6,33,92,.25);
}
.suggestions li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.suggestions li strong { color: var(--bleu); font-weight: 600; }
.suggestions li span { font-size: 13px; color: var(--texte-doux); }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: #f3f4f7; }
.suggestions li.vide { cursor: default; color: var(--texte-doux); }

/* ---------- Boutons « Faire estimer mon bien » ---------- */
.cta {
  background: var(--or);
  color: var(--bleu);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background-color .2s ease-out;
}
.cta:hover { background: #d9ae14; }
.cta:focus-visible { outline: 2px solid var(--blanc); outline-offset: 2px; }
.encart-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fbf6e3;
  border: 1px solid #ecdca0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}
.encart-cta div { flex: 1; }
.encart-cta strong { display: block; color: var(--bleu); }
.encart-cta span { font-size: 13px; color: var(--texte-doux); }
.encart-cta .cta { padding: 9px 12px; font-size: 14px; }
.encart-cta .cta:focus-visible { outline-color: var(--bleu); }

/* Dans une page de smartimo.fr : le site affiche déjà le logo. */
.integre .marque { display: none; }
.integre .entete { padding: 10px 16px; }

/* ---------- Mise en page ---------- */
.page {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 400px 1fr;
}
.panneau {
  background: var(--blanc);
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--trait);
}
.carte-boite { position: relative; min-height: 0; }
#carte { position: absolute; inset: 0; }

/* ---------- Fil (France › Département › Commune) ---------- */
.fil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--texte-doux);
}
.fil button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--bleu);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.fil button:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.fil .sep { color: var(--or); }

.nom-zone {
  font-family: "Playfair Display", serif;
  color: var(--bleu);
  font-size: 24px;
  line-height: 1.2;
  margin: 4px 0 12px;
}

/* ---------- Filtres ---------- */
.filtres {
  display: flex;
  background: var(--fond);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 14px;
}
.filtres button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  color: var(--texte-doux);
  cursor: pointer;
}
.filtres button.actif { background: var(--bleu); color: var(--blanc); }
.filtres button:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }

/* ---------- Résumés ---------- */
.resume {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.chiffre {
  background: var(--fond);
  border-radius: 8px;
  padding: 10px 12px;
}
.chiffre .etiquette { font-size: 12px; color: var(--texte-doux); }
.chiffre .valeur {
  font-size: 22px;
  font-weight: 700;
  color: var(--bleu);
  font-variant-numeric: tabular-nums;
}
.chiffre .detail { font-size: 12px; color: var(--texte-doux); }

.detail-types { margin-bottom: 14px; }
.detail-types div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--trait);
}
.detail-types strong { color: var(--bleu); font-variant-numeric: tabular-nums; }

/* ---------- Liste (départements ou communes) ---------- */
.outils-liste { display: flex; gap: 8px; margin-bottom: 6px; }
.outils-liste input, .outils-liste select {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--trait);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--texte);
  background-color: var(--blanc);
}
.outils-liste input { flex: 1; min-width: 0; }
.outils-liste input:focus, .outils-liste select:focus { outline: 2px solid var(--or); outline-offset: 0; border-color: var(--or); }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--trait);
  cursor: pointer;
  border-radius: 6px;
}
.liste li:hover, .liste li.survol { background: #f3f4f7; }
.liste li:focus-visible { outline: 2px solid var(--or); outline-offset: -2px; }
.liste li.vide { display: block; cursor: default; color: var(--texte-doux); }
.liste .pastille { width: 10px; height: 10px; border-radius: 3px; }
.liste .nom { font-weight: 600; }
.liste .code {
  display: inline-block;
  min-width: 30px;
  color: var(--texte-doux);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.liste .prix {
  font-weight: 700;
  color: var(--bleu);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.evol {
  font-size: 13px;
  font-weight: 600;
  min-width: 58px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.evol.hausse { color: var(--hausse); }
.evol.baisse { color: var(--baisse); }
.evol.neutre { color: var(--texte-doux); font-weight: 400; }

.note {
  font-size: 12px;
  color: var(--texte-doux);
  line-height: 1.4;
  margin-top: 18px;
}

/* ---------- Carte ---------- */
/* En bas à gauche : Netlify pose son badge en bas à droite, par-dessus la carte. */
.legende {
  position: absolute;
  bottom: 30px;
  left: 12px;
  z-index: 500;
  background: var(--blanc);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.15);
}
.legende ul { list-style: none; margin: 6px 0 0; padding: 0; }
.legende li { display: flex; align-items: center; gap: 6px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.legende li i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legende .aide { margin-top: 6px; color: var(--texte-doux); }
.bulle-zone { font-family: "Source Sans 3", sans-serif; font-size: 13px; }
.bulle-zone strong { color: var(--bleu); }
.leaflet-control-attribution { padding: 2px 6px !important; }
.leaflet-popup-content { font-family: "Source Sans 3", sans-serif; font-size: 13px; margin: 10px 14px; }
.leaflet-popup-content strong { color: var(--bleu); font-size: 15px; }

/* ---------- Téléphone ---------- */
@media (max-width: 820px) {
  .entete { padding: 10px 16px; gap: 10px 14px; flex-wrap: wrap; }
  .marque { font-size: 20px; }
  .titre h1 { font-size: 16px; }
  .recherche { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .entete .cta { order: 4; width: 100%; text-align: center; }
  .encart-cta { flex-direction: column; align-items: stretch; text-align: center; }
  .page {
    display: flex;
    flex-direction: column-reverse;
  }
  .carte-boite { height: 45vh; flex: none; }
  .panneau { border-right: none; overflow: visible; }
  html, body { height: auto; }
  .legende { bottom: 26px; left: 8px; padding: 6px 8px; font-size: 11px; }
  .legende ul { margin-top: 4px; }
  .legende li { line-height: 1.35; }
  .legende .aide { display: none; }
}


/* Légende retirée (5 nov. 2026) : elle masquait une grande partie de la carte, surtout sur téléphone. */
.legende { display: none !important; }
