/**
 * izebuy full-width discovery map.
 * Edge-to-edge map that sits between the logo and the (sticky) search bar.
 * Carries nothing but the map + its markers; the scrollable bottom sheet lists
 * every ad on a tapped marker/cluster. All colours come from tokens.css so the
 * sheet buttons follow the customizable Theme Options brand colours.
 * Depends on: tokens.css.
 */

/* ── Full-bleed wrapper ──────────────────────────────────────────────────── */
.ize-map-wrap {
	width: 100%;
	background: var(--ize-surface-3);
	border-bottom: 1px solid var(--ize-line);
}

.ize-map {
	position: relative;
	width: 100%;
	height: 420px;
}

@media (max-width: 768px) {
	.ize-map { height: 300px; }
}

/* ── Scrollable bottom sheet (ad list for a marker/cluster) ──────────────── */
/* ── Floating ad card anchored under a tapped marker/cluster ────────────── */
/* A compact fixed-size panel (~an index finger wide) positioned by a Google
 * Maps overlay at the marker, opening just below it with a caret pointing up.
 * The outer wrapper stays overflow-visible so the caret shows; the inner card
 * clips its rounded corners and the ad list scrolls. */
.ize-map__popup {
	position: absolute;
	transform: translate(-50%, 14px);
	width: 280px;
	max-width: calc(100vw - 2 * var(--ize-4));
	pointer-events: auto;
	/* Sit above everything, including when it overflows the map edges. */
	z-index: 99999;
}
.ize-map__popup-caret {
	position: absolute;
	top: -7px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 8px solid var(--ize-surface);
	filter: drop-shadow(0 -1px 0 var(--ize-line));
}
.ize-map__popup-inner {
	display: flex;
	flex-direction: column;
	max-height: 300px;
	background: var(--ize-surface);
	border: 1px solid var(--ize-line);
	border-radius: var(--ize-radius-lg);
	box-shadow: var(--ize-shadow-lg);
	overflow: hidden;
}

.ize-map__sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ize-2);
	padding: var(--ize-3) var(--ize-4);
	border-bottom: 1px solid var(--ize-line);
}
.ize-map__sheet-title {
	font-size: var(--ize-fs-sm);
	font-weight: 700;
	color: var(--ize-ink);
}
.ize-map__sheet-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: var(--ize-surface-2);
	color: var(--ize-ink);
	font-size: var(--ize-fs-md);
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s var(--ize-ease);
}
.ize-map__sheet-close:hover { background: var(--ize-surface-3); }

.ize-map__sheet-list {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: var(--ize-2);
	display: flex;
	flex-direction: column;
	gap: var(--ize-1);
}

/* Ad card inside the sheet */
.ize-map__card {
	display: flex;
	align-items: center;
	gap: var(--ize-3);
	padding: var(--ize-2);
	border-radius: var(--ize-radius);
	text-decoration: none;
	transition: background 0.15s var(--ize-ease);
}
.ize-map__card:hover { background: var(--ize-surface-2); }

.ize-map__card-img {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	object-fit: cover;
	border-radius: var(--ize-radius-sm);
	background: var(--ize-surface-3);
}
.ize-map__card-img--empty { display: block; }

.ize-map__card-body {
	flex: 1 1 auto;
	min-width: 0;
}
.ize-map__card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--ize-ink);
	font-size: var(--ize-fs-sm);
	font-weight: 600;
	line-height: 1.3;
}

/* The one button (default colours — no brand fill). */
.ize-map__card-cta {
	flex-shrink: 0;
	padding: 6px 14px;
	border-radius: var(--ize-radius-pill);
	font-size: var(--ize-fs-xs);
	font-weight: 600;
	white-space: nowrap;
}
