/**
 * /mapa — o mapa central do guia.
 *
 * Desenho do mockup "Pagina do mapa1.jpg" (dono, 21/09/2026): herói curto, barra de busca por cima
 * da dobra, chips de categoria, mapa grande à esquerda com a lista à direita, legenda sobre o mapa
 * e três blocos no fim. Os tokens (cor, raio, sombra, Inter) são os mesmos do hub.
 *
 * @author Valoar
 * @since  2.5.454 - 2026-09-21
 */

.mg-mapa {
	--mapa-azul: #1266d6;
	--mapa-marinho: #0d2b5c;
	--mapa-borda: #d7e1f0;
	--mapa-texto-2: #5a6c8a;
	--mapa-fundo: #f4f7fb;
	--mapa-raio: 16px;
	--mapa-sombra: 0 2px 10px rgba(13, 43, 92, .07);
	background: var(--mapa-fundo);
	padding-bottom: 44px;
}
.mg-mapa svg.mg-ico { fill: currentColor; stroke: none; }

/* ------------------------------- herói ------------------------------- */
.mg-mapa-hero { min-height: 260px; }
@media (min-width: 900px) { .mg-mapa-hero { min-height: 300px; } }
.mg-mapa-hero .mg-hub-hero__h1 { max-width: 18ch; font-size: clamp(28px, 4.2vw, 46px); }
.mg-mapa-hero .mg-hub-hero__sub { max-width: 58ch; margin-top: 12px; }

/* ------------------------------- busca ------------------------------- */
.mg-mapa-barra { display: grid; gap: 12px; margin-top: -34px; position: relative; z-index: 3; }
@media (min-width: 1100px) { .mg-mapa-barra { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }

.mg-mapa-busca {
	display: grid; gap: 10px; padding: 12px; border-radius: var(--mapa-raio);
	background: #fff; box-shadow: 0 8px 26px rgba(13, 43, 92, .12);
}
@media (min-width: 760px) { .mg-mapa-busca { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; } }

.mg-mapa-busca__campo { position: relative; display: flex; align-items: center; margin: 0; }
.mg-mapa-busca__campo svg { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--mapa-texto-2); }
.mg-mapa-busca__campo input {
	width: 100%; min-height: 48px; padding: 0 14px 0 44px; border: 0; border-radius: 12px;
	background: transparent; font-family: inherit; font-size: 15.5px; color: var(--mapa-marinho);
}
.mg-mapa-busca__campo input:focus-visible { outline: 3px solid #93c5fd; outline-offset: 0; }

.mg-mapa-busca__local {
	display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 16px; min-height: 48px;
	border-left: 1px solid var(--mapa-borda); color: var(--mapa-marinho); font-size: 15px; font-weight: 600;
}
.mg-mapa-busca__local svg { width: 18px; height: 18px; color: var(--mapa-azul); }
@media (max-width: 759.98px) { .mg-mapa-busca__local { border-left: 0; border-top: 1px solid var(--mapa-borda); padding-left: 8px; } }

.mg-mapa-busca .mg-hub-btn { min-height: 48px; }

.mg-mapa-perto {
	display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px;
	border: 1px solid var(--mapa-borda); border-radius: 99px; background: #fff; cursor: pointer;
	font-family: inherit; font-size: 15px; font-weight: 700; color: var(--mapa-marinho); box-shadow: var(--mapa-sombra);
	transition: border-color .15s, color .15s;
}
.mg-mapa-perto:hover { border-color: #b9cfee; color: var(--mapa-azul); }
.mg-mapa-perto svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.mg-mapa-perto.is-carregando { opacity: .6; pointer-events: none; }

/* ------------------------------- chips ------------------------------- */
/* O respiro entre a busca e os filtros, e entre os filtros e o mapa (o dono apontou os dois). */
.mg-mapa-filtros { margin-top: 26px; }
.mg-mapa-chips {
	display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none;
}
.mg-mapa-chip {
	display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; white-space: nowrap;
	border: 1px solid var(--mapa-borda); border-radius: 99px; background: #fff; cursor: pointer;
	font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--mapa-marinho);
	transition: background-color .15s, color .15s, border-color .15s;
}
.mg-mapa-chip svg { width: 18px; height: 18px; color: var(--chip-cor, var(--mapa-azul)); }
.mg-mapa-chip:hover { border-color: #b9cfee; }
.mg-mapa-chip.is-ativo { background: var(--mapa-azul); border-color: var(--mapa-azul); color: #fff; }
.mg-mapa-chip.is-ativo svg { color: #fff; }
.mg-mapa-chip:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* --------------------------- mapa + lista --------------------------- */
.mg-mapa-explorar { display: grid; gap: 16px; margin-top: 22px; }
@media (min-width: 1100px) { .mg-mapa-explorar { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); } }

.mg-mapa-quadro {
	position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--mapa-borda); border-radius: var(--mapa-raio);
	background: #e8eef6; box-shadow: var(--mapa-sombra);
}
/* O mapa preenche a coluna: se ficar com altura fixa, sobra uma faixa branca embaixo dele
 * quando a lista ao lado é mais alta. */
.mg-mapa-tela { flex: 1; min-height: 460px; }
@media (min-width: 1100px) { .mg-mapa-tela { min-height: 580px; } }

.mg-mapa-camadas {
	position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; overflow: hidden;
	border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(13, 43, 92, .2);
}
.mg-mapa-camadas button {
	min-height: 40px; padding: 0 16px; border: 0; background: #fff; cursor: pointer;
	font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--mapa-texto-2);
}
.mg-mapa-camadas button.is-ativo { background: #e8f1fd; color: var(--mapa-azul); }

.mg-mapa-legenda {
	position: absolute; right: 12px; bottom: 12px; z-index: 500; max-width: 330px; padding: 12px 14px;
	border-radius: 12px; background: rgba(255, 255, 255, .96); box-shadow: 0 2px 10px rgba(13, 43, 92, .18);
}
.mg-mapa-legenda__titulo { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--mapa-marinho); }
.mg-mapa-legenda ul { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.mg-mapa-legenda li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mapa-texto-2); }
.mg-mapa-legenda__ico svg { width: 15px; height: 15px; }
@media (max-width: 639.98px) { .mg-mapa-legenda { display: none; } }

/* marcador e agrupamento */
.mg-mapa-pino span {
	display: block; width: 26px; height: 26px; margin: 0 auto; border-radius: 99px 99px 99px 2px;
	background: var(--pino-cor, #1266d6); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(13, 43, 92, .35);
	transform: rotate(-45deg);
}
.mg-mapa-pino.is-ativo span { outline: 3px solid rgba(18, 102, 214, .35); }
.mg-mapa-cluster {
	display: grid; place-items: center; width: 38px; height: 38px; border-radius: 99px;
	background: var(--mapa-azul); color: #fff; font-size: 14px; font-weight: 800;
	border: 3px solid #fff; box-shadow: 0 2px 8px rgba(13, 43, 92, .3);
}

/* cartão do ponto escolhido */
.mg-mapa-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; overflow: hidden; }
.mg-mapa-popup .leaflet-popup-content { margin: 0; width: 240px !important; }
.mg-mapa-cartao img { display: block; width: 100%; height: 118px; object-fit: cover; }
.mg-mapa-cartao__corpo { padding: 12px 14px 14px; }
.mg-mapa-cartao__titulo { margin: 0; font-size: 15px; font-weight: 800; color: var(--mapa-marinho); }
.mg-mapa-cartao__nota { margin: 4px 0 0; font-size: 13px; color: #d9a406; }
.mg-mapa-cartao__nota b { color: var(--mapa-marinho); }
.mg-mapa-cartao__cat, .mg-mapa-cartao__local, .mg-mapa-cartao__dist { margin: 4px 0 0; font-size: 12.5px; color: var(--mapa-texto-2); }
.mg-mapa-cartao__acoes { display: flex; gap: 8px; margin: 12px 0 0; }
.mg-mapa-cartao__acoes a {
	flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 10px;
	border-radius: 9px; font-size: 13px; font-weight: 700; text-decoration: none;
}
.mg-mapa-cartao__ver { border: 1px solid var(--mapa-azul); color: var(--mapa-azul); }
.mg-mapa-cartao__zap { background: #128c7e; color: #fff; }

/* a lista */
.mg-mapa-lista {
	display: flex; flex-direction: column; border: 1px solid var(--mapa-borda); border-radius: var(--mapa-raio);
	background: #fff; box-shadow: var(--mapa-sombra); overflow: hidden;
}
.mg-mapa-lista__topo {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px;
	border-bottom: 1px solid var(--mapa-borda);
}
.mg-mapa-lista__conta { margin: 0; font-size: 15px; font-weight: 800; color: var(--mapa-marinho); }
.mg-mapa-lista__ordem select {
	min-height: 34px; padding: 0 8px; border: 1px solid var(--mapa-borda); border-radius: 9px;
	background: #fff; font-family: inherit; font-size: 13px; color: var(--mapa-texto-2);
}
.mg-mapa-itens { flex: 1; margin: 0; padding: 0; list-style: none; overflow-y: auto; max-height: 470px; }
@media (max-width: 1099.98px) { .mg-mapa-itens { max-height: 420px; } }
.mg-mapa-item + .mg-mapa-item { border-top: 1px solid var(--mapa-borda); }
.mg-mapa-item__botao {
	display: flex; gap: 12px; width: 100%; padding: 12px 18px; border: 0; background: none; cursor: pointer; text-align: left;
	transition: background-color .15s;
}
.mg-mapa-item__botao:hover, .mg-mapa-item.is-ativo .mg-mapa-item__botao { background: #f2f7fe; }
.mg-mapa-item__botao img, .mg-mapa-item__semfoto {
	flex: none; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #e8eef6;
}
.mg-mapa-item__corpo { min-width: 0; display: block; }
.mg-mapa-item__titulo { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.3; color: var(--mapa-marinho); }
.mg-mapa-item__cat { display: block; margin-top: 3px; font-size: 12.5px; color: var(--cor, var(--mapa-texto-2)); }
.mg-mapa-item__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--mapa-texto-2); }
.mg-mapa-item__meta b { color: var(--mapa-marinho); }
.mg-mapa-item__meta i, .mg-mapa-item__meta em { font-style: normal; }

/* `display` vence o atributo hidden: sem esta linha o estado vazio aparecia junto com a lista. */
.mg-mapa-vazio[hidden] { display: none; }
.mg-mapa-vazio { display: grid; gap: 8px; padding: 26px 18px; text-align: center; }
.mg-mapa-vazio strong { font-size: 15px; color: var(--mapa-marinho); }
.mg-mapa-vazio span { font-size: 13.5px; line-height: 1.5; color: var(--mapa-texto-2); }
.mg-mapa-vazio .mg-hub-btn { justify-self: center; margin-top: 6px; }

.mg-mapa-todos {
	display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 18px 18px; min-height: 44px;
	border: 1px solid var(--mapa-azul); border-radius: 10px; color: var(--mapa-azul);
	font-size: 14.5px; font-weight: 700; text-decoration: none;
}
.mg-mapa-todos:hover { background: #eaf2fd; }
.mg-mapa-todos svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.mg-mapa-aviso {
	position: absolute; left: 12px; right: 12px; top: 12px; z-index: 600; margin: 0; padding: 10px 14px;
	border-radius: 10px; background: rgba(13, 43, 92, .92); color: #fff; font-size: 13.5px; line-height: 1.45;
}

/* --------------------------- blocos do fim --------------------------- */
/* `.mg-hub ul { margin: 0 }` do hub tem mais especificidade que uma classe só — sem o prefixo a
 * margem some e os blocos colam no mapa (foi o que o dono viu). */
.mg-hub .mg-mapa-blocos { display: grid; gap: 22px; margin: 44px 0 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .mg-mapa-blocos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; } }
.mg-mapa-blocos li { display: flex; align-items: flex-start; gap: 13px; }
.mg-mapa-blocos__ico { flex: none; color: var(--mapa-azul); font-size: 26px; line-height: 1; }
.mg-mapa-blocos h2 { margin: 0; font-size: 16.5px; font-weight: 800; color: var(--mapa-marinho); }
.mg-mapa-blocos p { margin: 5px 0 0; font-size: 14px; line-height: 1.5; color: var(--mapa-texto-2); }

@media (prefers-reduced-motion: reduce) {
	.mg-mapa-chip, .mg-mapa-perto, .mg-mapa-item__botao { transition: none; }
}

/* ===================== FILTRO DO CELULAR ===================== *
 * No computador os chips ficam soltos na linha, como no mockup. No celular eles moram numa folha
 * que sobe pelo botão "Filtrar": a régua de chips (ui-ux-pro-max, "Chip Collection Reflow") proíbe
 * a fila cortada, e três linhas de chip comeriam a dobra do mapa.
 */
.mg-mapa-abrefiltro { display: none; }

@media (max-width: 759.98px) {
	.mg-mapa-abrefiltro {
		display: inline-flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 18px;
		border: 1px solid var(--mapa-borda); border-radius: 12px; background: #fff; cursor: pointer;
		font-family: inherit; font-size: 15px; font-weight: 700; color: var(--mapa-marinho); box-shadow: var(--mapa-sombra);
	}
	.mg-mapa-abrefiltro svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
	.mg-mapa-abrefiltro b { margin-left: auto; color: var(--mapa-azul); font-weight: 700; }

	.mg-mapa-chips__caixa {
		position: fixed; inset: auto 0 0 0; z-index: 9998; transform: translateY(101%);
		padding: 18px 18px 26px; border-radius: 18px 18px 0 0; background: #fff;
		box-shadow: 0 -8px 30px rgba(13, 43, 92, .25); transition: transform .22s ease;
	}
	.mg-mapa-chips__caixa.is-aberta { transform: none; }
	.mg-mapa-chips__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
	.mg-mapa-chips__cab p { margin: 0; font-size: 16px; font-weight: 800; color: var(--mapa-marinho); }
	.mg-mapa-chips__fechar {
		display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 99px;
		background: #f0f4fa; cursor: pointer; color: var(--mapa-texto-2);
	}
	.mg-mapa-chips__fechar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
	.mg-mapa-chips { flex-direction: column; gap: 8px; }
	.mg-mapa-chip { width: 100%; justify-content: flex-start; min-height: 50px; font-size: 15.5px; }

	/* véu atrás da folha */
	body.mg-mapa-filtrando::after {
		content: ""; position: fixed; inset: 0; z-index: 9997; background: rgba(6, 20, 40, .45);
	}
	body.mg-mapa-filtrando { overflow: hidden; }

	.mg-hub .mg-mapa-blocos { margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.mg-mapa-chips__caixa { transition: none; }
}
