/* Carte des établissements partenaires — charte Deep Beauty : noir encre, blanc, Montserrat, grands arrondis. */

.bloc-carte {
	--cp-encre: var(--encre, #1f222b);
	--cp-bordure: var(--bordure-carte, #e5e5e5);
	--cp-texte: var(--texte, #444);
	--cp-police: var(--police-titre, "Montserrat", sans-serif);
	--cp-police-ui: var(--police-ui, "Montserrat", sans-serif);
	--cp-hauteur: clamp(560px, calc(100vh - 150px), 920px); /* la carte et la liste suivent la hauteur de la fenêtre */
	--cp-largeur-bloc: 1840px;                            /* presque toute la largeur de l'écran */
}

/* ---------- Filtres ---------- */
.cp-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; max-width: var(--cp-largeur-bloc); margin: 24px auto 0; padding: 0 24px; }
.cp-recherche, .cp-select {
	width: 100%;
	padding: 14px 18px;
	border: 1px solid var(--cp-bordure);
	border-radius: 50px;
	background: #fff;
	font-family: var(--cp-police);
	font-size: 16px;
	color: var(--cp-encre);
}
/* Tous les filtres sur une ligne ; ils passent à la ligne seulement quand l'écran est trop étroit. */
.cp-filtres > .cp-lieu { flex: 1 1 280px; }
.cp-filtres > .cp-type { flex: 0 1 240px; }
.cp-technos { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-techno {
	padding: 8px 16px;
	border: 1px solid var(--cp-encre);
	border-radius: 50px;
	background: #fff;
	font-family: var(--cp-police-ui);
	font-weight: 600;
	font-size: 13px;
	color: var(--cp-encre);
	cursor: pointer;
}
.cp-techno.est-actif { background: var(--cp-encre); color: #fff; }

/* ---------- Liste à gauche, carte à droite ---------- */
.cp-cadre {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 24px;
	max-width: var(--cp-largeur-bloc);
	margin: 22px auto 0;
	padding: 0 24px;
}

.cp-panneau { display: flex; flex-direction: column; height: var(--cp-hauteur); min-height: 0; }
.cp-compte { flex: none; margin: 0 0 12px; font-family: var(--cp-police); font-weight: 300; font-size: 14px; color: var(--cp-texte); }
.cp-liste { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 16px; margin: 0; padding: 0 6px 0 0; overflow-y: auto; list-style: none; }
/* Fiche façon Airbnb : grande photo arrondie en haut, texte dessous. */
.cp-fiche { display: block; padding: 0 0 16px; overflow: hidden; border: 1px solid var(--cp-bordure); border-radius: 16px; background: #fff; transition: box-shadow 0.2s; }
.cp-fiche:hover { box-shadow: 0 10px 28px rgba(15, 18, 28, 0.12); }
.cp-fiche[hidden] { display: none; }
.cp-fiche > :not(.cp-photo-cadre) { margin-left: 18px; margin-right: 18px; }
.cp-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; margin-bottom: 14px; object-fit: cover; background: #ececec; }
.cp-photo-vide { display: grid; place-items: center; color: #9a9ea8; }
.cp-fiche h3 { margin: 0 0 4px; font-family: var(--cp-police); font-weight: 600; font-size: 16px; color: var(--cp-encre); }
.cp-fiche-nom { padding: 0; border: 0; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.cp-fiche-nom:hover { text-decoration: underline; }
.cp-fiche-adresse { margin: 0; font-family: var(--cp-police); font-weight: 300; font-size: 14px; line-height: 1.5; color: var(--cp-texte); }
.cp-fiche-contact { display: grid; gap: 2px; margin-top: 8px; margin-bottom: 0; padding: 0; list-style: none; }
.cp-fiche-contact a { font-family: var(--cp-police); font-weight: 600; font-size: 14px; color: var(--cp-encre); text-decoration: underline; overflow-wrap: anywhere; }
.cp-fiche-techno { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.cp-fiche-techno li { padding: 3px 10px; border: 1px solid var(--cp-encre); border-radius: 50px; font-family: var(--cp-police-ui); font-weight: 600; font-size: 11px; color: var(--cp-encre); }
.cp-vide { margin: 0; font-family: var(--cp-police); font-size: 14px; color: var(--cp-texte); }

.cp-carte {
	position: relative;
	z-index: 0; /* garde les couches de Leaflet sous l'en-tête et le menu */
	height: var(--cp-hauteur);
	overflow: hidden;
	border-radius: var(--rayon-carte, 20px);
	background: #ececec;
	box-shadow: 0 0 0 1px var(--cp-bordure), 0 24px 60px rgba(15, 18, 28, 0.16);
	touch-action: pan-y; /* le doigt fait défiler la page ; deux doigts zooment la carte */
}

/* Fond de carte en niveaux de gris : la carte prend la teinte noir et blanc du site. */
.cp-carte .leaflet-tile-pane { filter: grayscale(1) contrast(1.05) brightness(1.04); }

/* Repère : pastille noire à cœur blanc, comme les boutons sombres du site. */
.cp-repere {
	position: relative;
	display: block;
	width: 34px;
	height: 34px;
	border: 3px solid #fff;
	border-radius: 50% 50% 50% 0;
	background: var(--cp-encre);
	box-shadow: 0 6px 16px rgba(15, 18, 28, 0.4);
	transform: rotate(-45deg);
	transition: transform 0.2s;
}
.cp-repere::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.leaflet-marker-icon:hover .cp-repere,
.leaflet-marker-icon:focus-visible .cp-repere { transform: rotate(-45deg) scale(1.12); }
.leaflet-marker-icon:focus-visible { outline: 2px solid var(--cp-encre); outline-offset: 4px; border-radius: 50%; }

/* Info-bulle courte. */
.cp-carte .leaflet-popup-content-wrapper { overflow: hidden; }
.cp-bulle-photo { display: block; width: calc(100% + 36px); max-width: none; aspect-ratio: 4 / 3; margin: -16px -18px 12px; object-fit: cover; }
.cp-carte .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 14px 40px rgba(15, 18, 28, 0.28); }
.cp-carte .leaflet-popup-content { margin: 16px 18px; font-family: var(--cp-police); color: var(--cp-texte); }
.cp-bulle-nom { margin: 0 0 6px; font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--cp-encre); }
.cp-bulle-adresse { margin: 0; font-weight: 300; font-size: 14px; line-height: 1.5; }
.cp-bulle-tel { display: block; margin-top: 8px; overflow-wrap: anywhere; font-weight: 600; font-size: 14px; color: var(--cp-encre); text-decoration: underline; }
.cp-bulle-techno { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.cp-bulle-techno li { padding: 4px 10px; border-radius: 50px; background: var(--cp-encre); font-family: var(--cp-police-ui); font-weight: 600; font-size: 11px; color: #fff; }

.cp-carte .leaflet-control-zoom a { color: var(--cp-encre); }
.cp-carte .leaflet-control-attribution { font-size: 11px; }

/* ---------- Tablette et téléphone : la carte passe au-dessus de la liste ---------- */
@media (max-width: 1100px) {
	.bloc-carte { --cp-hauteur: 520px; }
	.cp-cadre { grid-template-columns: 1fr; }
	.cp-carte { order: -1; }
	.cp-panneau { height: auto; }
	.cp-liste { max-height: 640px; overflow-y: auto; padding-right: 6px; } /* sans plafond, 126 fiches empilées feraient une page interminable */
}
@media (max-width: 700px) {
	.bloc-carte { --cp-hauteur: 460px; }
	.cp-liste { max-height: 560px; }
	.cp-filtres, .cp-cadre { padding: 0 16px; }
	.cp-liste { grid-template-columns: 1fr; }
}

/* Le message « aucun résultat » se place juste sous le compteur, avant la liste (qui occupe toute la hauteur restante). */
.cp-compte { order: 0; }
.cp-vide { order: 1; margin-bottom: 12px; }
.cp-liste { order: 2; }

/* Pastille de regroupement : même noir que les repères, chiffre blanc. */
.cp-grappe span {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--cp-encre);
	box-shadow: 0 6px 16px rgba(15, 18, 28, 0.4);
	font-family: var(--cp-police-ui);
	font-weight: 600;
	font-size: 14px;
	color: #fff;
}

/* Carte juste sous le bandeau d'en-tête : le haut de la section recouvre déjà le bandeau (--recouvrement), on n'ajoute qu'un souffle. */
.bloc.bloc-carte { padding-top: calc(var(--recouvrement, 50px) + 24px); }
.bloc-carte .cp-filtres { margin-top: 0; }

/* ---------- Logos des machines ---------- */
.cp-logo-img { display: block; width: auto; height: var(--cp-hauteur-logo, 16px); max-width: 100%; }
/* Bouton de filtre à logo : le logo (noir) devient blanc quand le bouton est actif (fond noir). */
.cp-techno.cp-techno-logo { display: inline-flex; align-items: center; padding-top: 9px; padding-bottom: 9px; }
.cp-techno.cp-techno-logo.est-actif .cp-logo-img { filter: invert(1); }
/* Fiche : le logo remplace le nom dans la pastille. */
.cp-fiche-techno li.cp-logo { display: flex; align-items: center; padding: 6px 12px; }
.cp-fiche-techno li.cp-logo .cp-logo-img { --cp-hauteur-logo: 14px; }
/* Bulle : pastille noire, logo blanc. */
.cp-bulle-techno li.cp-logo { display: flex; align-items: center; padding: 6px 12px; }
.cp-bulle-techno li.cp-logo .cp-logo-img { --cp-hauteur-logo: 12px; filter: invert(1); }

/* La fiche entière est cliquable : la main le signale ; les liens d'appel et d'e-mail gardent leur propre curseur. */
.cp-fiche { cursor: pointer; }
.cp-fiche a, .cp-fiche-actions, .cp-fiche-actions button { cursor: pointer; }

/* Cadre de la photo : il masque tout dépassement et porte l'espace de 14 px sous l'image. */
.cp-photo-cadre { overflow: hidden; margin-bottom: 14px; }
.cp-photo-cadre .cp-photo { margin-bottom: 0; }

/* Au survol (souris seulement), la fiche entière grossit légèrement et passe au premier plan.
   La liste défile (overflow) : sa marge intérieure de 10 px, compensée par une marge extérieure négative, laisse la place de grossir sans rogner la fiche. */
.cp-liste { padding: 10px; margin: -10px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.cp-fiche { position: relative; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s; }
	.cp-fiche:hover { z-index: 2; transform: scale(1.03); box-shadow: 0 14px 34px rgba(15, 18, 28, 0.18); }
}
