.fxm {
	--fxm-brand: #d94d14;
	--fxm-text: #333333;
	--fxm-marker: #d44927;          /* distributor / rep pin (orange) */
	--fxm-marker-dealer: #e28e04;   /* dealer pin (yellow) */
	--fxm-accent: #e28e04;     /* close button ring */
	--fxm-close-bg: #333333;
	--fxm-muted: #5f6774;      /* subheading */
	--fxm-box-bg: #ebebeb;     /* contact person box */
	/* OpenStreetMap tiles: greyscale base warmed towards #e28e04. Set to "none" for the plain map. */
	--fxm-tiles-filter: grayscale(1) sepia(0.35) saturate(1.4) brightness(1.02);
	--fxm-map-bg: #f3ece2;
	position: relative;
	width: 100%;
	height: var(--fxm-height, 750px);
	overflow: hidden;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Full page width less a margin each side (--fxm-gutter), even inside a narrow
   content column. map.js corrects for scrollbars and off-centre columns; this is
   the no-JS fallback. */
.fxm.fxm--full {
	--fxm-gutter: 24px;
	/* Resolves the gutter to pixels for map.js (column-gap has no effect on this block). */
	column-gap: var(--fxm-gutter);
	width: calc(100vw - 2 * var(--fxm-gutter)) !important;
	max-width: calc(100vw - 2 * var(--fxm-gutter)) !important;
	margin-left: calc(50% - 50vw + var(--fxm-gutter)) !important;
	margin-right: calc(50% - 50vw + var(--fxm-gutter)) !important;
}

/* Side margins grow with the screen. A block / shortcode "margin" overrides these
   (it's set inline on the map). */
@media (min-width: 768px) {
	.fxm.fxm--full {
		--fxm-gutter: 48px;
	}
}

@media (min-width: 1200px) {
	.fxm.fxm--full {
		--fxm-gutter: 96px;
	}
}

@media (min-width: 1600px) {
	.fxm.fxm--full {
		--fxm-gutter: 160px;
	}
}

@media (min-width: 1920px) {
	.fxm.fxm--full {
		--fxm-gutter: 240px;
	}
}

.fxm .leaflet-container {
	background: var(--fxm-map-bg);
	font-family: inherit;
}

/* Filter each tile rather than the pane: filtering the pane shows seams between tiles. */
.fxm .leaflet-tile {
	filter: var(--fxm-tiles-filter);
}

.fxm__map {
	position: absolute;
	inset: 0;
	z-index: 0;
	transition: filter 0.3s ease;
}

/* Dim and blur the map while a card is open (colours kept) */
.fxm.is-open .fxm__map {
	filter: brightness(0.8) blur(1px);
}

/* Marker */
.fxm-marker {
	background: none;
	border: 0;
	color: var(--fxm-marker, #d44927); /* fallback for the admin preview map */
	cursor: pointer;
}

.fxm-marker svg {
	display: block;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
	transition: transform 0.15s ease, color 0.15s ease;
	transform-origin: 50% 100%;
}

.fxm-marker--dealer {
	color: var(--fxm-marker-dealer, #e28e04);
}

/* No focus box after a mouse/touch click; keyboard focus gets a rounded ring */
.fxm .fxm-marker:focus {
	outline: none;
}

.fxm .fxm-marker:focus-visible {
	outline: 2px solid var(--fxm-text);
	outline-offset: 3px;
	border-radius: 6px;
}

/* Hover / selected: same colour (it means the type), slightly bigger and deeper */
.fxm-marker:hover svg,
.fxm-marker:focus-visible svg,
.fxm-marker.is-active svg {
	transform: scale(1.15);
	filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35)) brightness(0.92);
}

/* Distributors (or Reps) / Dealers slider toggle, top centre of the map */
.fxm__types {
	position: absolute;
	top: 14px;
	left: 50%;
	z-index: 1000;
	/* Two equal columns sized to the longer label, so the 50% thumb always fits */
	display: grid;
	grid-template-columns: 1fr 1fr;
	padding: 4px;
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	transform: translateX(-50%);
	white-space: nowrap;
}

.fxm__types-thumb {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 4px;
	width: calc(50% - 4px);
	border-radius: 999px;
	background: var(--fxm-marker);
	transition: transform 0.25s ease, background-color 0.25s ease;
}

/* Only one type listed (no dealers): a single pill, no switching */
.fxm__types--single {
	grid-template-columns: 1fr;
}

.fxm__types--single .fxm__types-thumb {
	width: calc(100% - 8px);
}

.fxm .fxm__types--single .fxm__type {
	color: #fff;
	cursor: default;
}

.fxm__types[data-active="dealer"] .fxm__types-thumb {
	transform: translateX(100%);
	background: var(--fxm-marker-dealer);
}

.fxm .fxm__type {
	position: relative; /* above the thumb */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 9px 18px;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--fxm-text);
	font-family: "Inter", system-ui, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: color 0.25s ease;
}

.fxm__types--single[data-active="dealer"] .fxm__types-thumb {
	transform: none;
}

.fxm .fxm__type[aria-checked="true"] {
	color: #fff;
}

.fxm .fxm__type:focus-visible {
	outline: 2px solid var(--fxm-text);
	outline-offset: 2px;
}




.fxm__empty {
	position: absolute;
	top: 70px;
	left: 50%;
	z-index: 1000;
	margin: 0;
	padding: 8px 14px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	color: var(--fxm-text);
	font-size: 14px;
	transform: translateX(-50%);
}

.fxm__empty[hidden] {
	display: none;
}

@media (max-width: 480px) {
	.fxm .fxm__type {
		padding: 8px 12px;
		font-size: 13px;
	}
}

.fxm__error {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 16px;
	background: var(--fxm-map-bg);
	color: var(--fxm-text);
	font-size: 15px;
	text-align: center;
}

/* Overlay + card */
.fxm__overlay {
	position: absolute;
	inset: 0;
	z-index: 1100; /* above the map, Leaflet panes and controls */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.fxm__overlay[hidden] {
	display: none;
}

.fxm.is-open .fxm__overlay {
	opacity: 1;
}

/* The dialog holds one card (a pin) or a grid of them (a territory several partners
   cover): --fxm-cols per row (set by map.js, at most 3), fewer on narrow maps. */
.fxm__dialog {
	--fxm-cols: 1;
	position: relative;
	width: 100%;
	max-width: calc(var(--fxm-cols) * 420px + (var(--fxm-cols) - 1) * 16px);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	transform: translateY(8px);
	transition: transform 0.25s ease;
}

.fxm.is-open .fxm__dialog {
	transform: none;
}

.fxm__cards {
	display: grid;
	grid-template-columns: repeat(var(--fxm-cols), minmax(0, 1fr));
	gap: 16px;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

@media (max-width: 900px) {
	.fxm__dialog,
	.fxm__cards {
		max-width: calc(min(var(--fxm-cols), 2) * 420px + (min(var(--fxm-cols), 2) - 1) * 16px);
		grid-template-columns: repeat(min(var(--fxm-cols), 2), minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.fxm__dialog,
	.fxm__cards {
		max-width: 420px;
		grid-template-columns: minmax(0, 1fr);
	}
}

.fxm__card {
	position: relative;
	width: 100%;
	padding: 20px 20px 16px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
	color: var(--fxm-text);
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
}

/* In a grid the cards sit side by side: lighter shadow so they don't smudge together */
.fxm__dialog--grid .fxm__card {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Dark round button with an orange ring, sitting on the dialog's corner */
.fxm .fxm__close {
	position: absolute;
	z-index: 1;
	top: -14px;
	right: -14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 3px solid var(--fxm-accent);
	border-radius: 50%;
	background: var(--fxm-close-bg);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
	transition: transform 0.15s ease;
}

.fxm .fxm__close:hover {
	transform: scale(1.08);
}

.fxm .fxm__close:focus-visible {
	outline: 2px solid var(--fxm-accent);
	outline-offset: 2px;
}

.fxm .fxm__name {
	margin: 0 0 10px;
	padding: 0;
	font-family: "Inter", system-ui, sans-serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.25;
	color: var(--fxm-brand);
	text-transform: none;
	letter-spacing: normal;
}

.fxm .fxm__subheading {
	margin: 0 0 14px;
	font-weight: 700;
	font-size: 17px;
	line-height: 1.3;
	color: var(--fxm-muted);
}

.fxm .fxm__address {
	margin: 0 0 14px;
	color: var(--fxm-text);
}

.fxm .fxm__rows {
	margin: 0 0 14px;
}

.fxm .fxm__row {
	margin: 0;
	color: var(--fxm-text);
}

.fxm .fxm__item {
	display: inline-block;
	margin-right: 10px;
}

.fxm .fxm__tag {
	margin-right: 4px;
	font-weight: 700;
}

.fxm .fxm__card a {
	color: var(--fxm-text);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.fxm .fxm__card a:hover,
.fxm .fxm__card a:focus-visible {
	color: var(--fxm-brand);
}

/* Contact person box */
.fxm .fxm__contact {
	padding: 10px 12px 12px;
	background: var(--fxm-box-bg);
	border-radius: 6px;
}

.fxm .fxm__contact[hidden] {
	display: none;
}

.fxm .fxm__contact-title {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 2px;
	font-weight: 700;
	font-size: 15px;
	color: var(--fxm-brand);
}

.fxm .fxm__contact-icon {
	flex: none;
	color: var(--fxm-brand);
}

.fxm .fxm__contact-person {
	margin: 0 0 2px;
}

.fxm .fxm__sep {
	margin: 0 8px;
}

.fxm__subheading:empty,
.fxm__address:empty,
.fxm__row:empty,
.fxm__rows:not(:has(.fxm__row:not(:empty))) {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.fxm__map,
	.fxm__overlay,
	.fxm__dialog,
	.fxm-marker svg {
		transition: none;
	}
}
