/**
 * Events Map Widget Styles
 *
 * Marker accent is driven by a CSS variable on each marker element:
 *   --ecom-map-marker (default red, set via Elementor Marker Color control)
 */

 .ecom-events-map-widget {
	--_ecom-border: #e5e7eb;
	--_ecom-muted: #64748b;
	--_ecom-text: #0f172a;
	--_ecom-subtle-bg: #f8fafc;
	font-family: inherit;
	color: var(--_ecom-text);
}

/* ═══════════════════════════════════════════════════════════════════════
   TOOLBAR
   ═══════════════════════════════════════════════════════════════════════ */

.ecom-map-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	padding: 16px 4px;
	margin-bottom: 12px;
}

.ecom-map-quick-filters { display: flex; gap: 24px; }
.ecom-map-quick-filters--empty { min-height: 1px; }

.ecom-map-qf-btn {
	background: none;
	border: 0;
	padding: 6px 2px;
	font-size: 16px;
	font-weight: 500;
	color: var(--_ecom-muted);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: color .15s, border-color .15s;
}
.ecom-map-qf-btn:hover { color: var(--_ecom-text); }
.ecom-map-qf-btn.is-active {
	color: var(--_ecom-text);
	border-bottom-color: #2563eb;
}

.ecom-map-filters {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.ecom-map-search-wrap { position: relative; display: flex; align-items: center; }
.ecom-map-search-ico {
	position: absolute;
	left: 16px;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	color: #667085;
}
.ecom-map-search-ico svg,
.ecom-map-search-ico i { width: 18px; height: 18px; }
.ecom-map-search {
	border: 1px solid #d5d7da;
	border-radius: 9999px;
	padding: 10px 20px 10px 44px;
	font-size: 14px;
	min-width: 240px;
	background: #fff;
	color: #414651;
	outline: none;
	box-shadow: 0px 1px 0.5px 0.05px rgba(24, 24, 27, 0.04);
	transition: border-color .15s, box-shadow .15s;
}
.ecom-map-search:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.ecom-el-dropdown-wrap { position: relative; }
.ecom-el-dropdown-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border: 1px solid #d5d7da;
	border-radius: 9999px;
	background: #fff;
	font-size: 14px;
	color: #414651;
	cursor: pointer;
	touch-action: manipulation;
	box-shadow: 0px 1px 0.5px 0.05px rgba(24, 24, 27, 0.04);
	transition: border-color .15s, box-shadow .15s;
	white-space: nowrap;
}
.ecom-el-dropdown-btn:hover { border-color: #bbbfc7; box-shadow: 0 1px 3px rgba(24, 24, 27, 0.08); }
.ecom-el-dropdown-btn .ecom-chevron { width: 20px; height: 20px; flex-shrink: 0; color: #667085; transition: transform .15s; }
.ecom-el-dropdown-btn[aria-expanded="true"] .ecom-chevron { transform: rotate(180deg); }

.ecom-el-dropdown-list {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	min-width: 200px;
	max-height: 320px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid var(--_ecom-border);
	border-radius: 10px;
	box-shadow: 0 10px 32px rgba(15, 23, 42, .08);
	list-style: none;
	margin: 0;
	padding: 6px;
	display: none;
	z-index: 20;
}
.ecom-el-dropdown-list.is-open { display: block; }
.ecom-el-dropdown-item {
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	color: var(--_ecom-text);
}
.ecom-el-dropdown-item:hover { background: var(--_ecom-subtle-bg); }
.ecom-el-dropdown-item.is-selected {
	background: #eef2ff;
	color: #6366f1;
	font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════
   MAP CONTAINER
   ═══════════════════════════════════════════════════════════════════════ */

.ecom-map-wrap {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid #eef0f3;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .02), 0 8px 24px rgba(15, 23, 42, .04);
}

.ecom-map-canvas {
	width: 100%;
	height: 600px;
	background: var(--_ecom-subtle-bg);
}

/* Loading / empty / error overlay */
.ecom-map-status {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(255, 255, 255, .85);
	color: var(--_ecom-muted);
	font-size: 14px;
	z-index: 10;
	pointer-events: none;
}
.ecom-map-status--error {
	background: rgba(254, 242, 242, .95);
	color: #991b1b;
}
.ecom-map-status--empty {
	background: rgba(255, 255, 255, .9);
}

/* ═══════════════════════════════════════════════════════════════════════
   MARKER (red pin with glyph, matches the screenshot)
   ═══════════════════════════════════════════════════════════════════════ */

.ecom-map-marker {
	--ecom-map-marker: #ef4444;
	position: relative;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	transform: translateY(0);
	cursor: pointer;
	transition: transform .15s;
}
.ecom-map-marker:hover,
.ecom-map-marker.is-active {
	transform: translateY(-4px);
}
/* Pin shape — SVG-like teardrop via CSS */
.ecom-map-marker::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--ecom-map-marker);
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
	border: 2px solid #fff;
}
/* Glyph (icon) sits on top, counter-rotated to stay upright */
.ecom-map-marker-glyph {
	position: relative;
	z-index: 1;
	margin-top: 6px;
	color: #fff;
	font-size: 14px;
	width: 14px;
	height: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.ecom-map-marker-glyph svg,
.ecom-map-marker-glyph i {
	width: 14px;
	height: 14px;
	font-size: 14px;
	color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════
   POPUP CARD (matches the screenshot layout)
   ═══════════════════════════════════════════════════════════════════════ */

.ecom-map-popup {
	position: relative;
	display: flex;
	gap: 14px;
	width: 400px;
	max-width:420px;
	padding: 12px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba(15, 23, 42, .18);
	transform: translate(-50%, calc(-100% - 40px));
}
.ecom-map-popup::after {
	content: '';
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 8px solid #fff;
	filter: drop-shadow(0 2px 2px rgba(15, 23, 42, .08));
}

.ecom-map-popup-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--_ecom-muted);
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 4px;
}
.ecom-map-popup-close:hover {
	background: var(--_ecom-subtle-bg);
	color: var(--_ecom-text);
}

.ecom-map-popup-thumb {
	flex-shrink: 0;
	width: 120px;
	height: auto;
	border-radius: 10px;
	overflow: hidden;
	background: #eef2ff;
	object-fit:cover;
}
.ecom-map-popup-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ecom-map-popup-thumb--placeholder {
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.ecom-map-popup-body {
	flex: 1;
	min-width: 0;
	padding-right: 18px; /* reserve space for close button */
}

.ecom-map-popup-badge {
	display: inline-block;
	padding: 2px 10px;
	font-size: 11px;
	font-weight: 500;
	color: #6366f1;
	background: #eef2ff;
	border-radius: 999px;
	margin-bottom: 6px;
	letter-spacing: .02em;
}

.ecom-map-popup-title {
	display: block;
	font-size: 18px;
	font-weight: 600;
	color: var(--_ecom-text);
	text-decoration: none;
	line-height: 1.3;
	margin-bottom: 10px;
	font-family: Georgia, 'Times New Roman', serif;
}
.ecom-map-popup-title:hover {
	text-decoration: underline;
	color: #2563eb;
}

.ecom-map-popup-meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px 14px;
	font-size: 12px;
	color: var(--_ecom-muted);
}
.ecom-map-popup-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ecom-map-popup-meta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 13px;
	height: 13px;
	color: var(--_ecom-muted);
	flex-shrink: 0;
}
.ecom-map-popup-meta-icon svg,
.ecom-map-popup-meta-icon i {
	width: 13px;
	height: 13px;
	font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
	.ecom-map-toolbar { gap: 12px; }
	.ecom-map-quick-filters { gap: 16px; }
	.ecom-map-qf-btn { font-size: 14px; }
	.ecom-map-search { min-width: 180px; }
	.ecom-map-canvas { height: 480px; }
	.ecom-map-popup {
		width: 280px;
		gap: 10px;
	}
	.ecom-map-popup-thumb {
		width: 90px;
		height: 90px;
	}
	.ecom-map-popup-title { font-size: 16px; }
	.ecom-map-popup-meta { grid-template-columns: 1fr; }
}