/* Europlex Dealer Locator — frontend styles
   Uses CSS variables so it can be re-themed from a child theme without
   touching this file: override --edl-* in your theme's stylesheet. */

.edl-locator {
	--edl-primary: #1a5c3a;
	--edl-primary-dark: #123f28;
	--edl-accent: #c8a35a;
	--edl-text: #24292b;
	--edl-muted: #6b7280;
	--edl-border: #e5e7eb;
	--edl-bg: #ffffff;
	--edl-bg-soft: #f7f8f6;
	--edl-radius: 12px;
	--edl-map-height: 75vh;
	--edl-sidebar-width: 340px;
	--edl-font: inherit;

	font-family: var(--edl-font);
	color: var(--edl-text);
	width: 100%;
	box-sizing: border-box;
}

.edl-locator * { box-sizing: border-box; }

.edl-notice {
	background: #fff7e6;
	border: 1px solid #f0c36d;
	color: #7a5b00;
	padding: 12px 16px;
	border-radius: var(--edl-radius);
	margin-bottom: 16px;
	font-size: 14px;
}

/* Full-bleed map wrapper — the map fills the whole box; the filter
   panel and search bar float on top of it rather than sitting beside it. */
.edl-mapwrap {
	position: relative;
	width: 100%;
	height: var(--edl-map-height);
	border-radius: var(--edl-radius);
	overflow: hidden;
	border: 1px solid var(--edl-border);
	box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}

#edl-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: var(--edl-bg-soft);
}

/* Floating filter + results panel — left edge of the map */
.edl-sidebar {
	position: absolute;
	top: 16px;
	left: 16px;
	bottom: 16px;
	width: var(--edl-sidebar-width);
	max-width: calc(100% - 32px);
	background: var(--edl-bg);
	border-radius: var(--edl-radius);
	box-shadow: 0 4px 18px rgba(0,0,0,0.14);
	z-index: 2;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.edl-sidebar-header {
	padding: 16px;
	border-bottom: 1px solid var(--edl-border);
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--edl-bg-soft);
}

.edl-sidebar-header select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--edl-border);
	border-radius: 8px;
	background: var(--edl-bg);
	font-size: 14px;
	color: var(--edl-text);
}

.edl-hint {
	margin: 0;
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--edl-muted);
	font-style: italic;
}

#edl-result-count {
	font-size: 12px;
	font-weight: 600;
	color: var(--edl-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-top: 2px;
}

#edl-list {
	overflow-y: auto;
	flex: 1;
}

/* Floating search box — top-right corner of the map */
.edl-search-overlay {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: flex;
	gap: 8px;
	background: var(--edl-bg);
	padding: 8px;
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.14);
	max-width: calc(100% - 32px);
}

.edl-search-overlay input[type="text"] {
	width: 220px;
	padding: 10px 12px;
	border: 1px solid var(--edl-border);
	border-radius: 8px;
	font-size: 14px;
	background: var(--edl-bg);
}

.edl-search-overlay input[type="text"]:focus {
	outline: none;
	border-color: var(--edl-primary);
	box-shadow: 0 0 0 3px rgba(26, 92, 58, 0.12);
}

.edl-search-overlay button {
	white-space: nowrap;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid var(--edl-primary);
	background: var(--edl-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.edl-search-overlay button:hover { background: var(--edl-primary-dark); }

#edl-geo-btn {
	background: var(--edl-bg) !important;
	color: var(--edl-primary);
	border: 1px solid var(--edl-primary);
}

#edl-geo-btn:hover { background: rgba(26, 92, 58, 0.08) !important; }

/* Dealer cards, inside the floating sidebar list */
.edl-dealer-card {
	padding: 16px 18px;
	border-bottom: 1px solid var(--edl-border);
	cursor: pointer;
	transition: background 0.12s ease;
}

.edl-dealer-card:hover,
.edl-dealer-card.is-active {
	background: rgba(26, 92, 58, 0.06);
}

.edl-dealer-card h3 {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--edl-text);
}

.edl-dealer-card .edl-dist {
	font-size: 12px;
	font-weight: 600;
	color: var(--edl-primary);
	float: right;
}

.edl-dealer-card p {
	margin: 2px 0;
	font-size: 13px;
	color: var(--edl-muted);
	line-height: 1.4;
}

.edl-dealer-card .edl-brands {
	margin-top: 6px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.edl-brand-tag {
	font-size: 12.5px;
	font-weight: 600;
	padding: 4px 11px;
	border-radius: 999px;
	background: var(--edl-primary);
	color: #fff;
	letter-spacing: 0.02em;
}

.edl-dealer-card .edl-actions {
	margin-top: 10px;
	display: flex;
	gap: 8px;
	font-size: 12px;
	flex-wrap: wrap;
}

.edl-dealer-card .edl-actions a {
	color: var(--edl-primary);
	font-weight: 600;
	text-decoration: none;
	padding: 5px 10px;
	border: 1px solid rgba(26, 92, 58, 0.35);
	border-radius: 7px;
	transition: background 0.12s ease, border-color 0.12s ease;
}

.edl-dealer-card .edl-actions a:hover {
	background: rgba(26, 92, 58, 0.08);
	border-color: var(--edl-primary);
	text-decoration: none;
}

.edl-empty-state {
	padding: 40px 20px;
	text-align: center;
	color: var(--edl-muted);
	font-size: 14px;
}

/* Tiny "replay the intro" button — bottom-right corner of the map, only
   rendered when the globe intro is active on this locator instance. */
#edl-intro-replay {
	position: absolute;
	bottom: 14px;
	right: 14px;
	z-index: 5;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: rgba(255, 255, 255, 0.35);
	color: rgba(30, 40, 35, 0.55);
	font-size: 15px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(2px);
	transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
	opacity: 0.6;
}

#edl-intro-replay:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.75);
	color: var(--edl-primary);
}

/* Google Maps InfoWindow content */
.edl-infowindow h4 { margin: 0 0 4px; font-size: 14px; }
.edl-infowindow p { margin: 2px 0; font-size: 12px; color: #555; }

/* Responsive: below tablet width, floating panels don't have room to
   overlay the map without covering most of it — stack everything
   instead: map on top, search bar as its own bar, then the filter +
   list panel underneath, all full width. */
@media (max-width: 860px) {
	.edl-locator { --edl-map-height: 320px; }

	.edl-mapwrap {
		height: auto;
		display: flex;
		flex-direction: column;
		overflow: visible;
		border: none;
		box-shadow: none;
	}

	#edl-map {
		position: static;
		height: var(--edl-map-height);
		order: 1;
		border-radius: var(--edl-radius);
		border: 1px solid var(--edl-border);
	}

	.edl-search-overlay {
		position: static;
		order: 0;
		width: 100%;
		max-width: none;
		margin-bottom: 12px;
		flex-wrap: wrap;
	}

	.edl-search-overlay input[type="text"] {
		width: 100%;
		flex: 1 1 auto;
	}

	.edl-sidebar {
		position: static;
		order: 2;
		width: 100%;
		max-width: none;
		height: auto;
		max-height: 480px;
		margin-top: 12px;
		border: 1px solid var(--edl-border);
		box-shadow: 0 2px 10px rgba(0,0,0,0.04);
	}

	/* At this width .edl-mapwrap becomes an auto-height stack (search bar,
	   map, sidebar list), so a bottom-right absolute button would float
	   below the whole stack instead of over the map — simplest to hide it
	   here rather than reposition it relative to #edl-map specifically. */
	#edl-intro-replay {
		display: none;
	}
}
