/* ==========================================================================
   BMR Camper & Motorrad Suchformular
   Design an World Wide Wheels angelehnt – über CSS-Variablen anpassbar.
   ========================================================================== */

.bmr-search {
	--bmr-primary: #e8590c;
	--bmr-primary-hover: #c94b06;
	--bmr-btn-text: #ffffff;
	--bmr-text: #1f2933;
	--bmr-field-bg: #ffffff;
	--bmr-form-bg: #ffffff;
	--bmr-border: #d7dee5;
	--bmr-radius: 10px;
	--bmr-muted: #6b7684;

	box-sizing: border-box;
	max-width: 100%;
	color: var(--bmr-text);
	font-family: inherit;
	background: var(--bmr-form-bg);
	border: 1px solid var(--bmr-border);
	border-radius: calc(var(--bmr-radius) + 4px);
	padding: 18px;
	box-shadow: 0 6px 24px rgba(20, 30, 45, 0.08);
}

/* Optionales Hintergrundbild (Panel-Ton + Abdunklung + Bild) */
.bmr-search.bmr-has-bg {
	background: var(--bmr-bg-image) center / cover no-repeat;
	padding: 26px;
}

.bmr-search *,
.bmr-search *::before,
.bmr-search *::after {
	box-sizing: border-box;
}

.bmr-title {
	margin: 0 0 14px;
	font-size: 1.25rem;
	line-height: 1.3;
	color: var(--bmr-text);
}

/* --- Fahrzeugtyp-Umschalter (Motorrad / Wohnmobil) --- */
.bmr-vehicle-toggle {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 14px;
	background: rgba(0, 0, 0, 0.04);
	border-radius: 999px;
}

.bmr-vehicle-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	padding: 9px 20px;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--bmr-muted);
	background: transparent;
	border-radius: 999px;
	transition: all 0.15s ease;
	font-family: inherit;
}

.bmr-vehicle-btn:hover {
	color: var(--bmr-text);
}

.bmr-vehicle-btn.is-active {
	background: var(--bmr-primary);
	color: var(--bmr-btn-text);
	box-shadow: 0 2px 6px rgba(20, 30, 45, 0.18);
}

/* --- Stationen-Reihe (Übernahme + Rückgabe-Schalter) --- */
.bmr-locations {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 20px;
	margin-bottom: 10px;
}

.bmr-locations .bmr-field-pickup {
	flex: 1 1 340px;
	min-width: 0;
}

.bmr-dropoff-check {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	font-size: 0.92rem;
	color: var(--bmr-text);
	cursor: pointer;
	white-space: nowrap;
	user-select: none;
}

.bmr-dropoff-check input {
	width: 18px;
	height: 18px;
	accent-color: var(--bmr-primary);
	cursor: pointer;
}

/* Rückgabestation, erscheint erst bei aktiviertem Schalter */
.bmr-dropoff-wrap {
	margin-bottom: 10px;
}

.bmr-dropoff-wrap .bmr-field-pickup {
	max-width: 360px;
}

/* --- Felder-Grid (Daten, Personen, Alter, Button) --- */
.bmr-fields {
	display: grid;
	gap: 10px;
	align-items: end;
}

/* Suchleiste (horizontal) auf Desktop */
.bmr-layout-bar .bmr-fields {
	grid-template-columns: 1fr 1fr 0.8fr 0.9fr auto;
}

/* Gestapelt / kompakt */
.bmr-layout-stacked .bmr-fields {
	grid-template-columns: 1fr;
}

.bmr-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.bmr-field > label {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--bmr-muted);
	margin: 0 0 5px 2px;
}

/* Einheitliches Aussehen aller Eingabefelder */
.bmr-search input[type="text"],
.bmr-search input[type="date"],
.bmr-search select,
.bmr-combo-input {
	width: 100%;
	height: 48px;
	padding: 0 12px;
	font-size: 0.95rem;
	color: var(--bmr-text);
	background: var(--bmr-field-bg);
	border: 1px solid var(--bmr-border);
	border-radius: var(--bmr-radius);
	font-family: inherit;
	line-height: 1.2;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.bmr-search select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7684' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 32px;
	cursor: pointer;
}

.bmr-search input:focus,
.bmr-search select:focus,
.bmr-combo-input:focus {
	outline: none;
	border-color: var(--bmr-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bmr-primary) 22%, transparent);
}

/* --- Städte-Combobox --- */
.bmr-combo {
	position: relative;
}

.bmr-combo-input {
	cursor: text;
	text-overflow: ellipsis;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 12px center;
	padding-left: 34px;
}

.bmr-combo-disabled .bmr-combo-input {
	background-color: #f4f6f8;
	cursor: not-allowed;
	opacity: 0.75;
}

.bmr-combo-panel {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--bmr-border);
	border-radius: var(--bmr-radius);
	box-shadow: 0 12px 32px rgba(20, 30, 45, 0.18);
	overflow: hidden;
	display: none;
}

.bmr-combo.is-open .bmr-combo-panel {
	display: block;
}

.bmr-combo-search {
	padding: 8px;
	border-bottom: 1px solid var(--bmr-border);
}

.bmr-combo-search input {
	height: 40px !important;
}

.bmr-combo-list {
	max-height: 260px;
	overflow-y: auto;
	list-style: none;
	margin: 0;
	padding: 4px;
}

.bmr-combo-list li {
	padding: 10px 12px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.93rem;
	color: var(--bmr-text);
}

.bmr-combo-list li:hover,
.bmr-combo-list li.is-highlighted {
	background: color-mix(in srgb, var(--bmr-primary) 12%, transparent);
}

.bmr-combo-list li.is-empty {
	color: var(--bmr-muted);
	cursor: default;
	text-align: center;
}

.bmr-combo-list li.is-empty:hover {
	background: transparent;
}

/* --- Button --- */
.bmr-field-submit {
	justify-content: flex-end;
}

.bmr-submit {
	position: relative;
	appearance: none;
	border: 0;
	cursor: pointer;
	height: 48px;
	padding: 0 26px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--bmr-btn-text);
	background: var(--bmr-primary);
	border-radius: var(--bmr-radius);
	white-space: nowrap;
	transition: background 0.15s ease, transform 0.05s ease;
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
}

.bmr-submit:hover {
	background: var(--bmr-primary-hover);
}

.bmr-submit:active {
	transform: translateY(1px);
}

.bmr-submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.bmr-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: var(--bmr-btn-text);
	border-radius: 50%;
	animation: bmr-spin 0.7s linear infinite;
}

.bmr-search.is-loading .bmr-spinner {
	display: inline-block;
}

@keyframes bmr-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --- Meldungen --- */
.bmr-message {
	display: none;
	margin-top: 12px;
	padding: 11px 14px;
	border-radius: var(--bmr-radius);
	font-size: 0.9rem;
	line-height: 1.4;
}

.bmr-message.is-visible {
	display: block;
}

.bmr-message.is-error {
	background: #fdecec;
	color: #a12020;
	border: 1px solid #f4c4c4;
}

.bmr-message.is-info {
	background: #eef4fb;
	color: #1d4e79;
	border: 1px solid #cfe0f2;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
	.bmr-layout-bar .bmr-fields {
		grid-template-columns: 1fr 1fr 1fr;
	}
	.bmr-layout-bar .bmr-field-submit {
		grid-column: 1 / -1;
	}
}

@media (max-width: 640px) {
	.bmr-search {
		padding: 14px;
	}
	.bmr-layout-bar .bmr-fields,
	.bmr-layout-stacked .bmr-fields {
		grid-template-columns: 1fr 1fr;
	}
	.bmr-field-submit {
		grid-column: 1 / -1;
	}
	.bmr-locations .bmr-field-pickup,
	.bmr-dropoff-check {
		flex: 1 1 100%;
	}
	.bmr-dropoff-check {
		height: auto;
	}
	.bmr-dropoff-wrap .bmr-field-pickup {
		max-width: none;
	}
	.bmr-vehicle-toggle {
		display: flex;
		width: 100%;
	}
	.bmr-vehicle-btn {
		flex: 1;
		text-align: center;
		padding: 11px 8px;
	}
}

@media (max-width: 400px) {
	.bmr-layout-bar .bmr-fields,
	.bmr-layout-stacked .bmr-fields {
		grid-template-columns: 1fr;
	}
}

/* Ausgeblendete Felder/Hinweise zuverlässig verstecken (überschreibt display:flex). */
.bmr-search .bmr-field[hidden],
.bmr-search .bmr-age-note[hidden] {
	display: none !important;
}

/* Hinweis zum Fahreralter 18–20 bei Motorrädern. */
.bmr-age-note {
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.35;
	color: #b45309;
}
