/* MyProspectio · démonstration des calques de la carte (accueil, page Les calques).
   Reprend la carte et l'interrupteur de la démonstration Tournée, avec les
   couleurs de l'application (DPE officiel, fibre, ventes, profil du quartier). */

:root { --cq-park: #DCE9DE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cq-park: #13241D; } }
:root[data-theme="dark"] { --cq-park: #13241D; }

.cq { padding: clamp(14px, 2vw, 22px); }
.cq-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 2px 4px 16px; }
.cq-hint { font-size: .9375rem; color: var(--ink-2); max-width: 62ch; }
.cq-reset { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 560 .875rem/1 var(--ui, inherit); cursor: pointer; transition: transform .16s var(--ease-out, ease); }
.cq-reset:active { transform: scale(.97); }
.cq-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.cq-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Carte */
.cq-map {
  position: relative; aspect-ratio: 5 / 4; border-radius: 20px; overflow: hidden;
  background-color: var(--map-bg);
  background-image: repeating-linear-gradient(90deg, transparent 0 34px, var(--map-bg) 34px 40px), repeating-linear-gradient(0deg, var(--map-block) 0 26px, var(--map-bg) 26px 32px);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  touch-action: manipulation;
}
.cq-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cq-water { fill: var(--map-water); }
.cq-park { fill: var(--cq-park); }
.cq-road path { fill: none; stroke: var(--map-road); stroke-width: 16; stroke-linecap: round; }
.cq-road-s path { fill: none; stroke: var(--map-road); stroke-width: 5; opacity: .85; }
.cq-street { position: absolute; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); font-size: .6875rem; font-weight: 560; letter-spacing: .02em; color: var(--ink-3); white-space: nowrap; pointer-events: none; }

/* Carrés du profil du quartier (légèrement tournés, comme la grille européenne de l'Insee) */
.cq-grid { position: absolute; inset: -6%; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(7, 1fr); transform: rotate(-3deg); opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.cq-grid.is-on { opacity: 1; pointer-events: auto; }
.cq-cell { border: 0; padding: 0; margin: 0; background: var(--c); opacity: .5; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .55); cursor: pointer; transition: background-color .35s ease, opacity .2s ease; -webkit-tap-highlight-color: transparent; }
.cq-cell:hover { opacity: .62; }
.cq-cell.is-sel { opacity: .75; box-shadow: inset 0 0 0 2px var(--ink); }

/* Secteur du jour */
.cq-sect { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .4s ease; }
.cq-sect.is-on { opacity: 1; }
.cq-sect path { fill: color-mix(in srgb, #0E9488 12%, transparent); stroke: #0E9488; stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 2 0; }
.cq-sect-label { position: absolute; left: 6%; top: 47%; padding: 5px 10px; border-radius: 9px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--glass-line); font-size: .75rem; font-weight: 600; color: #0F766E; opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s var(--ease-out, ease); pointer-events: none; white-space: nowrap; }
.cq-sect-label.is-on { opacity: 1; transform: none; }

/* Points des calques */
.cq-pt {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--surface); background: var(--c); color: var(--k, #fff);
  font: 750 .6875rem/1 var(--ui, inherit);
  box-shadow: 0 2px 6px rgba(20, 32, 44, .25);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .25s var(--ease-out, ease), opacity .25s ease;
}
.cq-pt::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.cq-pt:active { transform: scale(.9); }
.cq-pt.is-hidden { opacity: 0; transform: scale(.4); pointer-events: none; }
.cq-pt.is-sel { box-shadow: 0 0 0 3px var(--ink), 0 3px 10px rgba(20, 32, 44, .3); z-index: 4; }
.cq-pt--fibre { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 1.5px; font-size: 0; z-index: 1; }
.cq-pt--fibre.is-fort { width: 16px; height: 16px; margin: -8px 0 0 -8px; z-index: 2; }
.cq-pt--dpe { z-index: 3; }
.cq-pt--vente { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 6px; border-width: 2.5px; font-size: 0; z-index: 3; }

.cq-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 6px; font-size: .8125rem; color: var(--ink-2); min-height: 20px; }
.cq-legend li { display: inline-flex; align-items: center; gap: 7px; }
.cq-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.cq-legend i.sq { border-radius: 3px; }
.cq-legend .cq-empty { color: var(--ink-3); }

/* Panneau des calques */
.cq-panel { display: flex; flex-direction: column; gap: 10px; }
.cq-cibles { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); border-left: 4px solid #0E9488; }
.cq-cibles b { font-size: .9375rem; }
.cq-cibles p { font-size: .875rem; color: var(--ink-2); }
.cq-cibles button { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--page); color: var(--ink); font: 560 .8438rem/1 var(--ui, inherit); cursor: pointer; transition: transform .16s var(--ease-out, ease), background-color .2s ease; }
.cq-cibles button:active { transform: scale(.97); }
.cq-cibles button[aria-pressed="true"] { background: var(--brand-wash); border-color: color-mix(in srgb, var(--brand) 55%, transparent); color: var(--brand-ink); }
.cq-layers { display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; }
.cq-layer { padding: 12px 16px; border-top: 1px solid var(--line-2); }
.cq-layer:first-child { border-top: 0; }
.cq-layer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cq-layer-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cq-layer-t b { font-size: .9375rem; font-weight: 600; }
.cq-layer-t span { font-size: .8125rem; color: var(--ink-3); }
.cq-state { margin-top: 6px; font-size: .8125rem; font-weight: 600; color: var(--brand-ink); }
.cq-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cq-filters[hidden] { display: none; }
.cq-filters button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-inline: 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 560 .8125rem/1 var(--ui, inherit); cursor: pointer; white-space: nowrap; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .16s var(--ease-out, ease); }
.cq-filters button:active { transform: scale(.97); }
.cq-filters button[aria-pressed="true"] { background: var(--brand-wash); border-color: color-mix(in srgb, var(--brand) 55%, transparent); color: var(--brand-ink); }
.cq-filters i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cq-scale { display: flex; align-items: center; gap: 3px; flex-basis: 100%; margin-top: 2px; font-size: .75rem; color: var(--ink-3); }
.cq-scale i { width: 16px; height: 10px; border-radius: 2px; background: var(--c); opacity: .8; }
.cq-scale span { margin-left: 6px; }

/* Interrupteur (même dessin que la démonstration Tournée) */
.cq-switch { display: inline-flex; align-items: center; border: 0; background: none; padding: 4px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cq-switch-k { position: relative; width: 42px; height: 26px; border-radius: 999px; background: var(--tile-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .25s ease; flex: none; }
.cq-switch-k::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(20, 32, 44, .3); transition: transform .3s var(--ease-out, ease); }
.cq-switch[aria-checked="true"] .cq-switch-k { background: var(--brand); box-shadow: none; }
.cq-switch[aria-checked="true"] .cq-switch-k::after { transform: translateX(16px); }

/* Fiche de l'adresse touchée */
.cq-card { padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 6px; min-height: 92px; }
.cq-card.swap { animation: cq-in .35s var(--ease-out, ease); }
@keyframes cq-in { from { opacity: 0; transform: translateY(6px); } }
.cq-card-h { font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.cq-card-t { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.cq-card ul { display: flex; flex-direction: column; gap: 5px; }
.cq-card li { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--ink-2); }
.cq-card li i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.cq-card li i.sq { border-radius: 3px; }
.cq-card li .dpe { min-width: 22px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; background: var(--c); color: var(--k, #fff); font-size: .6875rem; font-weight: 750; }
.cq-card .cq-muted { color: var(--ink-3); font-size: .8125rem; }

@media (max-width: 920px) {
  .cq-body { grid-template-columns: 1fr; }
  /* Sur téléphone, la fiche de l'adresse touchée vient juste sous la carte. */
  .cq-panel { display: contents; }
  .cq-col { order: 1; }
  .cq-card { order: 2; }
  .cq-cibles { order: 3; }
  .cq-layers { order: 4; }
}
@media (max-width: 600px) {
  .cq-pt { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-width: 1.5px; font-size: .5625rem; }
  .cq-pt--fibre { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-width: 1px; }
  .cq-pt--fibre.is-fort { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
  .cq-pt--vente { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 4px; border-width: 2px; }
  .cq-street { font-size: .5625rem; }
  .cq-sect-label { font-size: .6875rem; padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .cq-pt, .cq-grid, .cq-cell, .cq-sect, .cq-sect-label, .cq-card.swap { transition: none; animation: none; }
}

/* Accueil : carte pleine largeur des pages produit */
.card.w12 { grid-column: 1 / -1; }
@media (min-width: 921px) {
  .card.w12 { min-height: 360px; flex-direction: row; }
  .card.w12 .card-copy { max-width: 44ch; }
  .card.w12 .card-art { min-height: 0; }
  .card.w12 .card-art .peek { left: auto; right: 12%; transform: none; }
}
