.awp-map {
	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: var(--awp-map-height, 420px);
	margin-block: 2rem;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	border-radius: var(--awp-map-radius, 24px);
	background: var(--wp--preset--color--base, #eef2f4);
	box-shadow: 0 1.5rem 3rem rgb(15 23 42 / 0.1);
	overflow: hidden;
	isolation: isolate;
}

.awp-map__canvas {
	isolation: isolate;
	width: 100%;
	min-height: var(--awp-map-height, 420px);
	overflow: hidden;
}

.awp-map .maplibregl-map,
.awp-map .maplibregl-canvas-container,
.awp-map .maplibregl-canvas {
	width: 100%;
	height: 100%;
	min-height: 0;
}

/* Ready maps occupy the entire visual box at every breakpoint. The existing
 * ResizeObserver keeps renderer backing pixels in sync with this canvas. */
.awp-map[data-awp-map-runtime^="ready"] .awp-map__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	min-height: 0;
}

.awp-map--tone-soft .leaflet-tile-pane {
	filter: saturate(0.78) contrast(0.96) brightness(1.03);
}

.awp-map__fallback {
	display: grid;
	gap: 0.35rem;
	margin: 0;
	padding: 1rem 1.125rem;
	font-size: 0.875rem;
	line-height: 1.5;
	background: var(--wp--preset--color--base, #ffffff);
}

.awp-map__destination {
	display: grid;
	gap: 0.12rem;
}

.awp-map__label {
	font-size: 0.95rem;
}

.awp-map__address {
	color: color-mix(in srgb, currentColor 70%, transparent);
}

.awp-map[data-awp-map-runtime="ready"] .awp-map__fallback {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.awp-map[data-awp-map-renderer] .awp-map__fallback,
.awp-map[data-awp-map-runtime^="ready-default-viewport"] .awp-map__fallback {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.awp-map__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20, 0.5rem);
	padding: 0;
	margin: 0;
}

.awp-map__actions .wp-block-button { margin: 0; }

/* Icon + label row inside action controls; standalone-safe sizing. */
.awp-map__action { display: inline-flex; align-items: center; gap: 0.5em; }
.awp-map__action svg { width: 1em; height: 1em; flex: none; }

/* Core/Atomic Button owns geometry, typography and interaction states. */
.awp-map[data-awp-map-runtime^="ready"] .awp-map__actions {
	position: absolute;
	inset-block-end: 0.75rem;
	inset-inline-start: 50%;
	max-inline-size: calc(100% - 1.5rem);
	transform: translateX(-50%);
	z-index: 2;
}

.awp-map__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.awp-map .leaflet-container {
	font: inherit;
}

.awp-map--motion-enter {
	animation: awp-map-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.awp-map-marker--motion-enter {
	animation: awp-map-marker-enter 420ms 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes awp-map-enter {
	from { opacity: 0.01; transform: translateY(12px) scale(0.985); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes awp-map-marker-enter {
	from { opacity: 0; transform: translateY(8px) scale(0.86); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.awp-map--motion-enter,
	.awp-map-marker--motion-enter {
		animation: none !important;
		transition: none !important;
		transform: none !important;
	}
}

@media (max-width: 782px) {
	.awp-map {
		margin-block: 1.25rem;
	}

}
