/**
 * LocatorPress Frontend CSS
 * 
 * BEM-Architektur (.lp-).
 * Vollständig responsive, modern, geschmeidig und kompatibel mit allen Themes und Page-Buildern (Elementor etc.).
 * Alle Kommentare sind auf Deutsch verfasst, um den Vorgaben zu entsprechen.
 */

:root {
	/* Standard-Farbpalette (wird durch das Theme-Color-System dynamisch im Wrapper überschrieben) */
	--lp-primary: #2563eb;
	--lp-primary-rgb: 37, 99, 235;
	--lp-secondary: #f1f5f9;
	--lp-text-dark: #0f172a;
	--lp-text-light: #64748b;
	--lp-border-color: #e2e8f0;
	--lp-bg-white: #ffffff;
	--lp-bg-sidebar: #f8fafc;
	--lp-success: #10b981;
	--lp-danger: #ef4444;
	
	/* Schatten- und Elevation-System für Premium SaaS-Look */
	--lp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--lp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	--lp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
	--lp-shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	
	/* Radien und Übergänge */
	--lp-radius-sm: 6px;
	--lp-radius-md: 10px;
	--lp-radius-lg: 16px;
	--lp-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Haupt-Container */
.lp-container {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--lp-text-dark);
	background: var(--lp-bg-white);
	border: 1px solid var(--lp-border-color);
	border-radius: var(--lp-radius-lg);
	box-shadow: var(--lp-shadow-lg);
	overflow: hidden;
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 30px;
}

.lp-container * {
	box-sizing: border-box;
}

/* 1. SUCHLEISTE (SEARCH BAR) */
.lp-search-bar {
	display: flex;
	padding: 24px;
	background: var(--lp-bg-white);
	border-bottom: 1px solid var(--lp-border-color);
	gap: 16px;
	align-items: center;
	flex-wrap: wrap;
}

.lp-search-field {
	flex: 1;
	min-width: 200px;
	position: relative;
}

/* Stichwortsuche Input */
.lp-search-field--keyword input {
	width: 100%;
	padding: 12px 16px 12px 42px;
	border: 1.5px solid var(--lp-border-color);
	border-radius: var(--lp-radius-md);
	font-size: 14px;
	font-weight: 500;
	transition: var(--lp-transition);
	background: var(--lp-bg-white);
	color: var(--lp-text-dark);
	height: 48px;
	line-height: normal;
}

.lp-search-field--keyword input:focus {
	border-color: var(--lp-primary);
	box-shadow: 0 0 0 4px rgba(var(--lp-primary-rgb), 0.1);
	outline: none;
}

.lp-search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--lp-text-light);
	font-size: 18px;
	pointer-events: none;
}

/* Dropdown / Select-Felder */
.lp-search-field--select select {
	width: 100%;
	padding: 0 16px;
	border: 1.5px solid var(--lp-border-color);
	border-radius: var(--lp-radius-md);
	font-size: 14px;
	font-weight: 500;
	height: 48px;
	background: var(--lp-bg-white);
	color: var(--lp-text-dark);
	transition: var(--lp-transition);
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 16px;
	padding-right: 40px;
}

.lp-search-field--select select:focus {
	border-color: var(--lp-primary);
	box-shadow: 0 0 0 4px rgba(var(--lp-primary-rgb), 0.1);
	outline: none;
}

.lp-search-actions {
	display: flex;
	gap: 12px;
	align-items: center;
}

/* Buttons */
.lp-btn {
	height: 48px;
	padding: 0 26px;
	border-radius: var(--lp-radius-md);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--lp-transition);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	white-space: nowrap;
}

/* Primärer Suchen-Button */
.lp-btn--primary {
	background: var(--lp-primary);
	color: #ffffff;
}

.lp-btn--primary:hover {
	background: var(--lp-primary);
	opacity: 0.95;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(var(--lp-primary-rgb), 0.25);
}

.lp-btn--primary:active {
	transform: translateY(0);
}

/* Sekundärer Ortungs-Button ("Near Me") */
.lp-btn--secondary {
	background: #f1f5f9;
	background: rgba(var(--lp-primary-rgb), 0.08);
	color: var(--lp-primary);
	padding: 0 16px;
	border: 1px solid rgba(var(--lp-primary-rgb), 0.1);
}

.lp-btn--secondary:hover {
	background: #e2e8f0;
	background: rgba(var(--lp-primary-rgb), 0.15);
	color: var(--lp-primary);
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(var(--lp-primary-rgb), 0.1);
}

.lp-btn--secondary:active {
	transform: translateY(0);
}

.lp-btn--secondary .dashicons,
.lp-btn--secondary i {
	font-size: 20px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit !important; /* Schutz vor globalen Overrides */
}

/* 2. SIDEBAR & CARD LAYOUT */
.lp-layout {
	display: flex;
	height: 100%;
	flex-wrap: wrap;
}

/* Seitenleiste (Sidebar) */
.lp-sidebar {
	flex: 0 0 380px;
	max-width: 380px;
	background: var(--lp-bg-sidebar);
	border-right: 1px solid var(--lp-border-color);
	display: flex;
	flex-direction: column;
	max-height: 100%;
}

.lp-results-header {
	padding: 18px 24px;
	background: var(--lp-bg-sidebar);
	border-bottom: 1px solid var(--lp-border-color);
}

.lp-results-count {
	font-size: 13px;
	font-weight: 700;
	color: var(--lp-text-light);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Ergebnisse-Liste */
.lp-results-list {
	overflow-y: auto;
	flex: 1;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	height: calc(100% - 54px);
	min-height: 450px;
}

/* Premium Scrollbar für die Sidebar */
.lp-results-list::-webkit-scrollbar {
	width: 6px;
}

.lp-results-list::-webkit-scrollbar-track {
	background: transparent;
}

.lp-results-list::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.lp-results-list::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Kartenbereich */
.lp-map-view {
	flex: 1;
	min-width: 300px;
	position: relative;
	background: #f1f5f9;
}

/* 3. STANDORT-KARTEN (LOCATION CARDS) */
.lp-card {
	background: var(--lp-bg-white);
	border: 1.5px solid var(--lp-border-color);
	border-radius: var(--lp-radius-lg);
	padding: 18px;
	display: flex;
	gap: 16px;
	cursor: pointer;
	transition: var(--lp-transition);
	box-shadow: var(--lp-shadow-sm);
	position: relative;
	overflow: hidden;
}

/* Hover-Status der Karte */
.lp-card:hover {
	border-color: rgba(var(--lp-primary-rgb), 0.3);
	box-shadow: var(--lp-shadow-premium);
	transform: translateY(-2px);
}

/* Aktiver/Fokussierter Status der Karte */
.lp-card--active {
	border-color: var(--lp-primary);
	box-shadow: var(--lp-shadow-premium), 0 0 0 3px rgba(var(--lp-primary-rgb), 0.12);
	transform: translateY(-2px);
	background: var(--lp-bg-white);
}

/* Eleganter linker Akzentstreifen für aktive Karten */
.lp-card--active::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: var(--lp-primary);
	border-top-left-radius: var(--lp-radius-lg);
	border-bottom-left-radius: var(--lp-radius-lg);
}

/* Karten-Bild/Icon-Behälter (Beseitigt verschwommenes Grau-in-Grau) */
.lp-card-media {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: var(--lp-radius-md);
	overflow: hidden;
	background: #f1f5f9;
	background: rgba(var(--lp-primary-rgb), 0.08);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(var(--lp-primary-rgb), 0.15);
	transition: var(--lp-transition);
}

.lp-card:hover .lp-card-media,
.lp-card--active .lp-card-media {
	background: rgba(var(--lp-primary-rgb), 0.12);
	border-color: rgba(var(--lp-primary-rgb), 0.25);
}

.lp-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Fallback Store-Icon */
.lp-card-fallback-img {
	color: var(--lp-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1 !important;
}

.lp-card-fallback-img .dashicons,
.lp-card-fallback-img i {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: var(--lp-primary) !important; /* Schutz vor globalen Overrides */
	display: flex;
	align-items: center;
	justify-content: center;
}

.lp-card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.lp-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 6px;
}

/* Titel des Standorts (Stark hervorgehoben) */
.lp-card-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
	color: var(--lp-text-dark);
	line-height: 1.4;
}

/* Entfernungs-Badge */
.lp-card-distance {
	font-size: 11px;
	font-weight: 700;
	background: rgba(var(--lp-primary-rgb), 0.08);
	color: var(--lp-primary);
	padding: 4px 8px;
	border-radius: var(--lp-radius-sm);
	white-space: nowrap;
}

/* Adresse (Hoher Kontrast, hervorragend lesbar) */
.lp-card-address {
	font-size: 13px;
	color: var(--lp-text-light);
	margin: 0 0 10px 0;
	line-height: 1.5;
}

/* Öffnungszeiten-Badge (SaaS-Pill-Design) */
.lp-card-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 8px;
	width: fit-content;
	margin-bottom: 14px;
}

.lp-status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

/* Status: Geöffnet */
.lp-card-status--open {
	background: rgba(16, 185, 129, 0.08);
	color: #059669;
	border: 1px solid rgba(16, 185, 129, 0.15);
}

.lp-card-status--open .lp-status-dot {
	background: #10b981;
}

/* Status: Geschlossen */
.lp-card-status--closed {
	background: rgba(239, 68, 68, 0.08);
	color: #dc2626;
	border: 1px solid rgba(239, 68, 68, 0.15);
}

.lp-card-status--closed .lp-status-dot {
	background: #ef4444;
}

/* Card-Footer für Kontaktschnelllinks */
.lp-card-footer {
	display: flex;
	gap: 10px;
	border-top: 1px solid var(--lp-border-color);
	padding-top: 12px;
	margin-top: auto;
}

/* Action-Buttons (Optimiertes 38px Touch-Target mit hohem Kontrast) */
.lp-card-link {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--lp-primary);
	background: #f1f5f9;
	background: rgba(var(--lp-primary-rgb), 0.05);
	border: 1px solid rgba(var(--lp-primary-rgb), 0.1);
	transition: var(--lp-transition);
	cursor: pointer;
	padding: 0;
}

.lp-card-link:hover {
	background: var(--lp-primary);
	color: #ffffff;
	border-color: var(--lp-primary);
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(var(--lp-primary-rgb), 0.2);
}

.lp-card-link:active {
	transform: translateY(-1px) scale(0.95);
}

.lp-card-link .dashicons,
.lp-card-link i {
	font-size: 16px;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit !important; /* Schutz vor globalen Overrides */
}

/* 4. DYNAMIC LOADER & PLACEHOLDERS */
.lp-loader-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
	width: 100%;
}

.lp-pulse-loader {
	width: 40px;
	height: 40px;
	background: var(--lp-primary);
	border-radius: 50%;
	opacity: 0.6;
	animation: lp-pulse 1.2s infinite ease-in-out;
}

@keyframes lp-pulse {
	0% {
		transform: scale(0);
		opacity: 0.8;
	}
	100% {
		transform: scale(1);
		opacity: 0;
	}
}

/* 5. POPUP BALLOON (MAP) */
.lp-popup {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 240px;
	padding: 4px;
}

.lp-popup-image {
	width: 100%;
	height: 110px;
	overflow: hidden;
	border-radius: var(--lp-radius-md);
	margin-bottom: 10px;
	background: #f1f5f9;
}

.lp-popup-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lp-popup-title {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 6px 0;
	color: var(--lp-text-dark);
}

.lp-popup-address {
	font-size: 12px;
	color: var(--lp-text-light);
	margin: 0 0 10px 0;
	line-height: 1.4;
}

.lp-popup-phone {
	font-size: 12px;
	margin: 0 0 12px 0;
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--lp-text-dark);
}

.lp-popup-btn {
	background: var(--lp-primary);
	color: #ffffff !important;
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	border-radius: var(--lp-radius-sm);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: var(--lp-transition);
}

.lp-popup-btn:hover {
	opacity: 0.9;
	box-shadow: 0 3px 8px rgba(var(--lp-primary-rgb), 0.2);
}

.lp-popup-btn .dashicons,
.lp-popup-btn i {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: inherit !important; /* Schutz vor globalen Overrides */
}

/* Leaflet Popup Fixes für SaaS Design */
.leaflet-popup-content-wrapper {
	border-radius: var(--lp-radius-lg) !important;
	box-shadow: var(--lp-shadow-lg) !important;
	padding: 8px !important;
	border: 1px solid var(--lp-border-color);
}

.leaflet-popup-tip-container {
	margin-top: -1px;
}

.leaflet-popup-tip {
	box-shadow: var(--lp-shadow-md) !important;
	border: 1px solid var(--lp-border-color);
}

/* Zoom-Tasten & Kartensteuerelemente-Design */
.leaflet-bar {
	border: none !important;
	box-shadow: var(--lp-shadow-md) !important;
	border-radius: var(--lp-radius-md) !important;
	overflow: hidden;
}

.leaflet-bar a, 
.leaflet-bar a:hover {
	background: #ffffff !important;
	color: var(--lp-text-dark) !important;
	border-bottom: 1px solid var(--lp-border-color) !important;
	transition: var(--lp-transition);
	width: 34px !important;
	height: 34px !important;
	line-height: 34px !important;
	font-size: 16px !important;
}

.leaflet-bar a:hover {
	background: #f8fafc !important;
	color: var(--lp-primary) !important;
}

.leaflet-bar a:first-child {
	border-top-left-radius: var(--lp-radius-md) !important;
	border-top-right-radius: var(--lp-radius-md) !important;
}

.leaflet-bar a:last-child {
	border-bottom-left-radius: var(--lp-radius-md) !important;
	border-bottom-right-radius: var(--lp-radius-md) !important;
	border-bottom: none !important;
}

/* 6. RESPONSIVE OPTIMIERUNGEN */
@media (max-width: 992px) {
	.lp-sidebar {
		flex: 0 0 320px;
		max-width: 320px;
	}
}

@media (max-width: 768px) {
	.lp-search-bar {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
		gap: 12px;
	}
	
	.lp-search-field {
		width: 100%;
	}
	
	.lp-search-actions {
		width: 100%;
		justify-content: stretch;
	}
	
	.lp-search-actions button {
		flex: 1;
	}
	
	.lp-layout {
		flex-direction: column-reverse;
	}
	
	.lp-sidebar {
		flex: 1;
		max-width: 100%;
		border-right: none;
		border-top: 1px solid var(--lp-border-color);
	}
	
	.lp-results-list {
		min-height: 300px;
		max-height: 400px;
		padding: 16px;
	}
	
	.lp-card {
		padding: 14px;
	}
}

/* 7. CUSTOM PIN STYLES FÜR FONT AWESOME MARKER */
.lp-marker-pin-wrapper {
	position: relative;
	width: 32px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lp-marker-pin-svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
	transition: var(--lp-transition);
}

.lp-marker-pin-icon {
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	z-index: 2;
	pointer-events: none;
	line-height: 1;
}

.lp-marker-pin-icon i {
	font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif !important;
	font-weight: 900 !important;
	font-style: normal !important;
	color: inherit !important; /* Erzwungene Farb-Vererbung zum Schutz vor Theme-CSS */
	font-size: 13px;
	width: auto;
	height: auto;
	line-height: 1;
	display: block;
}

/* Hover-Effekte auf Marker */
.lp-marker-pin-wrapper:hover .lp-marker-pin-svg {
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
	transform: scale(1.05);
}

