/**
 * Store locator — sidebar search, map, and results list.
 */

.maxs-store-locator {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
	gap: var(--space-xl, 2.5rem);
	align-items: start;
	width: 100%;
}

/* ---------- Sidebar ---------- */

.maxs-store-locator__sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--space-l, 1.25rem);
}

.maxs-store-locator__heading {
	margin: 0;
	font-size: var(--text-xl, 1.25rem);
	line-height: 1.15;
	color: var(--text-title, #000000);
}

.maxs-store-locator__intro {
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.5;
	color: var(--text-body, #404040);
}

.maxs-store-locator__notice {
	padding: var(--space-s, 0.75rem) var(--space-m, 1rem);
	background: var(--secondary-l-2, #fff8f0);
	border: 1px solid var(--bricks-border-color, #dddedf);
}

.maxs-store-locator__notice-text {
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.4;
}

.maxs-store-locator__form {
	display: flex;
	flex-direction: column;
	gap: var(--space-m, 1rem);
}

.maxs-store-locator__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs, 0.5rem);
}

.maxs-store-locator__label,
.maxs-store-locator__or {
	font-size: var(--text-s, 0.875rem);
	line-height: 1.3;
	color: var(--text-body, #404040);
}

.maxs-store-locator__input-wrap,
.maxs-store-locator__select-wrap,
.maxs-store-locator__combobox {
	position: relative;
}

.maxs-store-locator__suggestions {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 240px;
	margin: 0;
	padding: 0.25rem 0;
	list-style: none;
	overflow-y: auto;
	background: #fff;
	border: 0.8px solid var(--bricks-border-color, #dddedf);
	box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
}

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

.maxs-store-locator__suggestion {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.5rem 0.75rem;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.35;
	color: var(--text-body, #404040);
	text-align: left;
	cursor: pointer;
}

.maxs-store-locator__suggestion:hover,
.maxs-store-locator__suggestion.is-active {
	background: var(--secondary-l-2, #fff8f0);
	color: var(--text-title, #000000);
}

.maxs-store-locator__suggestion:focus-visible {
	outline: 2px solid var(--primary, #ce1f3a);
	outline-offset: -2px;
}

.maxs-store-locator .form-group input,
.maxs-store-locator .form-group select {
	display: block;
	width: 100%;
	height: 41.6px;
	padding: 0 12px;
	box-sizing: border-box;
	background-color: #f0e3d5;
	border: 0.8px solid var(--bricks-border-color, #dddedf);
	border-radius: var(--radius-xs);
	font-size: 15px;
	font-weight: 400;
	line-height: 40px;
	color: #363636;
	transition: var(--bricks-transition, all 0.2s);
	outline: none;
	appearance: none;
}

.maxs-store-locator .form-group input {
	padding-right: 2.75rem;
}

.maxs-store-locator__input-wrap.has-value .maxs-store-locator__input {
	padding-right: 2.75rem;
}

.maxs-store-locator__search-clear {
	position: absolute;
	top: 50%;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(54 54 54 / 12%);
	color: #363636;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.maxs-store-locator__search-clear[hidden] {
	display: none;
}

.maxs-store-locator__search-clear:hover {
	background: rgb(54 54 54 / 20%);
	color: var(--text-title, #000000);
}

.maxs-store-locator__search-clear:focus-visible {
	outline: 2px solid var(--primary, #ce1f3a);
	outline-offset: 2px;
}

.maxs-store-locator__input-wrap.has-value .maxs-store-locator__input-icon {
	opacity: 0;
	visibility: hidden;
}

.maxs-store-locator__input::-webkit-search-cancel-button,
.maxs-store-locator__input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.maxs-store-locator__input::-ms-clear {
	display: none;
}

.maxs-store-locator .form-group input::placeholder {
	color: #363636;
	opacity: 0.65;
}

.maxs-store-locator .form-group input:disabled,
.maxs-store-locator .form-group select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.maxs-store-locator .form-group select {
	padding-right: 36px;
	cursor: pointer;
}

.maxs-store-locator__input-icon,
.maxs-store-locator__select-icon {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	pointer-events: none;
	color: #363636;
	line-height: 1;
}

.maxs-store-locator__geolocate {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs, 0.5rem);
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.3;
	color: var(--text-body, #404040);
	text-decoration: underline;
	cursor: pointer;
}

.maxs-store-locator__geolocate:hover {
	color: var(--dark, #000);
}

.maxs-store-locator__geolocate:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	text-decoration: none;
}

.maxs-store-locator__geolocate:focus-visible {
	outline: 2px solid var(--primary, #ce1f3a);
	outline-offset: 2px;
}

.maxs-store-locator__geolocate-icon {
	display: inline-flex;
	line-height: 1;
}

.maxs-store-locator__or {
	margin: 0;
	text-align: center;
}

.maxs-store-locator__actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-s, 0.75rem);
	margin-top: var(--space-s, 0.75rem);
}

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

.maxs-store-locator__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-xs, 0.5rem);
	width: 100%;
	padding: var(--space-s, 0.75rem) var(--space-m, 1rem);
	border: 1px solid var(--dark, #000);
	border-radius: 0;
	background: transparent;
	font-size: var(--text-xs, 0.6875rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.maxs-store-locator__clear:hover {
	background: var(--dark, #000);
	color: var(--light, #fff);
}

.maxs-store-locator__clear:focus-visible {
	outline: 2px solid var(--primary, #ce1f3a);
	outline-offset: 2px;
}

/* ---------- Main ---------- */

.maxs-store-locator__main {
	display: flex;
	flex-direction: column;
	gap: var(--space-l, 1.25rem);
	min-width: 0;
	max-height: var(--maxs-store-locator-available-height, calc(100dvh - 6rem));
	min-height: 0;
}

.maxs-store-locator__map {
	flex: 0 0 auto;
	width: 100%;
	height: clamp(220px, 32vh, 380px);
	min-height: 220px;
	background: var(--secondary-l-2, #fff8f0);
	border: 0.8px solid var(--bricks-border-color, #dddedf);
}

.maxs-store-locator__map--placeholder {
	display: grid;
	place-items: center;
	padding: var(--space-l, 1.25rem);
}

.maxs-store-locator__map-placeholder {
	margin: 0;
	max-width: 28rem;
	text-align: center;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.5;
	color: var(--secondary-d-2, #6b6560);
}

.maxs-store-locator__results {
	display: flex;
	flex-direction: column;
	gap: var(--space-m, 1rem);
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.maxs-store-locator__results-count {
	flex: 0 0 auto;
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	color: var(--text-title, #000000);
}

.maxs-store-locator__results-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-l, 1.25rem);
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
	padding-right: 0.25rem;
}

.maxs-store-locator__results-list::-webkit-scrollbar {
	width: 6px;
}

.maxs-store-locator__results-list::-webkit-scrollbar-track {
	background: transparent;
}

.maxs-store-locator__results-list::-webkit-scrollbar-thumb {
	background: rgb(0 0 0 / 18%);
	border-radius: 999px;
}

.maxs-store-locator__results-list::-webkit-scrollbar-thumb:hover {
	background: rgb(0 0 0 / 28%);
}

.maxs-store-locator__card {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs, 0.5rem);
	padding-bottom: var(--space-l, 1.25rem);
	border-bottom: 1px solid var(--bricks-border-color, #dddedf);
}

.maxs-store-locator__card:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.maxs-store-locator__card.is-hidden {
	display: none;
}

.maxs-store-locator__card.is-active {
	padding-left: var(--space-l);
	border-left: 3px solid var(--primary, #ce1f3a);
}

.maxs-store-locator__card-name-wrap {
	margin: 0;
}

.maxs-store-locator__card-name {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: var(--text-l, 1.125rem);
	line-height: 1.2;
	color: var(--text-title, #000000);
	text-align: left;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 0.15em;
	cursor: pointer;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.maxs-store-locator__card-name:hover,
.maxs-store-locator__card.is-active .maxs-store-locator__card-name {
	color: var(--primary, #ce1f3a);
	text-decoration-color: currentColor;
}

.maxs-store-locator__card-name:focus-visible {
	outline: 2px solid var(--primary, #ce1f3a);
	outline-offset: 2px;
}

.maxs-store-locator__card-email,
.maxs-store-locator__card-phone {
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.4;
}

.maxs-store-locator__card-address,
.maxs-store-locator__card-hours {
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.45;
	color: var(--text-body, #404040);
}

.maxs-store-locator__card-badge-wrap {
	margin: 0;
}

.maxs-store-locator__badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: var(--radius-s, 8px);
	background: var(--primary, #ce1f3a);
	color: #fff;
	font-size: var(--text-xs, 0.75rem);
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.maxs-store-locator__card-events {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.maxs-store-locator__chip {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: var(--secondary-l-2, #fff8f0);
	border: 1px solid var(--bricks-border-color, #dddedf);
	font-size: var(--text-xs, 0.75rem);
	line-height: 1.3;
	color: var(--text-body, #404040);
}

.maxs-store-locator__card-email a,
.maxs-store-locator__card-phone a {
	color: inherit;
	text-decoration: none;
}

.maxs-store-locator__card-email a:hover,
.maxs-store-locator__card-phone a:hover {
	text-decoration: underline;
}

.maxs-store-locator__card-phone,
.maxs-store-locator__infowindow-phone {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0;
}

.maxs-store-locator__phone-sep {
	white-space: pre;
}

.maxs-store-locator__phone-text {
	color: inherit;
}

.maxs-store-locator__card-notes {
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.5;
	font-style: italic;
	color: var(--text-body, #404040);
}

.maxs-store-locator__empty {
	margin: 0;
	padding: var(--space-l, 1.25rem);
	text-align: center;
	background: var(--secondary-l-2, #fff8f0);
	border-radius: var(--radius-m, 14px);
	font-size: var(--text-m, 1rem);
	line-height: 1.5;
}

.maxs-store-locator__message {
	margin: 0;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.4;
	color: var(--primary, #ce1f3a);
}

/* ---------- Google Maps InfoWindow ---------- */

/* Title lives in Google's header row (headerContent) beside the close button. */
.maxs-store-locator__infowindow-header {
	margin: 0;
	padding: 0 1.75rem 0 0;
	font-size: var(--text-m, 1rem);
	line-height: 1.2;
	color: var(--text-title, #000000);
}

.maxs-store-locator__infowindow {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs, 0.5rem);
	box-sizing: border-box;
	font-size: var(--text-s, 0.875rem);
	line-height: 1.4;
	color: var(--text-body, #404040);
}

.maxs-store-locator__infowindow p {
	margin: 0;
}

.maxs-store-locator__infowindow-hours {
	white-space: normal;
}

.maxs-store-locator__infowindow-action {
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.maxs-store-locator__infowindow-link .maxs-store-locator__infowindow-action {
	font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (min-width: 769px) {
	.maxs-store-locator__sidebar {
		position: sticky;
		top: 1.5rem;
		align-self: start;
		max-height: calc(100dvh - 3rem);
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-gutter: stable;
	}
}

@media (max-width: 768px) {
	.maxs-store-locator {
		grid-template-columns: 1fr;
		gap: var(--space-l, 1.25rem);
	}

	.maxs-store-locator__main {
		max-height: var(--maxs-store-locator-available-height, calc(100dvh - 4rem));
	}

	.maxs-store-locator__map {
		height: clamp(200px, 28vh, 300px);
		min-height: 200px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.maxs-store-locator__clear {
		transition: none;
	}
}
