/* =====================================================
   DS Vehicle Selector - Front UI (Horizontal Row Layout)
   ===================================================== */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ds-vehicule-selector {
	display: flex;
	flex-direction: row; /* disposition horizontale */
	justify-content: flex-start; /* alignement à gauche */
	align-items: flex-end; /* alignement bas pour les labels */
	gap: 14px;
	padding: 14px 20px;
	background: #0f0f0f;
	border-bottom: 1px solid #2a2a2a;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	box-sizing: border-box;
	flex-wrap: nowrap; /* ⚠️ pour forcer la ligne (pas de wrap) */
}

.ds-vehicule-selector > div {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	flex-direction: row;
	gap: 14px;
	flex: 1 1 auto;
}

.ds-vehicule-selector > div:last-of-type {
	width: fit-content;
	justify-content: flex-end;
	flex: 0 0 auto;
}

/* ===== Fields ===== */
.ds-vehicule-selector .ds-field:not(.ds-action) {
	display: flex;
	flex-direction: column;
}

.ds-vehicule-selector .ds-field.ds-action {
	flex: 0 0 auto;
	margin-left: auto;
}

.ds-vehicule-selector .ds-field {
	display: flex;
	flex-direction: column;
	margin: 0;
	box-sizing: border-box;
}

.ds-vehicule-selector .ds-field:first-of-type:not(.ds-action) {
	width: 230px;
}

.ds-vehicule-selector .ds-field:nth-of-type(2) {
	width: 230px;
}

.ds-vehicule-selector .ds-field:nth-of-type(3) {
	width: 310px;
}

.ds-vehicule-selector .ds-field:nth-of-type(4) {
	width: 200px;
}

.ds-vehicule-selector .ds-field label {
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #bbb;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.ds-vehicule-selector .ds-select {
	max-height: 160px;
	overflow-y: auto;
}

.ds-vehicule-selector select::-webkit-scrollbar {
	width: 6px;
}

.ds-vehicule-selector select::-webkit-scrollbar-thumb {
	background-color: #444;
	border-radius: 3px;
}

.ds-vehicule-selector select::-webkit-scrollbar-thumb:hover {
	background-color: #666;
}

.ds-vehicule-selector .ds-select option {
	overflow-y: scroll;
}

/* ===== Selects & Inputs ===== */
.ds-vehicule-selector .ds-select,
.ds-vehicule-selector select,
.ds-vehicule-selector input[type="text"]:not(.custom-search),
.ds-vehicule-selector input[type="number"] {
	width: 100%;
	font-size: 14px;
	padding: 10px 12px;
	border-radius: 6px;
	border: 1px solid #444;
	background-color: #1a1a1a;
	color: #f5f5f5;
	transition: all 0.25s ease;
	appearance: none;
	box-sizing: border-box;
}

.ds-vehicule-selector select:focus,
.ds-vehicule-selector input:focus:not(.custom-search) {
	outline: none;
	border-color: #e31c26;
	box-shadow: 0 0 0 2px rgba(227, 28, 38, 0.3);
}

.ds-vehicule-selector select:disabled,
.ds-vehicule-selector input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* État visuel de chargement */
.ds-vehicule-selector select.loading {
	opacity: 0.6;
	pointer-events: none;
	background-image: url('/modules/ds_vehicleselector/views/img/spinner.svg');
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 16px 16px;
}

/* ===== Buttons ===== */
.ds-vehicule-selector .ds-btn {
	font-size: 14px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 6px;
	border: none;
	background: linear-gradient(90deg, #e31c26 0%, #c9131d 100%);
	color: #fff;
	cursor: pointer;
	transition: background 0.3s ease, transform 0.15s ease;
	white-space: nowrap;
	align-self: flex-end; /* alignement bas du bouton */
}

.ds-vehicule-selector .ds-btn:hover:not(:disabled) {
	background: linear-gradient(90deg, #ff2d38 0%, #d91420 100%);
	transform: translateY(-1px);
}

.ds-vehicule-selector .ds-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* =====================================================
   DS Vehicle Selector - Custom Select (Dark Theme)
   ===================================================== */
.custom-select-wrapper {
	position: relative;
	display: block;
	width: 100%;
}

.custom-select-trigger {
	width: 100%;
	padding: 10px 12px;
	border-radius: 6px;
	border: 1px solid #444;
	background-color: #1a1a1a;
	color: #f5f5f5;
	cursor: pointer;
	font-size: 14px;
	position: relative;
	transition: all 0.25s ease;
}

.custom-select-trigger::after {
	content: "▼";
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.75em;
	color: #888;
	pointer-events: none;
}

.custom-select-trigger:hover {
	border-color: #666;
}

.custom-options {
	display: none;
	position: absolute;
	width: 100%;
	background: #1a1a1a;
	border: 1px solid #444;
	border-radius: 6px;
	margin-top: 2px;
	max-height: 200px;
	overflow-y: auto;
	z-index: 30;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.custom-options.active {
	display: block;
	width: 100%;
	animation: fadeIn 0.2s ease;
}

.custom-options li {
	padding: 8px 12px;
	cursor: pointer;
	color: #ddd;
}

.custom-options li:hover {
	background-color: #2a2a2a;
	color: #fff;
}

.ds-select {
	display: none; /* Masque le vrai select natif */
}

/* Champ de recherche interne */
.custom-search {
	width: calc(100% - 16px);
	margin: 6px 8px;
	padding: 8px 10px;
	border-radius: 6px;
	border: 1px solid #333;
	background-color: #111;
	color: #f5f5f5;
	font-size: 13px;
	transition: all 0.25s ease;
	box-sizing: border-box;
}

.custom-search::placeholder {
	color: #888;
}

.custom-options::-webkit-scrollbar {
	width: 6px;
}

.custom-options::-webkit-scrollbar-thumb {
	background-color: #444;
	border-radius: 3px;
}

@media (min-width: 1001px) and (max-width: 1200px) {
	.custom-select-trigger {
		font-size: 12px;
		padding: 10px 6px;
	}

	.ds-vehicule-selector .ds-field:first-of-type:not(.ds-action) {
		width: 185px;
	}

	.ds-vehicule-selector .ds-field:nth-of-type(2) {
		width: 195px;
	}

	.ds-vehicule-selector .ds-field:nth-of-type(3) {
		width: 190px;
	}

	.ds-vehicule-selector .ds-field:nth-of-type(4) {
		width: 170px;
	}
}

@media (max-width: 1000px) {
	.ds-vehicule-selector {
		flex-direction: column;
		align-items: stretch;
		flex-wrap: nowrap;
	}

	.ds-vehicule-selector > div {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.ds-vehicule-selector .ds-field,
	.ds-vehicule-selector .ds-field:first-of-type:not(.ds-action),
	.ds-vehicule-selector .ds-field:nth-of-type(2),
	.ds-vehicule-selector .ds-field:nth-of-type(3),
	.ds-vehicule-selector .ds-field:nth-of-type(4) {
		width: 100%;
	}

	.ds-vehicule-selector .ds-field .ds-action {
		width: 100%;
		margin-top: 12px;
		align-self: stretch;
	}
}