/* Aziende Map Pro 3 — tutto dentro .azm-locator, colori da variabili CSS (Impostazioni > Colori). */

.azm-locator {
	--azm-primary: #1e3a5f;
	--azm-on-primary: #fff;
	--azm-marker: #1e3a5f;
	--azm-marker-active: #e4572e;
	--azm-cluster: #1e3a5f;
	--azm-search-bg: #f5f6f8;
	--azm-panel-bg: #fff;
	--azm-hover: #f1f5f9;
	--azm-text: #1f2933;
	--azm-muted: #5f6b7a;
	--azm-link: #1e3a5f;
	--azm-border: #e3e7ec;
	--azm-radius: 8px;
	--azm-height: 560px;
	--azm-cols: 3;
	--azm-panel-w: 380px;

	color: var(--azm-text);
	font-size: 15px;
	line-height: 1.45;
	box-sizing: border-box;
	margin: 0 0 1.5em;
	max-width: 100%;
}

.azm-locator *,
.azm-locator *::before,
.azm-locator *::after {
	box-sizing: border-box;
}

.azm-locator .azm-title {
	text-align: center;
	margin: 0 0 .9em;
	font-size: 1.05em;
}

/* ---------- barra di ricerca ---------- */

.azm-locator .azm-search {
	display: grid;
	grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 14px 18px;
	align-items: end;
	background: var(--azm-search-bg);
	padding: 18px 20px;
	border: 1px solid var(--azm-border);
	border-bottom: 0;
	border-radius: var(--azm-radius) var(--azm-radius) 0 0;
	margin: 0;
}

.azm-locator .azm-search:not(:has(.azm-field-cat)) {
	grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
}

.azm-locator .azm-field label {
	display: block;
	font-weight: 600;
	font-size: .9em;
	margin: 0 0 6px;
	color: var(--azm-text);
}

.azm-locator .azm-input-group {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid var(--azm-border);
	border-radius: var(--azm-radius);
	overflow: hidden;
}

.azm-locator .azm-input-group:focus-within {
	border-color: var(--azm-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--azm-primary) 18%, transparent);
}

.azm-locator input.azm-q,
.azm-locator input.azm-filter,
.azm-locator select {
	font: inherit;
	color: var(--azm-text);
	margin: 0;
	min-height: 42px;
	box-shadow: none;
}

.azm-locator input.azm-q {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	padding: 8px 12px;
	background: transparent;
	outline: none;
}

.azm-locator select {
	width: 100%;
	border: 1px solid var(--azm-border);
	border-radius: var(--azm-radius);
	background-color: #fff;
	padding: 8px 32px 8px 12px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
}

.azm-locator select:focus {
	outline: none;
	border-color: var(--azm-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--azm-primary) 18%, transparent);
}

.azm-locator .azm-locate,
.azm-locator .azm-go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	margin: 0;
	padding: 0 14px;
	cursor: pointer;
	min-width: 46px;
	border-radius: 0;
	line-height: 1;
}

.azm-locator .azm-locate {
	background: transparent;
	color: var(--azm-muted);
}

.azm-locator .azm-locate:hover,
.azm-locator .azm-locate:focus-visible {
	color: var(--azm-primary);
	background: var(--azm-hover);
}

.azm-locator .azm-locate.is-busy svg {
	animation: azm-spin 1s linear infinite;
}

.azm-locator .azm-go {
	background: var(--azm-primary);
	color: var(--azm-on-primary);
}

.azm-locator .azm-go:hover,
.azm-locator .azm-go:focus-visible {
	filter: brightness(1.12);
}

/* ---------- corpo: elenco + mappa ---------- */

.azm-locator .azm-body {
	display: grid;
	grid-template-columns: var(--azm-panel-w) minmax(0, 1fr);
	height: var(--azm-height);
	border: 1px solid var(--azm-border);
	border-radius: 0 0 var(--azm-radius) var(--azm-radius);
	overflow: hidden;
	background: var(--azm-panel-bg);
}

.azm-locator.azm-layout-right .azm-body {
	grid-template-columns: minmax(0, 1fr) var(--azm-panel-w);
}

.azm-locator.azm-layout-right .azm-panel {
	order: 2;
	border-left: 1px solid var(--azm-border);
	border-right: 0;
}

.azm-locator .azm-panel {
	position: relative;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--azm-panel-bg);
	border-right: 1px solid var(--azm-border);
	scrollbar-width: thin;
}

.azm-locator .azm-panel-head {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: var(--azm-primary);
	color: var(--azm-on-primary);
}

.azm-locator .azm-count {
	flex: 0 0 auto;
	font-size: .92em;
	white-space: nowrap;
}

.azm-locator input.azm-filter {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 34px;
	border: 0;
	border-radius: calc(var(--azm-radius) - 2px);
	padding: 4px 10px;
	background: rgba(255, 255, 255, .95);
	font-size: .9em;
}

.azm-locator .azm-banner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin: 12px 14px 0;
	padding: 12px 34px 12px 14px;
	position: relative;
	border: 1px dashed var(--azm-border);
	border-radius: var(--azm-radius);
	background: var(--azm-hover);
	font-size: .92em;
}

.azm-locator .azm-banner[hidden],
.azm-locator .azm-origin[hidden] {
	display: none;
}

.azm-locator .azm-banner span {
	flex: 1 1 160px;
}

.azm-locator .azm-banner-close {
	position: absolute;
	top: 4px;
	right: 6px;
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	color: var(--azm-muted);
	cursor: pointer;
	padding: 4px;
}

.azm-locator .azm-origin {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 12px 14px 0;
	font-size: .9em;
	color: var(--azm-muted);
}

.azm-locator .azm-origin svg {
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	color: var(--azm-primary);
}

.azm-locator .azm-origin span {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--azm-text);
	font-weight: 600;
}

.azm-locator .azm-clear {
	border: 0;
	background: none;
	padding: 2px 4px;
	color: var(--azm-link);
	cursor: pointer;
	font-size: .95em;
	white-space: nowrap;
}

.azm-locator ol.azm-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.azm-locator .azm-card {
	display: flex;
	gap: 14px;
	margin: 0;
	padding: 16px 18px;
	border-bottom: 1px solid var(--azm-border);
	cursor: pointer;
	transition: background-color .15s ease;
	outline: none;
	position: relative;
}

.azm-locator .azm-card:hover,
.azm-locator .azm-card:focus-visible {
	background: var(--azm-hover);
}

.azm-locator .azm-card.is-active {
	background: var(--azm-hover);
	box-shadow: inset 4px 0 0 var(--azm-marker-active);
}

.azm-locator .azm-card-main {
	flex: 1 1 auto;
	min-width: 0;
}

.azm-locator .azm-name {
	margin: 0 0 6px;
	padding: 0;
	font-size: 1.02em;
	line-height: 1.3;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
	color: var(--azm-text);
	overflow-wrap: anywhere;
}

.azm-locator .azm-distance {
	display: inline-block;
	margin: 0 0 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--azm-primary) 12%, transparent);
	color: var(--azm-primary);
	font-size: .8em;
	font-weight: 700;
}

.azm-locator .azm-line {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0 0 4px;
	font-size: .9em;
	color: var(--azm-muted);
	overflow-wrap: anywhere;
}

.azm-locator .azm-line svg {
	width: 15px;
	height: 15px;
	flex: 0 0 15px;
	margin-top: 2px;
	color: var(--azm-muted);
	opacity: .85;
}

.azm-locator .azm-ico-txt {
	flex: 0 0 auto;
	font-size: .85em;
	font-weight: 600;
	min-width: 15px;
}

.azm-locator .azm-line a,
.azm-locator .azm-contacts a,
.azm-locator .azm-popup a {
	color: var(--azm-link);
	text-decoration: none;
}

.azm-locator .azm-line a:hover,
.azm-locator .azm-popup a:hover {
	text-decoration: underline;
}

.azm-locator .azm-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 8px 0 0;
}

.azm-locator .azm-tag {
	--azm-tag: var(--azm-muted);
	display: inline-block;
	padding: 1px 8px;
	border: 1px solid color-mix(in srgb, var(--azm-tag) 45%, transparent);
	border-radius: 999px;
	color: var(--azm-tag);
	font-size: .76em;
	font-weight: 600;
}

.azm-locator .azm-notes {
	margin: 8px 0 0;
	font-size: .86em;
	color: var(--azm-muted);
}

.azm-locator .azm-actions {
	margin-top: 12px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.azm-locator .azm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: 1px solid var(--azm-primary);
	border-radius: calc(var(--azm-radius) - 2px);
	background: var(--azm-primary);
	color: var(--azm-on-primary);
	padding: 8px 16px;
	font: inherit;
	font-size: .9em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: filter .15s ease;
}

.azm-locator .azm-btn:hover,
.azm-locator .azm-btn:focus-visible {
	filter: brightness(1.12);
	color: var(--azm-on-primary);
	text-decoration: none;
}

.azm-locator .azm-btn-ghost {
	background: transparent;
	color: var(--azm-primary);
}

.azm-locator .azm-btn-ghost:hover {
	background: var(--azm-hover);
	color: var(--azm-primary);
}

.azm-locator .azm-logo-box {
	flex: 0 0 84px;
	width: 84px;
	height: 84px;
	padding: 8px;
	border: 1px solid var(--azm-border);
	border-radius: var(--azm-radius);
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.azm-locator .azm-logo {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.azm-locator .azm-special .azm-name {
	letter-spacing: .04em;
}

.azm-locator .azm-status {
	padding: 14px 18px;
	text-align: center;
}

.azm-locator .azm-status:empty {
	display: none;
}

.azm-locator .azm-hint {
	margin: 0 0 10px;
	color: var(--azm-muted);
	font-size: .92em;
}

.azm-locator .azm-warn {
	color: #9a3412;
}

.azm-locator .azm-spinner {
	display: inline-block;
	width: 22px;
	height: 22px;
	border: 3px solid var(--azm-border);
	border-top-color: var(--azm-primary);
	border-radius: 50%;
	animation: azm-spin .8s linear infinite;
}

@keyframes azm-spin {
	to { transform: rotate(360deg); }
}

/* ---------- mappa ---------- */

.azm-locator .azm-map-wrap {
	position: relative;
	min-width: 0;
}

.azm-locator .azm-map,
.azm-locator .azm-single {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: #e9eef2;
}

.azm-locator .azm-single {
	position: relative;
	border-radius: var(--azm-radius);
	border: 1px solid var(--azm-border);
}

.azm-locator .leaflet-container {
	font: inherit;
	font-size: 14px;
}

.azm-locator .leaflet-container img {
	max-width: none !important;
	max-height: none !important;
}

.azm-locator .azm-pin {
	background: transparent;
	border: 0;
}

.azm-locator .azm-pin svg {
	display: block;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
	transition: transform .12s ease;
}

.azm-locator .azm-pin-body {
	fill: var(--azm-marker);
}

.azm-locator .azm-pin.is-active .azm-pin-body {
	fill: var(--azm-marker-active);
}

.azm-locator .azm-cluster {
	background: transparent;
}

.azm-locator .azm-cluster span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--azm-cluster);
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--azm-cluster) 28%, transparent);
}

.azm-locator .azm-cluster-lg span {
	font-size: 14px;
	box-shadow: 0 0 0 8px color-mix(in srgb, var(--azm-cluster) 25%, transparent);
}

.azm-locator .leaflet-popup-content-wrapper {
	border-radius: var(--azm-radius);
}

.azm-locator .leaflet-popup-content {
	margin: 12px 16px;
	line-height: 1.45;
	color: var(--azm-text);
}

.azm-locator .azm-popup strong {
	display: block;
	margin-bottom: 2px;
	font-size: 1.02em;
}

.azm-locator .azm-popup .azm-muted {
	color: var(--azm-muted);
}

.azm-locator .azm-popup-go {
	display: inline-block;
	margin-top: 6px;
	font-weight: 600;
}

/* ---------- elenco sotto la mappa (griglia, come la 2.x) ---------- */

.azm-locator.azm-layout-below .azm-body {
	display: flex;
	flex-direction: column-reverse;
	height: auto;
}

.azm-locator.azm-layout-below .azm-map-wrap {
	height: var(--azm-height);
}

.azm-locator.azm-layout-below .azm-panel {
	overflow: visible;
	border-right: 0;
	border-top: 1px solid var(--azm-border);
}

.azm-locator.azm-layout-below ol.azm-list,
.azm-locator ul.azm-grid {
	display: grid;
	grid-template-columns: repeat(var(--azm-cols), minmax(0, 1fr));
	gap: 0;
}

.azm-locator.azm-layout-below .azm-card {
	border-right: 1px solid var(--azm-border);
}

.azm-locator.azm-layout-below .azm-panel-head {
	position: static;
}

/* [aziende_lista] */

.azm-locator.azm-static ul.azm-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 16px;
}

.azm-locator.azm-static .azm-card {
	display: block;
	cursor: default;
	border: 1px solid var(--azm-border);
	border-radius: var(--azm-radius);
	background: var(--azm-panel-bg);
}

.azm-locator.azm-static .azm-logo {
	max-height: 48px;
	margin-bottom: 10px;
}

.azm-locator.azm-static .azm-addr,
.azm-locator.azm-static .azm-contacts {
	margin: 0 0 6px;
	font-size: .9em;
	color: var(--azm-muted);
}

.azm-admin-note {
	padding: 12px 14px;
	border-left: 4px solid #dba617;
	background: #fffbea;
	margin: 10px 0;
	font-size: 14px;
}

/* ---------- telefono e tablet ---------- */

@media (max-width: 900px) {
	.azm-locator {
		--azm-panel-w: 320px;
	}
	.azm-locator.azm-layout-below ol.azm-list,
	.azm-locator ul.azm-grid {
		grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	}
}

@media (max-width: 767px) {
	.azm-locator .azm-search {
		grid-template-columns: 1fr 1fr !important;
		padding: 14px;
	}
	.azm-locator .azm-field-place {
		grid-column: 1 / -1;
	}
	.azm-locator .azm-search:not(:has(.azm-field-cat)) .azm-field-dist {
		grid-column: 1 / -1;
	}
	.azm-locator .azm-body,
	.azm-locator.azm-layout-right .azm-body {
		display: flex;
		flex-direction: column-reverse;
		height: auto;
	}
	.azm-locator .azm-map-wrap {
		height: min(58vh, 420px);
		min-height: 280px;
	}
	.azm-locator .azm-panel,
	.azm-locator.azm-layout-right .azm-panel {
		overflow: visible;
		border: 0;
		border-top: 1px solid var(--azm-border);
	}
	.azm-locator .azm-panel-head {
		position: static;
	}
	.azm-locator.azm-layout-below ol.azm-list,
	.azm-locator ul.azm-grid {
		grid-template-columns: 1fr;
	}
	.azm-locator .azm-logo-box {
		flex-basis: 64px;
		width: 64px;
		height: 64px;
	}
}
