/* Store locator — adapted from Osmo Mapbox resource, iramasure tokens */

.location-block {
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 3vw, 32px);
}

.location-block__toolbar {
	display: flex;
	justify-content: flex-end;
}

.location-map-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 4px 20px;
	min-height: 48px;
	border: 0;
	border-radius: var(--radius-md);
	background: var(--color-bg-inverse);
	color: var(--color-text-inverse);
	font-family: var(--font-secondary);
	font-size: var(--text-body-md);
	font-weight: var(--font-weight);
	line-height: 1.2;
	cursor: pointer;
	transition:
		background-color 0.4s var(--motion-ease-reveal),
		opacity 0.4s var(--motion-ease-reveal);
}

.location-map-trigger:hover,
.location-map-trigger:focus-visible {
	background: #222222;
	color: var(--color-text-inverse);
	opacity: 1;
	outline: none;
}

.store-locator-modal {
	position: fixed;
	inset: 0;
	/* Above site-header (220) and site-nav (600) */
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(12px, 2.5vw, 28px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-locator-modal[hidden] {
	display: flex !important;
}

.store-locator-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.store-locator-modal__backdrop {
	position: absolute;
	inset: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.62);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-locator-modal.is-open .store-locator-modal__backdrop {
	opacity: 1;
}

.store-locator-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 1180px);
	height: min(88vh, 820px);
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--color-bg);
	outline: none;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
	opacity: 0;
	transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-locator-modal.is-open .store-locator-modal__dialog {
	opacity: 1;
}

.store-locator-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--color-text);
	color: var(--color-text-inverse);
	cursor: pointer;
}

.store-locator-modal__close:hover,
.store-locator-modal__close:focus-visible {
	opacity: 0.85;
	outline: none;
}

.store-locator {
	width: 100%;
	height: 100%;
}

.store-locator__container {
	width: 100%;
	height: 100%;
	padding: clamp(16px, 2vw, 28px);
	padding-top: 56px;
}

.store-locator__inner {
	display: flex;
	gap: clamp(16px, 2vw, 28px);
	width: 100%;
	height: 100%;
}

.store-locator__side {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 22rem;
	overflow: auto;
}

.store-locator__header {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 0 0 1.25rem;
	background-image: linear-gradient(var(--color-bg) 75%, transparent);
}

.store-locator__heading {
	margin: 0;
	font-family: var(--font-primary);
	font-size: clamp(1.15rem, 1.6vw, 1.4rem);
	font-weight: var(--font-weight);
	line-height: 1.2;
}

.store-locator__main {
	position: relative;
	flex: 1;
	overflow: clip;
	border-radius: var(--radius-md);
	background: var(--color-surface);
}

.store-locator__map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.store-locator__fallback {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 24px;
	background: var(--color-surface);
	color: var(--color-text);
	font-size: var(--text-body-md);
	text-align: center;
}

.store-locator__fallback[hidden] {
	display: none;
}

.store-locator__list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding-bottom: 2rem;
}

.store-locator__item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	padding: 1.15rem 1rem;
	border: 1px solid var(--color-rule);
	border-radius: var(--radius-md);
	background: transparent;
	cursor: pointer;
	transition: border-color 0.3s var(--motion-ease-reveal);
}

[data-locator-item][data-active="true"] {
	border-color: var(--color-text);
}

.store-locator__item-eyebrow {
	margin: 0;
	color: var(--color-accent-muted);
	font-family: var(--font-secondary);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
}

.store-locator__item-heading {
	margin: 0.45em 0 0.7em;
	font-family: var(--font-primary);
	font-size: 1.15rem;
	font-weight: var(--font-weight);
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.store-locator__item-p {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.35;
}

.store-locator__item-link {
	margin-top: 1.25rem;
	padding: 0.45em 0.7em;
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	color: var(--color-text);
	font-size: 0.88rem;
	font-weight: var(--font-weight);
	text-decoration: none;
}

.store-locator__item-link:hover,
.store-locator__item-link:focus-visible {
	background: var(--color-text);
	color: var(--color-text-inverse);
	outline: none;
}

.store-locator__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1em;
	flex-shrink: 0;
}

.store-locator__icon .i-icon {
	font-size: 1rem;
}

.store-locator__item-location {
	display: flex;
	align-items: flex-start;
	gap: 0.45em;
	color: rgba(0, 0, 0, 0.62);
}

.store-locator__overlay {
	pointer-events: none;
	position: sticky;
	inset: auto 0 0;
	padding-bottom: 2.5em;
	background-image: linear-gradient(transparent, var(--color-bg));
}

.store-locator__marker {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.4em;
	height: 2.4em;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--color-text);
	color: var(--color-text-inverse);
	cursor: pointer;
}

[data-locator-marker] {
	display: flex;
}

[data-locator-marker][data-active="true"] {
	outline: 1px solid var(--color-text);
	outline-offset: 0.4em;
}

.store-locator__marker-icon {
	font-size: 1.15rem;
	line-height: 1;
}

.mapboxgl-ctrl-group button {
	background: var(--color-bg) !important;
}

.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib {
	display: none !important;
}

body.is-store-locator-open {
	overflow: hidden;
}

@media (max-width: 991px) {
	.store-locator-modal__dialog {
		height: min(92vh, 900px);
	}

	.store-locator__inner {
		flex-direction: column;
		gap: 0;
		overflow: auto;
	}

	.store-locator__main {
		order: -1;
		flex: 0 0 auto;
		aspect-ratio: 3 / 2;
		min-height: 220px;
	}

	.store-locator__side {
		max-width: none;
		overflow: visible;
	}

	.store-locator__header {
		position: static;
		padding-top: 1rem;
	}

	.store-locator__overlay {
		display: none;
	}
}

@media (max-width: 640px) {
	.location-block__toolbar {
		justify-content: flex-end;
	}

	.location-map-trigger,
	.location-map-trigger__label {
		font-size: 13px;
	}

	.location-map-trigger {
		min-height: 36px;
		padding: 2px 14px;
	}

	.store-locator-modal {
		padding: 0;
	}

	.store-locator-modal__dialog {
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
}
