.clx-wrapper {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	font-family: inherit;
}

.clx-sidebar {
	flex: 0 0 322px;
	max-width: 100%;
	background: #fff;
	border-radius: 12px;
	padding: 20px;
	box-sizing: border-box;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
	border: 1px solid #eef0f2;
}

.clx-filter-group {
	margin-bottom: 22px;
	padding-bottom: 22px;
	border-bottom: 1px solid #eef0f2;
}

.clx-filter-group:last-of-type {
	border-bottom: none;
	margin-bottom: 12px;
	padding-bottom: 0;
}

.clx-filter-group h3 {
	margin: 0 0 12px;
	padding-left: 10px;
	border-left: 3px solid #2271b1;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #333;
}

.clx-filter-group label:not(.clx-filter-checkbox) {
	display: block;
	font-size: 12px;
	color: #777;
	margin-top: 10px;
}

.clx-filter-group input[type="date"],
.clx-filter-group input[type="search"] {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	margin-top: 4px;
	border: 1px solid #dcdfe3;
	border-radius: 6px;
	font-size: 13px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clx-filter-group input[type="date"]:focus,
.clx-filter-group input[type="search"]:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

.clx-filter-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	padding: 4px 6px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	color: #444;
	transition: background 0.15s ease;
}

.clx-filter-checkbox:hover {
	background: #f5f7fa;
}

.clx-filter-checkbox input[type="checkbox"] {
	accent-color: #2271b1;
	width: 15px;
	height: 15px;
}

.clx-swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	flex-shrink: 0;
	overflow: hidden;
}

.clx-swatch img {
	width: 14px;
	height: 14px;
	object-fit: contain;
}

.clx-btn-reset {
	width: 100%;
	padding: 9px 10px;
	background: #fff;
	border: 1px solid #dcdfe3;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	cursor: pointer;
	transition: all 0.15s ease;
}

.clx-btn-reset:hover {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.clx-count {
	margin: 12px 0 0;
	font-size: 12px;
	color: #888;
	text-align: center;
}

.clx-results-list {
	margin-top: 10px;
	max-height: 320px;
	overflow-y: auto;
}

.clx-result-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 7px 8px;
	background: none;
	border: none;
	border-radius: 6px;
	text-align: left;
	font-size: 13px;
	color: #333;
	cursor: pointer;
	transition: background 0.15s ease;
}

.clx-result-item:hover {
	background: #f0f4f8;
	color: #2271b1;
}

.clx-result-item .clx-swatch {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.clx-map-container {
	position: relative;
	flex: 1 1 480px;
	min-width: 280px;
}

#clx-map {
	width: 100%;
	height: 100%;
	min-height: var(--clx-map-height, 400px);
	border-radius: 8px;
}

/* Pop-up en superposition plein écran (au-dessus de toute la page, y compris le menu) */
.clx-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	z-index: 999999;
	padding: 70px 24px 24px;
	box-sizing: border-box;
}

.clx-popup-overlay[hidden] {
	display: none;
}

.clx-popup-box {
	position: relative;
	background: #fff;
	max-width: 92%;
	width: 700px;
	max-height: calc(100vh - 100px);
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

.clx-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #444;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.clx-popup-content {
	overflow-y: auto;
	padding: 44px 28px 28px;
}

.clx-popup-title {
	margin-top: 0;
}

.clx-popup-fonctions {
	font-weight: 600;
	color: #555;
	margin: 4px 0;
}

.clx-popup-periode {
	color: #777;
	font-size: 13px;
	margin: 0 0 12px;
}

.clx-popup-image {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 16px;
}

.clx-popup-loading,
.clx-popup-error {
	text-align: center;
	padding: 40px 0;
	color: #666;
}

@media (max-width: 782px) {
	.clx-wrapper {
		flex-direction: column;
	}

	.clx-sidebar {
		flex-basis: auto;
	}

	#clx-map {
		height: var(--clx-map-height, 400px);
	}
}


/* ==========================================================================
   Mode plein écran (par défaut) : occupe toute la largeur et toute la
   hauteur restante sous le menu du thème. Les dimensions exactes sont
   calculées en JavaScript (voir layoutFullscreen), ce CSS gère le reste.
   ========================================================================== */
.clx-wrapper.clx-fullscreen {
	gap: 0;
	flex-wrap: nowrap;
	box-sizing: border-box;
	max-width: none;
	min-height: 420px;
	height: 80vh; /* valeur de repli avant le calcul JS */
}

.clx-fullscreen .clx-sidebar {
	flex: 0 0 clamp(260px, 24vw, 400px);
	height: 100%;
	overflow-y: auto;
	border-radius: 0;
	border: none;
	border-right: 1px solid #e3e6ea;
	box-shadow: 2px 0 14px rgba(0, 0, 0, 0.08);
	z-index: 2;
}

.clx-fullscreen .clx-map-container {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
}

.clx-fullscreen #clx-map {
	height: 100%;
	min-height: 0;
	border-radius: 0;
}

.clx-fullscreen .clx-results-list {
	max-height: none;
	overflow: visible;
}

.clx-sidebar-toggle {
	display: none;
}

@media (max-width: 782px) {
	.clx-fullscreen {
		flex-direction: column;
	}

	.clx-fullscreen .clx-sidebar-toggle {
		display: block;
		flex: 0 0 auto;
		width: 100%;
		padding: 12px 16px;
		background: #2271b1;
		color: #fff;
		border: none;
		font-size: 14px;
		font-weight: 600;
		text-align: left;
		cursor: pointer;
	}

	.clx-fullscreen .clx-sidebar {
		flex: 0 0 auto;
		width: 100%;
		height: auto;
		max-height: 55%;
		border-right: none;
		border-bottom: 1px solid #e3e6ea;
	}

	.clx-fullscreen.clx-sidebar-collapsed .clx-sidebar {
		display: none;
	}

	.clx-fullscreen .clx-map-container {
		flex: 1 1 0;
		width: 100%;
		min-height: 0;
	}

	.clx-fullscreen #clx-map {
		height: 100%;
	}
}

/* Liste des périodes */
.clx-periode-label {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.clx-periode-label small {
	font-size: 11px;
	color: #888;
}

.clx-filter-periode {
	align-items: flex-start;
}

.clx-filter-periode input[type="checkbox"] {
	margin-top: 2px;
}
