/**
 * Mappa Punti Vendita — stili frontend.
 *
 * Personalizzabile via custom property sul contenitore, es.:
 * .mpv-map-wrap { --mpv-height: 600px; --mpv-iw-accent: #8b1f2f; }
 */

/* ---------------------------------------------------------------------------
 * Contenitore e canvas
 * ------------------------------------------------------------------------- */

.mpv-map-wrap {
	--mpv-height: 450px;
	--mpv-radius: 10px;
	--mpv-iw-width: 264px;
	--mpv-iw-accent: #1a73e8;
	--mpv-iw-accent-hover: #1558b0;

	position: relative;
	width: 100%;
	margin-block: 1.5rem;
}

.mpv-map {
	position: relative;
	width: 100%;
	height: var( --mpv-height );
	min-height: 240px;
	border-radius: var( --mpv-radius );
	overflow: hidden;
	background: #eceff1;
	isolation: isolate;
}

@media ( max-width: 600px ) {
	.mpv-map {
		height: clamp( 280px, 60vh, var( --mpv-height ) );
	}
}

.mpv-map__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mpv-map.is-ready .mpv-map__placeholder {
	display: none;
}

.mpv-spinner {
	width: 28px;
	height: 28px;
	border: 2px solid rgba( 0, 0, 0, 0.15 );
	border-top-color: rgba( 0, 0, 0, 0.45 );
	border-radius: 50%;
	animation: mpv-spin 0.9s linear infinite;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.mpv-spinner { animation-duration: 3s; }
}

.mpv-map__message {
	margin: 0;
	padding: 1rem 1.25rem;
	text-align: center;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.mpv-map__message.is-error {
	color: #8a1c1c;
}

.mpv-empty {
	padding: 0.75rem 1rem;
	border-left: 3px solid #d1a300;
	background: rgba( 255, 214, 0, 0.08 );
	font-size: 0.9375rem;
}

.mpv-pin {
	display: block;
	width: auto;
	height: 44px;
	max-width: none;
}

/* ---------------------------------------------------------------------------
 * Contenitore InfoWindow di Google
 *
 * Google avvolge il contenuto in .gm-style-iw-c (la "card") e .gm-style-iw-d
 * (il wrapper scrollabile). Quest'ultimo ha overflow:auto inline, che produce
 * le barre di scorrimento quando il contenuto sfora anche di pochi pixel.
 * Le neutralizziamo e lasciamo che sia il nostro contenuto a definire l'altezza.
 * ------------------------------------------------------------------------- */

.gm-style .gm-style-iw-c {
	padding: 0 !important;
	border-radius: 10px !important;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.25 ) !important;
	max-width: none !important;
	max-height: none !important;
	overflow: visible !important;
}

.gm-style .gm-style-iw-d {
	overflow: visible !important;
	max-width: none !important;
	max-height: none !important;
	padding: 0 !important;
}

/* Il pulsante di chiusura resta sopra l'immagine full-bleed */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect {
	top: 4px !important;
	right: 4px !important;
	width: 30px !important;
	height: 30px !important;
	background: rgba( 255, 255, 255, 0.92 ) !important;
	border-radius: 50% !important;
	opacity: 1 !important;
	z-index: 2;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect > span {
	margin: 7px !important;
	width: 16px !important;
	height: 16px !important;
}

/* Coda/freccia sotto la card */
.gm-style .gm-style-iw-tc::after {
	background: #fff !important;
}

/* ---------------------------------------------------------------------------
 * Contenuto InfoWindow
 *
 * Tipografia dichiarata esplicitamente: il popup non eredita maiuscoletto,
 * serif o letter-spacing dal tema.
 * ------------------------------------------------------------------------- */

.mpv-iw,
.mpv-iw * {
	box-sizing: border-box;
}

.mpv-iw {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 400;
	font-style: normal;
	font-variant: normal;
	line-height: 1.45;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: #202124;

	width: var( --mpv-iw-width, 264px );
	max-width: 100%;
	overflow: hidden;
	border-radius: 10px;
	background: #fff;
}

/* Immagine in evidenza full-bleed in cima alla card.
   L'aspect-ratio viene impostato inline dal JS con le dimensioni reali del
   file; il tetto di 160px evita che una foto molto verticale occupi tutta
   la card. object-fit:cover ritaglia senza mai deformare. */
.mpv-iw__media {
	display: block;
	width: 100%;
	max-height: 160px;
	overflow: hidden;
	background: #f1f3f4;
	border-radius: 10px 10px 0 0;
	line-height: 0;
}

.mpv-iw__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	object-position: center;
	border-radius: 0;
	margin: 0;
	padding: 0;
	border: none;
}

.mpv-iw__body {
	padding: 12px 14px 14px;
}

.mpv-iw__title {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	font-style: normal;
	font-variant: normal;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	color: #202124;
	background: none;
	border: none;
}

.mpv-iw__text {
	margin: 0 0 6px;
	padding: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #5f6368;
}

.mpv-iw__text > *:first-child { margin-top: 0; }
.mpv-iw__text > *:last-child  { margin-bottom: 0; }

/* Indirizzo: testo semplice, non è un link */
.mpv-iw__address {
	margin: 0 0 10px;
	padding: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #5f6368;
}

.mpv-iw__meta {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: grid;
	gap: 3px;
}

.mpv-iw__meta-item {
	margin: 0;
	padding: 0;
	font-size: 13px;
	line-height: 1.4;
}

.mpv-iw__meta-item::before,
.mpv-iw__meta-item::marker {
	content: none;
}

.mpv-iw__meta-item a {
	color: var( --mpv-iw-accent );
	text-decoration: none;
	overflow-wrap: anywhere;
}

.mpv-iw__meta-item a:hover,
.mpv-iw__meta-item a:focus-visible {
	text-decoration: underline;
}

/* Pulsante indicazioni, centrato.
   background e color sono forzati anche negli stati hover/focus/active perché
   molti temi ridefiniscono i link e farebbero "sparire" il pulsante al passaggio
   del mouse. */
.mpv-iw__actions {
	display: flex;
	justify-content: center;
	margin: 0;
	padding: 2px 0 0;
}

.mpv-iw__button,
.mpv-iw__button:link,
.mpv-iw__button:visited {
	display: inline-block;
	padding: 9px 20px;
	border: none;
	border-radius: 999px;
	background-color: var( --mpv-iw-accent ) !important;
	background-image: none !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	font-style: normal;
	font-variant: normal;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none !important;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease;
}

.mpv-iw__button:hover,
.mpv-iw__button:focus,
.mpv-iw__button:focus-visible,
.mpv-iw__button:active {
	background-color: var( --mpv-iw-accent-hover ) !important;
	background-image: none !important;
	color: #fff !important;
	text-decoration: none !important;
	opacity: 1 !important;
	box-shadow: none;
}

.mpv-iw__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

/* Elenco testuale visivamente nascosto (SEO + screen reader) */
.mpv-fallback-list {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}
