.leaflet-popup-content {
	margin: 10px;
	font-family: Arial, sans-serif;
	}

	.leaflet-popup-content h2 {
		margin: 0 0 8px 0;
		font-size: 16px;
	}

	.leaflet-popup-content img {
		width: 100%;
		height: auto;
		border-radius: 4px;
	}

	.leaflet-popup-content a {
		color: #e74c3c;
		text-decoration: none;
	}

	.leaflet-popup-content a:hover {
		text-decoration: underline;
	}

	#list {
		max-height: 600px;   /* ✅ hauteur maximale de la liste */
		overflow-y: auto;    /* ✅ active le scroll vertical */
		overflow-x: hidden;  /* ✅ évite le scroll horizontal */
		padding-right: 5px;  /* ✅ petit espace pour la scrollbar */
		box-sizing: border-box; /* ✅ évite les débordements */
	}


	#list::-webkit-scrollbar {
		width: 6px;
	}

	#list::-webkit-scrollbar-thumb {
		background: #e74c3c;
		border-radius: 3px;
	}

	#list::-webkit-scrollbar-track {
		background: #eee;
	}

	#sidebar {
		max-height: 80vh;
		overflow-y: auto;
		width: 350px !important;
		right: 0;
		transform: translateX(100%);
		transition: transform 0.3s ease;
	}

	#sidebar.open {
		transform: translateX(0);
	}




	#list div {
		background: white;
		border: 1px solid #e0e0e0;   /* léger cadre */
		border-radius: 6px;          /* coins arrondis */
		padding: 8px 10px;
		margin-bottom: 6px;
		cursor: pointer;
		transition: all 0.2s ease;   /* animation fluide */
		width: 100%;
		box-sizing: border-box; /* ✅ très important */
		overflow: hidden;

	}

	#list div:hover {
		background: #f9f9f9;                 /* légère variation */
		border-color: #e74c3c;              /* couleur de ta charte */
		box-shadow: 0 2px 6px rgba(0,0,0,0.15);  /* effet relief */
		transform: translateY(-1px);        /* petit effet lift */
	}



	#list div:active {
		transform: translateY(0);
		box-shadow: 0 1px 3px rgba(0,0,0,0.2);
	}

	#list div {
		font-size: 14px;
		line-height: 1.4;
	}

	#list {
		background: #fafafa;
		padding: 5px;
		border-radius: 8px;
	}


	#btn {
		background: white;
		border-radius: 4px;
		padding: 4px;
		box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	}



	/* état ACTIF */
	#list div.active {
		background: #e74c3c;
		color: white;
		border-color: #e74c3c;
		box-shadow: 0 2px 8px rgba(0,0,0,0.25);
	}


	select {
		margin-right: 10px;
		padding: 5px;
	}






	#btn {
		z-index: 10000 !important;
	}

	#resetBtn {
		z-index: 10000 !important;
	}


	#fullscreenBtn {
		position: absolute;
		top: 125px;
		left: 10px;

		width: 36px;          /* ✅ IMPORTANT */
		height: 36px;         /* ✅ IMPORTANT */

		overflow: hidden;

		display: flex;
		align-items: center;
		justify-content: center;

		background: white;
		border: none;
		border-radius: 4px;
		cursor: pointer;
		box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	}


	#fullscreenBtn {
		position: absolute;
		top: 125px;
		left: 10px;

		width: 36px;
		height: 36px;

		display: flex;
		align-items: center;
		justify-content: center;

		background: white;
		border: none;
		border-radius: 4px;
		cursor: pointer;
		box-shadow: 0 2px 6px rgba(0,0,0,0.2);
		z-index: 10000;
		padding: 0;
	}

	#fullscreenBtn img {
		width: 20px;
		height: 20px;
		display: block;
	}









	#sidebar {
		z-index: 1500;
	}


	.leaflet-container {
		z-index: 1;
	}



	.leaflet-pane,
	.leaflet-top,
	.leaflet-bottom {
		z-index: 1 !important;
	}


	#sidebar {
		pointer-events: auto;
	}

	#sidebar:not(.open) {
		pointer-events: none;  /* ✅ LA CLÉ */
	}

	/* =======================
	POPUP GLOBALE
	======================= */
	.leaflet-popup-content-wrapper {
		width: 700px;
		max-width: 700px;
		border-radius: 8px;
	}

	.leaflet-popup-content {
		width: 100% !important;
		margin: 15px;
		font-family: Arial, sans-serif;
		font-size: 14px;
		line-height: 1.4;
	}

	/* =======================
	TITRE
	======================= */
	.leaflet-popup-content h2 {
		text-align: center;
		margin-bottom: 15px;
		font-size: 30px;
		color: #e63946;

	}

	/* =======================
	STRUCTURE (GRILLE)
	======================= */
	.content_grid2 {
		display: grid;
		grid-template-columns: 260px 1fr;
		gap: 20px;
		align-items: start;
	}

	/* =======================
	IMAGE
	======================= */
	.content_grid2 img {
		width: 100%;
		height: auto;
		display: block;
		border-radius: 4px;
	}

	/* =======================
	TEXTE
	======================= */
	.content_grid2 p {
		margin: 6px 0;
	}

	/* ✅ évite retour à la ligne des labels */
	.content_grid2 strong {
		white-space: nowrap;
	}

	/* =======================
	LIEN
	======================= */
	.content_grid2 a {
		display: inline-block;
		margin-top: 12px;
		color: #1d6fdc;
		text-decoration: none;
	}

	.content_grid2 a:hover {
		text-decoration: underline;
	}


	.content_grid2 div {
		margin-bottom: 6px;
		line-height: 1.4;
	}

	/* très important : empêche le label d’aller à la ligne */
	.content_grid2 strong {
		white-space: nowrap;
	}



	#sidebar.open ~ #map {
		filter: blur(2px);
	}


	#resetBtn img:hover {
		transform: scale(1.1);
		transition: 0.2s;
	}



	#btn img:hover,
	#resetBtn img:hover,
	#fullscreenBtn:hover {
		transform: scale(1.1);
		transition: 0.2s;
	}

	#btn img,
	#resetBtn img {
		width: 28px;
		height: 28px;
	}

	#topbar {
		position: absolute;
		top: 0px;
		left: 0px; /* laisse la place aux boutons */
		z-index: 10000;
		background: white;
		padding: 8px 10px;
		border-radius: 8px;
		box-shadow: 0 2px 8px rgba(0,0,0,0.2);
		display: flex;
		gap: 10px;
		width: 100%;
		box-sizing: border-box;
	}

	#topbar select {
		padding: 5px;
		font-size: 14px;
	}


	#topbar input {
		padding: 5px 8px;
		font-size: 14px;
	}

	#topbar select {
		padding: 5px;
	}

	#count {
		font-size: 13px;
		color: #666;
	}

	#resetTopBtn {
		background: none;
		border: none;
		cursor: pointer;
	}

	#resetTopBtn img {
		width: 28px;
		height: 28px;
	}

	#resetTopBtn img:hover {
		transform: scale(1.1);
		transition: 0.2s;
	}


	.content_grid2 img {
		transition: transform 0.3s ease;
	}

	.content_grid2 img:hover {
		transform: scale(1.05); /* zoom léger */
		opacity: 0.5;
	}


	.content_grid2 div {
		overflow: hidden;
	}

	.dropdown {
		position: relative;
		width: 300px;
	}

	#dropdownBtn {
		padding: 6px 8px;
		background: white;
		border: 1px solid #ccc;
		cursor: pointer;
	}

	.dropdown-content {
		display: none;
		position: absolute;
		background: white;
		border: 1px solid #ccc;
		width: 100%;
		max-height: 450px;
		overflow-y: auto;
		z-index: 2000;
		padding: 5px;
	}

	.dropdown-content label {
		display: block;
		font-size: 12px;
	}

	/* affiché quand actif */
	.dropdown.open .dropdown-content {
		display: block;
	}



	#dropdownBtn::after {
		content: "";
		position: absolute;
		right: 10px;
		top: 50%;
		width: 6px;
		height: 6px;
		border-right: 2px solid #666;
		border-bottom: 2px solid #666;
		transform: translateY(-50%) rotate(45deg);
		pointer-events: none;
		transition: transform 0.2s ease;
	}

	.dropdown.open #dropdownBtn::after {
		transform: translateY(-50%) rotate(-135deg);
	}








	#topbar select,
	#topbar input[type="text"],
	#dropdownBtn {
		height: 30px;
		padding: 4px 8px;
		font-size: 14px;
		box-sizing: border-box;
	}





	#topbar input:not([type="checkbox"]) {
		height: 30px;
		padding: 4px 8px;
	}




	#topbar select {
		position: relative;
		top: 1px;  /* ✅ petit ajustement fin */
	}




	#topbar {
		display: flex;
		align-items: flex-end; /* ✅ ALIGNEMENT PAR LE BAS */
		gap: 10px;
	}





	#dropdownBtn {
		display: flex;
		align-items: center;
	}


	#topbar input[type="text"] {
		line-height: normal;
	}



	#topbar select {
		appearance: none;
		-webkit-appearance: none;
	}





	@media screen and (max-width: 768px) {


		#filterDept {
			text-align: left !important;
		}

		#filterDept label {
			display: block;              /* ✅ ligne entière */
			width: 100%;
			text-align: left !important;
		}

		#filterDept input[type="checkbox"] {
			display: inline-block;
			vertical-align: middle;     /* ✅ alignement avec texte */
			margin-right: 6px;          /* ✅ espace avec le label */
		}



		/* ✅ popup devient plein écran */
		.leaflet-popup {
			position: fixed !important;
			top: 0 !important;
			left: 0 !important;
			width: 100vw !important;
			height: 100vh !important;
			margin: 0 !important;
			transform: none !important;
			z-index: 10000 !important;
		}

		.leaflet-popup-content-wrapper {
			width: 100% !important;
			height: 100% !important;
			border-radius: 0 !important;
		}

		.leaflet-popup-content {
			height: 100%;
			max-height: 100%;
			overflow-y: auto;
			padding: 15px;
			box-sizing: border-box;
		}

		/* ✅ bouton fermer + visible */
		.leaflet-popup-close-button {
			font-size: 24px;
			top: 10px;
			right: 15px;
		}



		.leaflet-popup-pane {
			z-index: 2000 !important;
		}




		.leaflet-popup-content-wrapper {
			touch-action: auto;

			width: 85vw !important;      /* ✅ moins large */
			max-width: 85vw !important;
			border-radius: 6px;

		}


		.leaflet-popup-content {
			max-height: 60vh;
			overflow-y: auto;
		}

		.content_grid2 {
			grid-template-columns: 1fr !important;  /* ✅ une seule colonne */
			gap: 10px;
		}

		.content_grid2 img {
			width: 100%;
			height: auto;

			max-height: 180px;   /* ✅ limite la hauteur */
			object-fit: cover;   /* ✅ évite les images énormes */

		}



		.leaflet-popup-content {
			margin: 10px;
			width: auto !important;
			font-size: 13px;   /* ✅ texte plus compact */
		}



		#topbar {
			flex-direction: column;   /* ✅ empile */
			align-items: stretch;
			width: calc(100% - 20px);
			left: 10px;
			top: 10px;
		}


		.leaflet-popup-content h2 {
			font-size: 16px;   /* ✅ titre plus petit */
			margin-bottom: 10px;
		}


		#topbar select,
		#topbar input,
		#dropdownBtn {
			width: 100%;
			margin-bottom: 5px;
		}


		#sidebar {
			width: 90% !important;
		}



		#mapContainer {
			height: 80vh !important;

			top: 0 !important;
			margin-top: 250px;

		}



		#btn,
		#resetBtn,
		#fullscreenBtn {
			width: 42px;
			height: 42px;
		}


		.leaflet-popup-content-wrapper {
			width: 90vw !important;
			max-width: 90vw;
		}

		.content_grid2 {
			grid-template-columns: 1fr !important;  /* ✅ une colonne */
		}


		#list {
			max-height: 50vh;
		}

	}	




	#mobilePopup {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		background: white;
		z-index: 20000;
		overflow-y: auto;
		padding: 15px;
		box-sizing: border-box;
	}

	#mobilePopup.open {
		display: block;
	}

	/* bouton fermer */
	#mobilePopupClose {
		position: fixed;
		top: 10px;
		right: 15px;
		font-size: 24px;
		cursor: pointer;
		z-index: 20001;
	}


