/**
 * Styles front du bloc Carte Interactive.
 * Les couleurs sont pilotées par des variables CSS injectées en JS
 * (voir front-map.js) depuis la palette du thème WordPress actif.
 */

.ci-carte-wrapper {
	--ci-primary: #2271b1;
	--ci-secondary: #2271b1;
	--ci-background: #ffffff;
	--ci-text: #1e1e1e;

	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: inherit;
	color: var(--ci-text);
}

/* Barre d'outils (recherche + filtre) */
.ci-carte-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.ci-carte-search {
	flex: 1 1 240px;
}

.ci-search-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	font-size: 15px;
	background: var(--ci-background);
	color: var(--ci-text);
}

.ci-search-input:focus {
	outline: none;
	border-color: var(--ci-primary);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--ci-primary) 25%, transparent);
}

.ci-carte-filter {
	flex: 0 0 auto;
}

.ci-category-filter {
	padding: 10px 14px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	font-size: 15px;
	background: var(--ci-background);
	color: var(--ci-text);
}

/* Corps : sidebar + carte */
.ci-carte-body {
	display: flex;
	gap: 0;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	overflow: hidden;
}

.ci-carte-map {
	flex: 1 1 auto;
	min-height: 300px;
	width: 100%;
}

.ci-carte-sidebar {
	flex: 0 0 300px;
	max-height: 600px;
	overflow-y: auto;
	background: var(--ci-background);
	border-right: 1px solid #d0d5dd;
}

@media (max-width: 768px) {
	.ci-carte-wrapper.has-sidebar .ci-carte-body {
		flex-direction: column;
	}
	.ci-carte-sidebar {
		flex-basis: auto;
		max-height: 240px;
		border-right: none;
		border-bottom: 1px solid #d0d5dd;
		order: 2;
	}
	.ci-carte-map {
		order: 1;
	}
}

.ci-points-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ci-points-list-loading,
.ci-points-list-empty {
	padding: 16px;
	color: #667085;
	font-size: 14px;
	text-align: center;
}

.ci-point-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid #eef0f2;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.ci-point-item:hover,
.ci-point-item.is-active {
	background-color: color-mix(in srgb, var(--ci-primary) 8%, transparent);
}

.ci-point-item-icon {
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 14px;
}

.ci-point-item-content {
	flex: 1 1 auto;
	min-width: 0;
}

.ci-point-item-name {
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ci-point-item-category {
	font-size: 12px;
	color: #667085;
}

/* Marqueurs Leaflet custom (DivIcon) */
.ci-leaflet-marker {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	border: 2px solid #fff;
	font-size: 15px;
}

/* Popup Leaflet : on garde la charte du thème */
.leaflet-popup-content-wrapper {
	border-radius: 6px;
}

.ci-popup-title {
	font-weight: 700;
	margin-bottom: 6px;
	font-size: 15px;
}

.ci-popup-category {
	font-size: 12px;
	color: #667085;
	margin-bottom: 8px;
}

.ci-popup-action {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 4px;
	background: var(--ci-primary);
	color: #fff !important;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

.ci-popup-action:hover {
	background: var(--ci-secondary);
	color: #fff !important;
}

/* Clusters : on teinte avec la couleur primaire du thème */
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
	background-color: color-mix(in srgb, var(--ci-primary) 75%, white) !important;
	color: #fff !important;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
	background-color: color-mix(in srgb, var(--ci-primary) 35%, transparent) !important;
}
