/* Carte des zones A bis / A / B1 / B2 / C (maquette Katia, 2/11/2026), guide Zones et simulateur PTZ. Noms préfixés z-
   (le site a déjà une classe .pastille).
   Une couleur par zone, de la plus tendue à la moins tendue : A bis rose, A orange, B1 bleu, B2 ciel, C sable (calme,
   car C couvre presque tout le territoire). Les boutons de zone servent aussi de légende (pas de légende en double). */
:root { --z-Abis: #ff5fa2; --z-A: #ff8a1f; --z-B1: #1d5bd8; --z-B2: #9fd8ff; --z-C: #e6dcc6; --z-eteint: #f3ede0; }

.zones { display: grid; gap: 16px; }
.zones > h2 { font-size: clamp(28px, 7vw, 40px); }

/* Recherche : l'usage principal sur téléphone, en tête */
.z-recherche { position: relative; display: grid; gap: 6px; }
.z-recherche label { font-weight: 700; font-size: 15px; }
.z-recherche .ligne { display: flex; background: var(--blanc); border: var(--dur); border-radius: 999px; box-shadow: var(--ombre-sticker); overflow: hidden; }
.z-recherche input { flex: 1; min-width: 0; min-height: 56px; border: 0; padding: 0 8px 0 22px; font-size: 18px; background: transparent; outline: none; }
.z-recherche .ligne:focus-within { outline: 3px solid var(--bleu); outline-offset: 2px; }
.z-recherche .loupe { flex: none; width: 56px; display: grid; place-items: center; background: var(--citron); border: 0; border-left: var(--dur); cursor: pointer; }
.z-recherche .loupe .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.z-sugg { position: absolute; z-index: 6; top: calc(100% + 8px); left: 0; right: 0; background: var(--blanc); border: var(--dur); border-radius: 22px; box-shadow: var(--ombre-sticker); overflow: hidden; }
.z-sugg[hidden] { display: none; }
.z-sugg [role="option"] { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 18px; border: 0; background: none; text-align: left; cursor: pointer; }
.z-sugg [role="option"] + [role="option"] { border-top: 1px solid var(--ton-2); }
.z-sugg [role="option"][aria-selected="true"], .z-sugg [role="option"]:hover { background: var(--ton); }
.z-sugg b { display: block; font-size: 17px; }
.z-sugg small { color: var(--encre-2); font-size: 14px; }
.z-sugg .z-pastille { margin-left: auto; }

/* Pastille d'une zone (sert dans les suggestions, la fiche, l'étiquette) */
.z-pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 30px; padding: 0 10px; border-radius: 999px;
  border: 2px solid var(--encre); font-weight: 800; font-size: 15px; white-space: nowrap; background: var(--zc); color: var(--zt, var(--encre)); }
[data-zone="Abis"] { --zc: var(--z-Abis); } [data-zone="A"] { --zc: var(--z-A); } [data-zone="B1"] { --zc: var(--z-B1); --zt: var(--blanc); }
[data-zone="B2"] { --zc: var(--z-B2); } [data-zone="C"] { --zc: var(--z-C); }

/* Fiche de la commune trouvée : la réponse, avant la carte */
.z-fiche { background: var(--blanc); border: var(--dur); border-radius: 24px; box-shadow: var(--ombre-sticker); padding: 18px 18px 20px; display: grid; gap: 12px; }
.z-fiche[hidden] { display: none; }
.z-fiche .z-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.z-fiche h3 { flex: 1; min-width: 0; font-size: 26px; letter-spacing: -.035em; line-height: 1.05; }
.z-fiche h3 small { display: block; font: 600 15px/1.4 var(--texte); letter-spacing: 0; color: var(--encre-2); margin-top: 4px; }
.z-fiche .grande { flex: none; margin-top: 2px; height: 44px; min-width: 88px; font-size: 20px; padding: 0 14px; transform: rotate(-3deg); box-shadow: 3px 3px 0 var(--encre); }
.z-fiche p { font-size: 16px; line-height: 1.45; }
.z-fiche .btn { width: 100%; padding: 0 16px; font-size: 16px; }
.z-fiche .fermer { border: 0; background: none; min-width: 44px; min-height: 44px; margin: -10px -10px 0 0; cursor: pointer; display: grid; place-items: center; }
@media (min-width: 900px) { .z-fiche { grid-template-columns: 1fr auto; align-items: center; column-gap: 24px; padding: 22px 24px; } .z-fiche .z-tete { grid-column: 1 / -1; grid-row: 1; } .z-fiche .btn { width: auto; grid-column: 2; grid-row: 2; } .z-fiche p { grid-row: 2; } }

/* Boutons de zone = légende (couleur, nom, nombre de communes) */
.z-boutons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.z-boutons button { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; min-height: 56px; padding: 6px 10px; border: var(--dur);
  border-radius: 18px; background: var(--blanc); cursor: pointer; text-align: left; line-height: 1.1; }
.z-boutons button i { grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--encre); background: var(--zc); }
.z-boutons button b { font-size: 17px; font-weight: 800; }
.z-boutons button small { font-size: 13px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.z-boutons button[aria-pressed="true"] { background: var(--encre); color: var(--creme); box-shadow: 3px 3px 0 var(--zc, var(--citron)); }
.z-boutons button[aria-pressed="true"] small { color: var(--nuit-2); }
.z-boutons .toutes i { background: conic-gradient(var(--z-Abis) 0 20%, var(--z-A) 0 40%, var(--z-B1) 0 60%, var(--z-B2) 0 80%, var(--z-C) 0); }
@media (min-width: 700px) { .z-boutons { grid-template-columns: repeat(6, 1fr); } }

/* La carte : dessinée dans un canvas (34 875 formes, fluide sur téléphone) ; couleurs lues dans les variables ci-dessus */
.z-carte { position: relative; background: var(--creme); border: var(--dur); border-radius: 24px; overflow: hidden; aspect-ratio: 1 / .93; max-height: 72vh; }
.z-carte canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.z-carte.zoom canvas { touch-action: none; }
.z-carte canvas:active { cursor: grabbing; }
.z-attente { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--encre-2); }
.z-attente[hidden] { display: none; }
.z-outils { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.z-outils button { width: 44px; height: 44px; border: var(--dur); border-radius: 50%; background: var(--blanc); font: 800 22px/1 var(--titre); cursor: pointer; display: grid; place-items: center; box-shadow: 2px 2px 0 var(--encre); }
.z-retour { position: absolute; left: 10px; top: 10px; min-height: 44px; padding: 0 16px; border: var(--dur); border-radius: 999px; background: var(--blanc); font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 2px 2px 0 var(--encre); }
.z-retour[hidden] { display: none; }
.z-etiquette { position: absolute; z-index: 4; pointer-events: none; background: var(--encre); color: var(--creme); padding: 7px 12px; border-radius: 12px; font-size: 15px; font-weight: 700; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); }
.z-etiquette[hidden] { display: none; }
.z-etiquette .z-pastille { height: 24px; font-size: 13px; margin-left: 6px; min-width: 0; border-color: var(--creme); }

/* Outre-mer : une bande de 5 petites cartes ; un toucher ouvre le territoire dans la grande carte */
.z-om { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--marge)); padding: 0 var(--marge) 6px; }
@media (min-width: 900px) { .z-om { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; } }
.z-om button { display: grid; gap: 4px; padding: 6px 4px 8px; border: var(--dur); border-radius: 16px; background: var(--creme); cursor: pointer; min-height: 44px; }
.z-om button[aria-pressed="true"] { background: var(--encre); color: var(--creme); }
.z-om canvas { width: 100%; height: 54px; display: block; }
.z-om button[aria-pressed="true"] canvas { background: var(--creme); border-radius: 10px; }
.z-om span { font-size: 13px; font-weight: 700; line-height: 1.1; text-align: center; }
@media (min-width: 900px) { .z-om canvas { height: 84px; } .z-om span { font-size: 14px; } .z-om { gap: 10px; } }

/* Ce que veut dire chaque zone (replié) ; source ; liste des communes */
.z-sens { background: var(--ton); border-radius: 22px; }
.z-sens summary { list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 0 18px; font-weight: 700; cursor: pointer; }
.z-sens summary::-webkit-details-marker { display: none; }
.z-sens dl { padding: 0 18px 16px; display: grid; gap: 12px; font-size: 16px; line-height: 1.45; }
.z-sens dt { font-weight: 800; display: flex; gap: 8px; align-items: center; }
.z-source { font-size: 14px; line-height: 1.5; color: var(--encre-2); }
.z-source a { color: var(--bleu-texte); font-weight: 700; }
.z-liste { display: grid; gap: 10px; }
.z-liste h3 { font-size: 24px; letter-spacing: -.035em; }
.z-liste > p { font-size: 16px; color: var(--encre-2); }
.z-liste details { background: var(--blanc); border-radius: 16px; }
.z-liste details:nth-of-type(even) { background: var(--ton); }
.z-liste summary { list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 52px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.z-liste summary::-webkit-details-marker { display: none; }
.z-liste summary small { color: var(--encre-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.z-liste details p { padding: 0 16px 14px; font-size: 15px; line-height: 1.6; }
.z-liste .plus { justify-self: start; }
.z-note { padding: 0 18px 16px; font-size: 15px; font-weight: 700; }
.z-groupe { display: grid; gap: 10px; }
.z-groupe[hidden], .z-liste-toutes[hidden] { display: none; }
.z-liste .z-groupe > p { font-size: 16px; color: var(--encre-2); }

/* Simulateur PTZ : champ « Votre commune » au-dessus des boutons de zone (le choix manuel reste possible) */
.p-commune .z-recherche .ligne { box-shadow: none; border: 0; border-radius: 0; }
.p-commune .z-recherche .loupe { border-left: 0; }
.p-commune .z-recherche input { min-height: 54px; padding-left: 18px; font-size: 17px; }
.p-trouve { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 15px; font-weight: 600; }
.p-trouve[hidden] { display: none; }
.p-trouve .ok { width: 26px; height: 26px; border-radius: 50%; background: var(--citron); border: 2px solid var(--encre); display: grid; place-items: center; flex: none; }
.p-trouve .ok .ico { width: 16px; height: 16px; stroke-width: 3; }
.p-commune .z-recherche input:focus { outline: none; }
.p-trouve > span:last-child:not(.z-pastille) { flex-basis: 100%; font-weight: 400; color: var(--encre-2); }
.bascule label.auto { box-shadow: inset 0 0 0 3px var(--citron); }
