.stores-locator {
	--sl-accent: var(--c-accent);
	--sl-pin-active: var(--c-ink);
	--sl-map-h: clamp(280px, 60vw, 360px);
	--sl-list-h: clamp(260px, 46vh, 400px);
	--sl-gap: clamp(20px, 2.4vw, 32px);
}

.stores-locator__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--sl-gap);
	align-items: stretch;
}

.stores-locator__panel {
	display: flex;
	flex-direction: column;
	gap: var(--sl-gap);
	min-width: 0;
}

.stores-locator__map-col {
	position: relative;
	display: grid;
	place-items: center;
	min-height: var(--sl-map-h);
	padding: 16px;
	overflow: hidden;
	background-color: var(--c-surface-muted);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-lg);
}

.stores-locator__map {
	position: absolute;
	inset: 0;
}

.stores-locator__map-hint {
	max-width: 32ch;
	margin: 0;
	font-size: var(--fs-sm);
	color: var(--c-ink-55);
	text-align: center;
}

.stores-locator__list-wrap {
	position: relative;
	min-width: 0;
}

.stores-list {
	padding: 6px;
	margin: 0;
	list-style: none;
	background-color: var(--c-surface-muted);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-md);
}

.stores-list--scroll {
	max-height: var(--sl-list-h);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--c-ink-12) transparent;
}

.stores-locator__list-wrap:has(.stores-list--scroll)::after {
	position: absolute;
	right: 1px;
	bottom: 1px;
	left: 1px;
	height: 40px;
	content: '';
	pointer-events: none;
	background-image: linear-gradient(to top, var(--c-surface-muted), transparent);
	border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.stores-list__item + .stores-list__item {
	border-top: 1px solid var(--c-line);
}

.stores-list__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: var(--radius-sm);
	transition:
		background-color var(--dur-fast) var(--ease-out),
		box-shadow var(--dur-fast) var(--ease-out);
}

a.stores-list__row:hover {
	background-color: var(--c-surface);
	box-shadow: var(--shadow-sm);
}

.stores-list__item.is-active .stores-list__row {
	background-color: var(--c-accent-soft);
	box-shadow: inset 3px 0 0 var(--sl-accent);
}

.stores-list__logo {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	overflow: hidden;
	border-radius: var(--radius-sm);
}

.stores-list__logo svg,
.stores-list__logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.stores-list__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.stores-list__name {
	font-size: var(--fs-sm);
	font-weight: 700;
	line-height: 1.3;
	color: var(--c-ink);
}

.stores-list__address,
.stores-list__hours {
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--c-ink-55);
}

.stores-list__go {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: var(--sl-accent);
	transition: transform var(--dur-fast) var(--ease-out);
}

a.stores-list__row:hover .stores-list__go {
	transform: translateX(3px);
}

/* The click keeps the visitor on the page, so the arrow points at the map, not away. */
.stores-locator.is-interactive a.stores-list__row:hover .stores-list__go {
	transform: scale(1.15);
}

/* The marker card: Google draws the frame, we set the type inside it. */
.stores-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 220px;
	padding: 2px 4px 4px;
	font-family: inherit;
}

.stores-card__name {
	font-size: var(--fs-sm);
	font-weight: 700;
	line-height: 1.3;
	color: var(--c-ink);
}

.stores-card__address {
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--c-ink-55);
}

.stores-card__link {
	margin-top: 2px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--c-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.stores-card__link:hover {
	color: var(--sl-accent);
}

.stores-locator__placeholder {
	padding: 24px;
	margin: 0;
	font-size: var(--fs-sm);
	color: var(--c-ink-55);
	text-align: center;
	border: 1px dashed var(--c-line);
	border-radius: var(--radius-md);
}

@media (min-width: 768px) {
	.stores-locator {
		--sl-map-h: clamp(320px, 38vw, 400px);
	}
}

@media (min-width: 1024px) {
	.stores-locator {
		--sl-map-h: 440px;
		--sl-list-h: clamp(320px, 48vh, 520px);
	}

	.stores-locator__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

@media (min-width: 1280px) {
	.stores-locator__inner {
		grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
	}
}

.stores-locator.is-map-failed .stores-locator__map-col {
	display: none;
}

@media (min-width: 1024px) {
	.stores-locator:is(.stores-locator--no-map, .is-map-failed) .stores-locator__inner {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	a.stores-list__row:hover .stores-list__go,
	.stores-locator.is-interactive a.stores-list__row:hover .stores-list__go {
		transform: none;
	}
}
