.form-item.dept-routing-field {
	position: relative;
	margin-bottom: 1rem;
}

.dept-routing-root {
	position: relative;
}

.dept-routing-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	width: 100%;
	height: 50px;
	padding: 0 1rem;
	background: #fff;
	border: 1px solid #9ca3af;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-family: inherit;
	color: #374151;
	cursor: pointer;
	text-align: left;
	overflow: hidden;
}

/* Une longue sélection (ex. "tout sélectionner", 96 codes) est tronquée sur
   une seule ligne avec un dégradé masquant plutôt que débordée sur plusieurs
   lignes qui casseraient le layout du formulaire. */
.dept-routing-trigger-label {
	flex: 1 1 auto;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	min-width: 0;
}

.dept-routing-root.is-open .dept-routing-trigger {
	border-color: #111827;
}

.dept-routing-trigger-icon {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-right: 2px solid #6b7280;
	border-bottom: 2px solid #6b7280;
	transform: rotate(45deg);
	transition: transform 0.15s;
}

.dept-routing-root.is-open .dept-routing-trigger-icon {
	transform: rotate(-135deg);
}

.dept-routing-panel {
	position: absolute;
	z-index: 20;
	top: calc(100% + 0.25rem);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #9ca3af;
	border-radius: 0.5rem;
	padding: 0.75rem;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.dept-routing-search {
	width: 100%;
	height: 44px;
	padding: 0 0.75rem;
	margin-bottom: 0.5rem;
	border: 1px solid #9ca3af;
	border-radius: 0.5rem;
	font-size: 0.95rem;
	outline: none;
}

.dept-routing-search:focus {
	border-color: #111827;
}

.dept-routing-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: 0.5rem;
	font-size: 0.8rem;
}

.dept-routing-counter {
	color: #6b7280;
}

.dept-routing-check-all,
.dept-routing-uncheck-all {
	background: none;
	border: none;
	padding: 0;
	font-size: 0.8rem;
	font-weight: 400;
	color: #14b8a6;
	text-decoration: underline;
	cursor: pointer;
}

.dept-routing-check-all:hover,
.dept-routing-uncheck-all:hover {
	color: #111827;
}

.wpcf7-form-control-wrap[data-name="departements"] .dept-routing-list.wpcf7-form-control {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	padding: 0.5rem 0.75rem;
	font-size: 0.9rem;
}

.wpcf7-form-control-wrap[data-name="departements"] .wpcf7-list-item {
	display: block;
	margin: 0;
}

.wpcf7-form-control-wrap[data-name="departements"] .wpcf7-list-item > label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: normal;
	cursor: pointer;
}
