/* 5thAXIS — Distributor Locator widget */

.axis5th-dl {
	--axis5th-dl-accent:  var(--e-global-color-primary, #DD2828);
	--axis5th-dl-text:    #18181B;
	--axis5th-dl-muted:   #6c6c6c;
	--axis5th-dl-border:  #e5e5e5;
	--axis5th-dl-surface: #f4f4f4;
	--axis5th-dl-control-h: 44px;

	font-family: var(--e-global-typography-primary-font-family), sans-serif;
	color: var(--axis5th-dl-text);
	background: #ffffff;
	border-radius: 12px;
	box-sizing: border-box;
}

.axis5th-dl *,
.axis5th-dl *::before,
.axis5th-dl *::after {
	box-sizing: border-box;
}

.axis5th-dl button {
	font-family: inherit;
	line-height: 1;
	appearance: none;
	-webkit-appearance: none;
}

.axis5th-dl__heading-accent {
	color: var(--axis5th-dl-accent);
}

/* ── Top: heading + controls ───────────────────────────────────────── */

.axis5th-dl__top {
	display: flex;
	flex-direction: column;
	gap: 28px;
	margin-bottom: 40px;
}

.axis5th-dl__eyebrow {
	display: block;
	font-family: var(--e-global-typography-57475c0-font-family), sans-serif;
	font-size: 16px;
	font-weight: 400;
	text-transform: uppercase;
	color: #4B5563;
	margin: 0 0 12px;
}

.axis5th-dl__heading {
	font-family: var(--e-global-typography-primary-font-family), sans-serif;
	text-transform: none;
	letter-spacing: normal;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0;
}

.axis5th-dl__controls {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	width: 100%;
}

.axis5th-dl__search {
	display: flex;
	align-items: stretch;
	gap: 8px;
	height: var(--axis5th-dl-control-h);
	flex: 1 1 280px;
	max-width: 420px;
	min-width: 0;
}

.axis5th-dl__search-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	border: 1px solid #d1d1d1;
	border-radius: 0;
	padding: 0 14px;
	background: #fff;
}

.axis5th-dl__search-icon {
	color: var(--axis5th-dl-muted);
	flex-shrink: 0;
	display: block;
}

.axis5th-dl__search-input {
	border: 0 !important;
	outline: 0;
	padding: 0 10px;
	height: 100%;
	font-size: 14px;
	line-height: 1.2;
	width: 100%;
	min-width: 0;
	background: transparent;
	color: var(--axis5th-dl-text);
}

.axis5th-dl__search-input::placeholder {
	color: #9a9a9a;
	font-weight: 400;
}

.axis5th-dl__search-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 20;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--axis5th-dl-border);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	max-height: 280px;
	overflow-y: auto;
}

.axis5th-dl__search-dropdown li {
	padding: 9px 12px;
	font-size: 0.875rem;
	border-radius: 6px;
	cursor: pointer;
}

.axis5th-dl__search-dropdown li:hover {
	background: var(--axis5th-dl-surface);
}

.axis5th-dl__search-dropdown li.is-disabled {
	color: var(--axis5th-dl-muted);
	cursor: default;
}

.axis5th-dl__search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	height: 100%;
	background: var(--axis5th-dl-accent);
	color: #fff;
	border: 0;
	border-radius: 0;
	padding: 0 22px;
	font-family: var(--e-global-typography-57475c0-font-family), sans-serif;
	font-size: 0.9375rem;
	font-weight: 400;
	cursor: pointer;
	transition: opacity 0.15s ease;
	white-space: nowrap;
}

.axis5th-dl__search-btn:hover {
	opacity: 0.88;
}

.axis5th-dl__toolbar {
	display: flex;
	align-items: stretch;
	gap: 0;
	height: var(--axis5th-dl-control-h);
	flex: 0 1 auto;
	justify-content: flex-end;
	min-width: 0;
	background: #f2f2f2;
	border: 1px solid var(--axis5th-dl-border);
	border-radius: 8px;
	padding: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	overflow: hidden;
}

.axis5th-dl__region-tabs {
	display: flex;
	align-items: stretch;
	gap: 4px;
	height: 100%;
	flex: 1 1 auto;
	min-width: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.axis5th-dl__region-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 2px !important;
	padding: 0 20px !important;
	font-family: var(--e-global-typography-57475c0-font-family), sans-serif;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1;
	color: #6C6C6C;
	cursor: pointer;
	white-space: nowrap;
	position: relative;
	transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.axis5th-dl__region-tab:hover {
	background: #fff;
	color: var(--axis5th-dl-text);
	box-shadow: inset 0 -2px 0 0 var(--axis5th-dl-accent);
}

.axis5th-dl__region-tab.is-active {
	background: #fff;
	color: var(--axis5th-dl-text);
	font-weight: 400;
	box-shadow: inset 0 -2px 0 0 var(--axis5th-dl-accent);
}

.axis5th-dl__view-toggle {
	display: flex;
	align-items: stretch;
	gap: 0;
	height: 100%;
	flex: 0 0 auto;
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0 0 0 8px;
	margin-left: 4px;
	position: relative;
}

.axis5th-dl__view-toggle::before {
	content: "";
	position: absolute;
	left: 0;
	top: 20%;
	bottom: 20%;
	width: 1px;
	background: #cfcfcf;
}

.axis5th-dl__view-btn {
	background: transparent;
	border: 0;
	border-radius: 6px;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--axis5th-dl-muted);
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.axis5th-dl__view-btn:hover {
	background: #fff;
	color: var(--axis5th-dl-text);
	box-shadow: inset 0 -2px 0 0 var(--axis5th-dl-accent);
}

.axis5th-dl__view-btn.is-active {
	background: #fff;
	color: var(--axis5th-dl-text);
	box-shadow: inset 0 -2px 0 0 var(--axis5th-dl-accent);
}

/* ── Body: map / list panes ────────────────────────────────────────── */

.axis5th-dl__map-pane,
.axis5th-dl__list-pane {
	display: none;
}

.axis5th-dl__map-pane.is-visible,
.axis5th-dl__list-pane.is-visible {
	display: block;
}

.axis5th-dl__map-pane.is-visible {
	display: flex;
	gap: 24px;
	align-items: stretch;
}

.axis5th-dl__map {
	flex: 1 1 60%;
	min-width: 280px;
	height: 560px;
	border-radius: 10px;
	overflow: hidden;
	background: #1a1a1a; /* visible while the Maps JS is still loading */
}

.axis5th-dl__map-sidebar {
	flex: 1 1 340px;
	max-width: 380px;
	height: 560px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-right: 4px;
}

/* ── Distributor card — shared by the map sidebar and the list grid ── */

.axis5th-dl__card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--axis5th-dl-border);
	border-radius: 0;
	padding: 16px;
	background: #fff;
	transition: border-color 0.15s ease;
	cursor: pointer;
	min-width: 0;
}

.axis5th-dl__card:hover,
.axis5th-dl__card.is-active {
	border-color: var(--axis5th-dl-accent);
}

.axis5th-dl__card-eyebrow {
	display: block;
	font-family: var(--e-global-typography-57475c0-font-family), sans-serif;
	font-size: 14px;
	font-weight: 400;
	text-transform: uppercase;
	color: #4B5563;
	margin: 0 0 8px;
}

.axis5th-dl__card-title {
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 26px;
	color: var(--axis5th-dl-text);
}

.axis5th-dl__card-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.875rem;
	line-height: 1.45;
	margin: 0 0 10px;
	color: #444;
}

.axis5th-dl__card-row:last-of-type {
	margin-bottom: 0;
}

.axis5th-dl__card-row svg {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 0.2em;
	color: var(--axis5th-dl-muted);
}

.axis5th-dl__card-row span {
	min-width: 0;
	flex: 1 1 auto;
}

.axis5th-dl__card-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	border: 1px solid var(--axis5th-dl-text);
	border-radius: 0;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	color: var(--axis5th-dl-text);
	background: #fff;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	margin-top: 28px;
}

.axis5th-dl__card:hover .axis5th-dl__card-btn,
.axis5th-dl__card.is-active .axis5th-dl__card-btn {
	background: var(--axis5th-dl-accent);
	border-color: var(--axis5th-dl-accent);
	color: #fff;
}

.axis5th-dl__card-btn svg {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

/* ── List view grid ─────────────────────────────────────────────────── */

.axis5th-dl__list-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	width: 100%;
	align-items: stretch;
}

.axis5th-dl__list-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--axis5th-dl-muted);
	padding: 40px 0;
}

.axis5th-dl__load-more {
	grid-column: 1 / -1; /* full-width in the list grid; sidebar just stacks it normally */
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background: transparent;
	border: 1px solid var(--axis5th-dl-accent);
	border-radius: 8px;
	padding: 14px 20px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #18181b;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.axis5th-dl__load-more:hover {
	border-color: var(--axis5th-dl-accent);
	background-color: var(--axis5th-dl-accent);
	color: #ffffff;
}

.axis5th-dl__load-more-count {
	color: var(--axis5th-dl-muted);
	font-weight: 400;
}

.axis5th-dl__load-more:hover .axis5th-dl__load-more-count {
	color: inherit;
}

/* ── Google Maps InfoWindow content (kept minimal, matches card style) ─ */

.axis5th-dl-infowindow {
	font-family: var(--e-global-typography-primary-font-family), sans-serif;
	min-width: 200px;
}

.axis5th-dl-infowindow strong {
	display: block;
	margin-bottom: 4px;
	font-size: 0.9375rem;
}

.axis5th-dl-infowindow span {
	display: block;
	font-size: 0.8125rem;
	color: #555;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
	.axis5th-dl__list-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.axis5th-dl__list-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.axis5th-dl__map-pane.is-visible {
		flex-direction: column;
	}

	.axis5th-dl__map,
	.axis5th-dl__map-sidebar {
		height: 420px;
		max-width: none;
	}
}

@media (max-width: 782px) {
	.axis5th-dl__top {
		gap: 20px;
	}

	.axis5th-dl__controls {
		align-items: stretch;
		flex-direction: column;
		width: 100%;
	}

	.axis5th-dl__search {
		width: 100%;
		max-width: none;
		flex: 0 0 auto;
	}

	.axis5th-dl__toolbar {
		width: 100%;
		justify-content: flex-start;
		height: var(--axis5th-dl-control-h);
		flex-wrap: nowrap;
	}

	.axis5th-dl__region-tab {
		padding: 0 12px;
	}

	.axis5th-dl__view-toggle {
		padding-left: 6px;
	}

	.axis5th-dl__list-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}
