/**
 * WW Standortfinder – Frontend.
 *
 * Alle Farben und Abstände laufen über CSS-Variablen und lassen sich im
 * Child-Theme überschreiben, ohne diese Datei anzufassen.
 */

.ww-standortfinder {
	--ww-accent: #2f6f4f;
	--ww-accent-contrast: #ffffff;
	/* Wird je Kategorie per Inline-Style gesetzt, siehe Shortcode::inline_style(). */
	--ww-marker: #4a5568;
	--ww-border: #e2e5e9;
	--ww-muted: #61686f;
	--ww-surface: #ffffff;
	--ww-surface-alt: #f6f7f8;
	--ww-radius: 6px;
	--ww-gap: 24px;
	--ww-map-height: 600px;
	--ww-image-height: 100px;
	--ww-image-fit: cover;

	box-sizing: border-box;
	color: inherit;
}

.ww-standortfinder *,
.ww-standortfinder *::before,
.ww-standortfinder *::after {
	box-sizing: border-box;
}

/* Werkzeugleiste ---------------------------------------------------------- */

.ww-standortfinder__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.ww-standortfinder__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ww-standortfinder__tab {
	appearance: none;
	background: var(--ww-surface-alt);
	border: 1px solid var(--ww-border);
	border-radius: var(--ww-radius);
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	line-height: 1.2;
	padding: 12px 20px;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ww-standortfinder__tab:hover,
.ww-standortfinder__tab:focus-visible {
	border-color: var(--ww-accent);
}

.ww-standortfinder__tab.is-active {
	background: var(--ww-accent);
	border-color: var(--ww-accent);
	color: var(--ww-accent-contrast);
}

.ww-standortfinder__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ww-standortfinder__search {
	display: block;
}

.ww-standortfinder__search-input {
	background: var(--ww-surface);
	border: 1px solid var(--ww-border);
	border-radius: var(--ww-radius);
	font: inherit;
	font-size: 16px;
	min-width: 220px;
	padding: 11px 14px;
}

.ww-standortfinder__search-input:focus {
	border-color: var(--ww-accent);
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.ww-standortfinder__nearby {
	appearance: none;
	background: var(--ww-surface);
	border: 1px solid var(--ww-border);
	border-radius: var(--ww-radius);
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	padding: 12px 18px;
}

.ww-standortfinder__nearby:hover:not(:disabled),
.ww-standortfinder__nearby.is-active {
	border-color: var(--ww-accent);
	color: var(--ww-accent);
}

.ww-standortfinder__nearby:disabled {
	cursor: progress;
	opacity: 0.6;
}

.ww-standortfinder__message {
	background: var(--ww-surface-alt);
	border-radius: var(--ww-radius);
	margin: 0 0 16px;
	padding: 12px 16px;
}

.ww-standortfinder__message[hidden] {
	display: none;
}

/* Grundraster ------------------------------------------------------------- */

.ww-standortfinder__body {
	display: grid;
	gap: var(--ww-gap);
	grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
	align-items: start;
}

.ww-standortfinder--list .ww-standortfinder__body,
.ww-standortfinder--map .ww-standortfinder__body {
	grid-template-columns: minmax(0, 1fr);
}

.ww-standortfinder--map .ww-standortfinder__list-wrap {
	display: none;
}

/* Karte ------------------------------------------------------------------- */

.ww-standortfinder__map-wrap {
	position: relative;
	background: var(--ww-surface-alt);
	border: 1px solid var(--ww-border);
	border-radius: var(--ww-radius);
	overflow: hidden;
	height: var(--ww-map-height);
}

.ww-standortfinder__map {
	width: 100%;
	height: 100%;
}

.ww-standortfinder__consent {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: var(--ww-surface-alt);
	text-align: center;
}

.ww-standortfinder__consent[hidden] {
	display: none;
}

.ww-standortfinder__consent-inner {
	max-width: 460px;
}

.ww-standortfinder__consent-headline {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.3;
}

.ww-standortfinder__consent-text {
	color: var(--ww-muted);
	font-size: 15px;
	line-height: 1.5;
}

.ww-standortfinder__consent-text p:last-child {
	margin-bottom: 0;
}

.ww-standortfinder__consent-button {
	appearance: none;
	background: var(--ww-accent);
	border: 0;
	border-radius: var(--ww-radius);
	color: var(--ww-accent-contrast);
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	margin-top: 18px;
	padding: 13px 26px;
}

.ww-standortfinder.is-map-loading .ww-standortfinder__map-wrap::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--ww-surface-alt);
	opacity: 0.6;
}

/* Liste ------------------------------------------------------------------- */

.ww-standortfinder__list-wrap {
	max-height: var(--ww-map-height);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.ww-standortfinder--list .ww-standortfinder__list-wrap {
	max-height: none;
	overflow: visible;
}

.ww-standortfinder__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}

.ww-standortfinder--list .ww-standortfinder__list {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.ww-loc {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	background: var(--ww-surface);
	border: 1px solid var(--ww-border);
	border-left: 4px solid var(--ww-marker);
	border-radius: var(--ww-radius);
	padding: 16px;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ww-loc:hover,
.ww-loc.is-active {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ww-loc.is-active {
	border-color: var(--ww-accent);
}

.ww-loc[hidden] {
	display: none;
}

/* Bild sitzt als Kopfzeile über dem Inhalt, nicht daneben. */
.ww-loc--has-image {
	gap: 12px;
}

.ww-loc__media img {
	display: block;
	width: 100%;
	height: var(--ww-image-height);
	object-fit: var(--ww-image-fit);
	object-position: center;
	border-radius: var(--ww-radius);
}

.ww-loc__content {
	min-width: 0;
}

.ww-loc__title {
	margin: 0 0 2px;
	font-size: 18px;
	line-height: 1.3;
}

.ww-loc__focus {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	padding: 0;
	text-align: left;
}

.ww-loc__focus:hover {
	color: var(--ww-accent);
}

.ww-loc__subtitle {
	margin: 0 0 6px;
	color: var(--ww-muted);
	font-size: 14px;
}

.ww-loc__address {
	margin: 0 0 8px;
	line-height: 1.45;
}

.ww-loc__distance {
	margin: 0 0 8px;
	color: var(--ww-accent);
	font-size: 14px;
	font-weight: 600;
}

.ww-loc__distance[hidden] {
	display: none;
}

.ww-loc__contact {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	font-size: 15px;
	line-height: 1.5;
}

.ww-loc__contact a {
	color: inherit;
	text-decoration: none;
}

.ww-loc__contact a:hover {
	color: var(--ww-accent);
	text-decoration: underline;
}

.ww-loc__hours {
	margin: 0 0 8px;
}

.ww-loc__hours-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.ww-loc__hours-list {
	margin: 0;
	font-size: 15px;
}

.ww-loc__hours-row {
	display: flex;
	gap: 10px;
	line-height: 1.5;
}

.ww-loc__hours-row dt {
	flex: 0 0 auto;
	min-width: 74px;
	font-weight: 600;
}

.ww-loc__hours-row dd {
	margin: 0;
}

.ww-loc__hours-note,
.ww-loc__note {
	margin: 4px 0 0;
	color: var(--ww-muted);
	font-size: 14px;
}

.ww-loc__actions {
	margin: 10px 0 0;
}

.ww-loc__route {
	display: inline-block;
	color: var(--ww-accent);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.ww-loc__route:hover {
	text-decoration: underline;
}

/* Infofenster ------------------------------------------------------------- */

.ww-infowindow {
	max-width: 260px;
	font-size: 15px;
	line-height: 1.45;
}

.ww-infowindow__image {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 8px;
}

.ww-infowindow__title {
	margin: 0 0 2px;
	font-size: 16px;
	line-height: 1.3;
}

.ww-infowindow__subtitle {
	margin: 0 0 6px;
	color: #61686f;
	font-size: 13px;
}

.ww-infowindow__address,
.ww-infowindow__phone {
	margin: 0 0 6px;
}

.ww-infowindow__hours {
	list-style: none;
	margin: 0 0 6px;
	padding: 0;
	font-size: 14px;
}

.ww-infowindow__actions {
	margin: 0;
}

/* Reaktionsfähigkeit ------------------------------------------------------ */

@media (max-width: 1024px) {
	.ww-standortfinder__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.ww-standortfinder__list-wrap {
		max-height: none;
		overflow: visible;
	}

	.ww-standortfinder__list {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	}
}

@media (max-width: 640px) {
	.ww-standortfinder__toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.ww-standortfinder__filters {
		flex-direction: column;
		align-items: stretch;
	}

	.ww-standortfinder__search-input,
	.ww-standortfinder__nearby {
		width: 100%;
	}

	.ww-standortfinder__map-wrap {
		height: min(var(--ww-map-height), 60vh);
	}

	.ww-standortfinder__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ww-standortfinder * {
		transition: none !important;
	}
}
