/**
 * Mapa do Pico — isolado sob .wf-map para não colidir com os mapas do nearby
 * (.wf-nearby) e do espectro (.wf-spectrum).
 */

.wf-map {
	--wf-map-radius: 8px;
	--wf-map-height: 420px;
	--wf-map-red: #e8112d;

	width: 100%;
	font-family: inherit;
	color: #1a1e2a;
	box-sizing: border-box;
	overflow: hidden;
	border-radius: var(--wf-map-radius);
}

/* ---- cabeçalho ---- */

.wf-map__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--wf-map-red);
	margin-bottom: 10px;
}

.wf-map__header-label {
	background: var(--wf-map-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1;
	padding: 9px 14px;
	border-radius: var(--wf-map-radius) var(--wf-map-radius) 0 0;
}

/* ---- botões de camada ---- */

.wf-map__layers {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
}

.wf-map__layer-btn {
	appearance: none;
	border: 1px solid #d7dbe2;
	background: #f4f6f9;
	color: #55607a;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	padding: 7px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.wf-map__layer-btn:hover { background: #e9edf3; }

.wf-map__layer-btn.is-active {
	background: var(--wf-map-red);
	border-color: var(--wf-map-red);
	color: #fff;
}

/* ---- área do mapa ---- */

.wf-map__canvas {
	position: relative;
	border-radius: var(--wf-map-radius);
	overflow: hidden;
}

.wf-map__leaflet {
	width: 100%;
	height: var(--wf-map-height);
	background: #dfe6ee;
}

/* Setas: canvas posicionado pelo Leaflet no overlayPane; sem captura de eventos. */
.wf-map__arrows { pointer-events: none; }

/* Legenda "Seg 21/07 · 12h" flutuando no topo. Deslocada à direita (52px) para
   não cobrir o controle de zoom do Leaflet, que fica no canto superior esquerdo. */
.wf-map__caption {
	position: absolute;
	top: 10px;
	left: 52px;
	z-index: 500;
	background: rgba(255, 255, 255, 0.88);
	color: #1a1e2a;
	font-size: 13px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	pointer-events: none;
	white-space: nowrap;
}

/* Legenda de escala do campo ativo (substitui os PNGs scalewh/wp/ws).
   Grid de 2 linhas: unidade à esquerda ocupando as duas; barra em cima e
   rótulos embaixo, alinhados às faixas. */
.wf-map__legend {
	position: absolute;
	bottom: 10px;
	left: 10px;
	right: 10px;
	z-index: 500;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 8px;
	max-width: 460px;
	margin: 0 auto;
	padding: 6px 10px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	pointer-events: none;
	color: #1a1e2a;
}

.wf-map__legend:empty { display: none; }

.wf-map__legend-unit {
	grid-row: 1 / 3;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.wf-map__legend-bar {
	display: flex;
	height: 10px;
	border-radius: 2px;
	overflow: hidden;
}

.wf-map__legend-cell { flex: 1 1 0; min-width: 0; }

.wf-map__legend-ticks {
	display: flex;
	margin-top: 2px;
}

/* Cada tick marca o LIMIAR INFERIOR da sua faixa, então o rótulo alinha à
   borda esquerda da célula. */
.wf-map__legend-tick {
	flex: 1 1 0;
	min-width: 0;
	font-size: 9px;
	line-height: 1;
	color: #33405a;
	white-space: nowrap;
}

/* Leaflet controls acima do canvas de setas. */
.wf-map .leaflet-control-container { z-index: 600; }

/* Botão "posição inicial" — empilha abaixo do zoom (mesmo topleft). Reenquadra
   o mapa na vista de inicialização (centrada no pico). */
.wf-map__home a {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wf-map__home svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
	display: block;
}

/* ---- modo preencher o container (mesma mecânica dos gráficos) ---- */

.elementor-widget:has(.wf-map--fill),
.elementor-widget:has(.wf-map--fill) > .elementor-widget-container {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
}

.elementor-widget:has(.wf-map--fill) > .elementor-widget-container { width: 100%; }

.wf-layout:has(> .wf-map--fill) {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
}

.wf-map--fill {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
	min-height: 0;
}

.wf-map--fill .wf-map__canvas {
	flex: 1 1 auto;
	min-height: 0;
}

.wf-map--fill .wf-map__leaflet {
	height: 100%;
}

.wf-map--fill .wf-map__header { flex: 0 0 auto; }

/* ---- responsivo ---- */

@media (max-width: 782px) {
	.wf-map { --wf-map-height: 320px; }
	.wf-map__caption { font-size: 12px; }
	.wf-map__layer-btn { padding: 6px 10px; font-size: 11px; }
}

/* ── Gate Pro: instante além do limite grátis (não-Pro) → mapa borrado + CTA
   "Assine o Waves Pro" (mesmo padrão das caixas de CTA). ────────────────── */
.wf-map__gate {
	position: absolute;
	inset: 0;
	z-index: 650;
	display: none;            /* oculto por padrão — só aparece com .wf-map--locked */
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: rgba(255, 255, 255, 0.35);
	-webkit-backdrop-filter: blur(6px) grayscale(55%);
	backdrop-filter: blur(6px) grayscale(55%);
}
/* Mostrado SOMENTE quando o instante passa do limite grátis (classe do JS). */
.wf-map--locked .wf-map__gate { display: flex; }
.wf-map--locked .wf-map__leaflet { filter: blur(4px); }
.wf-map--locked .wf-map__arrows  { opacity: 0; }
/* O teaser de colunas do gate (feito para gráficos) não cabe sobre o mapa. */
.wf-map__gate .wf-gate { background: transparent; min-height: 0; }
.wf-map__gate .wf-gate__teaser { display: none; }
