/* Red Moto Händlerverzeichnis
 * Farben im Theme überschreibbar, z. B.:
 * .rmh { --rmh-accent: #c8102e; }
 */
.rmh {
	--rmh-accent: #d6001c;
	--rmh-accent-dark: #a30015;
	--rmh-accent-soft: #fff4f5;
	--rmh-muted: #666;
	--rmh-line: #e2e2e2;
	--rmh-bg: #fff;
	--rmh-hover: #f7f7f7;
	--rmh-radius: 10px;
	container: rmh / inline-size;
	margin: 1.5em 0;
	font: inherit;
	color: inherit;
}
.rmh *, .rmh *::before, .rmh *::after { box-sizing: border-box; }
.rmh button { font: inherit; cursor: pointer; }
.rmh__sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.rmh__inner {
	display: grid;
	grid-template-columns: minmax(280px, 380px) 1fr;
	height: var(--rmh-h, 600px);
	border: 1px solid var(--rmh-line);
	border-radius: var(--rmh-radius);
	overflow: hidden;
	background: var(--rmh-bg);
}

/* ---------- Seitenleiste ---------- */
.rmh__side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rmh-line); }
.rmh__tools { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--rmh-line); }

.rmh__search { display: block; margin: 0; }
.rmh__search input {
	width: 100%; margin: 0; padding: 10px 12px;
	border: 1px solid var(--rmh-line); border-radius: 8px;
	background: #fff; color: inherit; font: inherit; line-height: 1.3;
}
.rmh__search input:focus { outline: 2px solid var(--rmh-accent); outline-offset: -1px; border-color: transparent; }

.rmh__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.rmh__filters { display: flex; flex-wrap: wrap; gap: 4px; }
.rmh__chip {
	display: inline-flex; align-items: center; gap: 6px;
	margin: 0; padding: 6px 12px;
	border: 1px solid var(--rmh-line); border-radius: 999px;
	background: #fff; color: inherit;
	font-size: .85em !important; line-height: 1.2; text-transform: none; letter-spacing: 0;
}
.rmh__chip:hover { border-color: var(--rmh-accent); }
.rmh__chip[aria-pressed="true"] { background: var(--rmh-accent); border-color: var(--rmh-accent); color: #fff; }
.rmh__near.is-loading { opacity: .6; cursor: progress; }
.rmh__status { margin: 0; font-size: .8em; color: var(--rmh-muted); }
.rmh__status:empty { display: none; }

/* ---------- Liste ---------- */
.rmh__list {
	position: relative; flex: 1; min-height: 0;
	margin: 0; padding: 0; list-style: none;
	overflow-y: auto; overscroll-behavior: contain;
}
.rmh__item {
	position: relative; margin: 0; padding: 14px 16px 14px 18px;
	border-bottom: 1px solid var(--rmh-line);
	cursor: pointer; transition: background-color .15s;
}
.rmh__item::before {
	content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
	background: transparent; transition: background-color .15s;
}
.rmh__item:hover { background: var(--rmh-hover); }
.rmh__item.is-active { background: var(--rmh-accent-soft); }
.rmh__item.is-active::before { background: var(--rmh-accent); }
.rmh__item[hidden], .rmh__empty[hidden] { display: none; }

.rmh__name { margin: 0 0 4px; padding: 0 64px 0 0; font-size: 1em; line-height: 1.3; font-weight: 700; }
.rmh__focus { all: unset; cursor: pointer; }
.rmh__focus:focus-visible { outline: 2px solid var(--rmh-accent); outline-offset: 2px; border-radius: 2px; }
.rmh__dist { position: absolute; top: 15px; right: 16px; font-size: .8em; color: var(--rmh-muted); font-variant-numeric: tabular-nums; }
.rmh__addr, .rmh__info { margin: 0; font-size: .9em; line-height: 1.45; color: var(--rmh-muted); }
.rmh__info { margin-top: 6px; }

.rmh__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rmh__btn {
	display: inline-flex; align-items: center;
	padding: 5px 10px; border: 1px solid var(--rmh-line); border-radius: 6px;
	background: #fff; color: inherit !important;
	font-size: .8em; line-height: 1.3; text-decoration: none !important;
}
.rmh__btn:hover { border-color: var(--rmh-accent); color: var(--rmh-accent) !important; }
.rmh__btn:focus-visible { outline: 2px solid var(--rmh-accent); outline-offset: 2px; }
.rmh__btn--primary { background: var(--rmh-accent); border-color: var(--rmh-accent); color: #fff !important; }
.rmh__btn--primary:hover { background: var(--rmh-accent-dark); border-color: var(--rmh-accent-dark); color: #fff !important; }

.rmh__empty { padding: 28px 18px; color: var(--rmh-muted); font-size: .9em; text-align: center; }

/* ---------- Karte ---------- */
.rmh__mapwrap { position: relative; min-height: 0; }
.rmh__map { position: absolute; inset: 0; z-index: 0; }
.rmh .leaflet-container { font: inherit; font-size: 14px; background: #eef0f2; }

.rmh__consent {
	position: absolute; inset: 0; z-index: 2;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	padding: 24px; background: #f2f3f4; text-align: center; font-size: .9em; color: var(--rmh-muted);
}
.rmh__consent p { max-width: 34ch; margin: 0; }
.rmh__consent .rmh__btn { font-size: .95em; padding: 9px 18px; }

/* Marker: Tropfenform, Spitze bleibt beim Vergrößern fix */
.rmh-pin { background: none; border: 0; }
.rmh-pin span {
	position: absolute; left: 15px; top: 12px;
	width: 24px; height: 24px;
	background: var(--rmh-accent, #d6001c);
	border: 3px solid #fff; border-radius: 50% 50% 50% 0;
	transform-origin: 0 100%;
	transform: rotate(-45deg);
	box-shadow: -1px 1px 5px rgba(0, 0, 0, .35);
	transition: transform .15s, background-color .15s;
}
.rmh-pin.is-hover span { transform: rotate(-45deg) scale(1.15); }
.rmh-pin.is-active span { transform: rotate(-45deg) scale(1.35); background: var(--rmh-accent-dark, #a30015); }

.rmh .leaflet-popup-content-wrapper { border-radius: 10px; }
.rmh .leaflet-popup-content { margin: 12px 16px; line-height: 1.4; }
.rmh-pop strong { display: block; margin-bottom: 4px; font-size: 1.05em; }
.rmh-pop span { display: block; color: #555; }
.rmh-pop__actions { display: flex; gap: 14px; margin-top: 8px; }
.rmh-pop__actions a { color: var(--rmh-accent) !important; font-weight: 600; text-decoration: none !important; }
.rmh-pop__actions a:hover { text-decoration: underline !important; }

/* ---------- Schmal (Handy oder schmale Inhaltsspalte) ---------- */
@container rmh (max-width: 760px) {
	.rmh__inner { grid-template-columns: 1fr; height: auto; }
	.rmh__mapwrap { order: -1; height: min(60vh, 420px); border-bottom: 1px solid var(--rmh-line); }
	.rmh__side { border-right: 0; }
	.rmh__list { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
	.rmh *, .rmh-pin span { transition: none !important; }
}
