html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
}

/* evita scroll */
header {
  height: 56px;
}

#map {
  width: 100%;
  height: calc(100vh - 56px);
}

/* Header da Rede */
header.header-rede {
  background: #0a5a93;
  /* azul rede */
  color: #fff;
  height: 56px;
}

#chipsRow {
  background: #0a5a93;
  z-index: 1040;
}

/* Links e textos brancos */
header.header-rede .navbar-brand,
header.header-rede .nav-link,
header.header-rede .navbar-text,
header.header-rede .dropdown-toggle {
  color: #fff !important;
}

/* Botões do header: amarelo rede ou info bootstrap */
.btn-rede-amarelo {
  background: #ffce00;
  color: #0a5a93;
  border-color: #ffce00;
}

.btn-rede-amarelo:hover {
  filter: brightness(0.95);
}

.btn-rede-info {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

.bg-rede {
  background: #0a5a93;
}

.venda {
  background-color: #000080;
}
.aluguel {
  background-color: #094f3d;
}
.venda-aluguel {
  background-color: #6f42c1;
}

#offcanvasFiltros {
  background: #0a5a93;
  color: white;
}

/* Toolbar sob a header */
.toolbar-rede {
  position: relative;
  min-height: 45px;
  background: #0a5a93;
  color: #fff;
  z-index: 1048;
}

.toolbar-rede .form-check-label {
  color: #fff;
}

.toolbar-rede .form-check-input {
  cursor: pointer;
}

/* result-count centralizado na toolbar */
#result-count {
  background: #ffce00;
  color: #fff;
  font-weight: 700;
}

/* ajustar altura do mapa agora considerando header + toolbar */
#map {
  width: 100%;
  height: calc(100vh - 56px - 48px);
}

/* 56 header + ~48 toolbar */

/* Chips: só aparece quando tiver conteúdo */
#chipsRow:empty {
  display: none;
}

.pin-adv .pin-body {
  --pin-size: 35px;
  /* diâmetro do pin */
  --pin-border: 5px;
  /* espessura da borda colorida */
  background: var(--pin-color, #0d6efd);
  /* miolo branco */
  color: #111;
  width: var(--pin-size);
  height: var(--pin-size);
  border-radius: 999px;
  border: var(--pin-border) solid var(--pin-color, #0d6efd);
  /* cor pela finalidade */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-6px);
  user-select: none;
  padding: 0;
}

.pin-adv .pin-icon-img {
  width: 26px;
  /* ajuste fino do tamanho do pictograma */
  height: 26px;
  display: block;
  object-fit: contain;
}

/* clusters continuam “cheios” na cor, sem borda */
.pin-adv .pin-body.dense {
  background: var(--pin-color, #0d6efd);
  color: #fff;
  min-width: 28px;
  min-height: 28px;
  border: none;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.pin-adv .count {
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.pin-adv .pin-body.spider {
  --pin-size: 28px;
  --pin-border: 2px;
}

body.loading {
  overflow: hidden;
}

#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 94, 152, 1);
  z-index: 9999;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity var(--fade-dur, 800ms) ease;
  /* duração controlável */
  will-change: opacity;
}

#loadingOverlay.is-hiding {
  opacity: 0;
}

body.loading {
  overflow: hidden;
}

.globorede {
  width: clamp(140px, 25vw, 240px);
  height: auto;
}

.globoredepq {
  width: 40px;
}

/* === Tooltip custom sobre o mapa === */
.map-tooltip {
  position: absolute;
  z-index: 1060;
  /* ajuste fino da distância até o pin */
  --gap: 4px;
  /* mude para 4px ou 8px se quiser */
  transform: translate(-50%, calc(-100% - var(--gap)));
  /* acima do pin */
  pointer-events: none;
  max-width: 350px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
  border-radius: 10px;
  overflow: hidden;
}

/* Quando precisar aparecer abaixo do ponto */
.map-tooltip.below {
  transform: translate(-50%, var(--gap));
  /* abaixo do pin */
}

.map-tooltip .mt-card {
  color: #fff;
  padding: 10px 12px;
  line-height: 1.25;
  font-size: 13px;
}

.map-tooltip .mt-line + .mt-line {
  margin-top: 6px;
}

.map-tooltip .muted {
  opacity: 0.9;
}

.map-tooltip .strong {
  font-weight: 700;
}

/* Cluster tooltip: branco arredondado */
.map-tooltip.cluster .mt-card {
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
/* =========================================================
   SUMMARY PANEL (posicionamento legado só quando NÃO estiver dockado)
   ========================================================= */
.summary-panel:not(.dock-panel) {
  position: fixed;
  top: 122px;
  right: 12px;
  z-index: 1001;
  width: min(260px, 92vw);
}

.summary-panel {
  /* estilo visual compartilhado com o dock */
  background: #0a5a93;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  font-size: 0.95rem;
  max-height: 80vh;
}

.summary-head {
  background: #0a5a93;
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-body {
  padding: 10px 12px;
}

/* título seção */
.summary-subtitle {
  margin: 10px 0 6px;
  font-weight: bold;
  color: #fff;
  font-size: 0.9rem;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}
.summary-row:last-child {
  border-bottom: 0;
}

.summary-bullet {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.summary-label {
  flex: 1 1 auto;
}
.summary-val {
  font-weight: 600;
}
.summary-total {
  font-weight: 700;
}
.summary-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Só a lista de TIPOS rola */
.summary-types {
  max-height: 48vh;
  overflow: auto;
  overscroll-behavior: contain;
}
/* esconder scrollbar (webkit/ff/edge) */
.summary-types::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.summary-types {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Tooltip (mantém seu estilo) */
.mt-tip .mt-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 260px;
  max-width: 360px;
}
.mt-col-img {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mt-img-box {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}
.mt-img-box > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mt-area {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}
.mt-col-text {
  flex: 1 1 auto;
  display: block;
}
.mt-line {
  margin: 0 0 4px 0;
  line-height: 1.2;
}
.mt-line:last-child {
  margin-bottom: 0;
}
.mt-title {
  font-weight: 700;
}
.mt-end {
  font-size: 12px;
  color: #fff;
}
.mt-price .strong {
  font-weight: 700;
}

/* =========================================================
   DOCK LATERAL DIREITO (encaixa painéis lado-a-lado)
   ========================================================= */
.dock-right {
  position: fixed;
  top: 145px; /* alinhei com o summary antigo; ajuste se seu header/toolbar mudar */
  right: 12px;
  display: flex;
  align-items: flex-start;
  flex-direction: row-reverse; /* o último fica encostado à direita */
  gap: 12px;
  z-index: 1030; /* abaixo de modal (Bootstrap ~1055) */
  pointer-events: none; /* os painéis voltam a aceitar clique abaixo */
}
.dock-right > .dock-panel {
  flex: 0 0 auto;
}
/* Painel base (dockado) — altura dinâmica com teto 80vh */
.dock-panel {
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 260px;
  max-width: 82vw;

  /* visual igual ao summary */
  background: #0a5a93;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  /* chave p/ dinâmica: flex em coluna */
  display: none; /* controlado por .is-open */
  flex-direction: column;
  max-height: 80vh; /* teto de altura */
  overflow: hidden;
  transform: translateX(8px);
  opacity: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
  pointer-events: auto;
}
.dock-panel.is-open {
  display: flex; /* <- agora flex, não block */
  transform: translateX(0);
  opacity: 1;
}

/* Cabeçalho não cresce */
.dock-head,
.summary-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #0a5a93;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #fff;
}

/* Corpo cresce e rola quando necessário */
.dock-body,
.summary-body {
  flex: 1 1 auto;
  min-height: 0; /* importante p/ rolagem dentro do flex */
  overflow: auto;
  padding: 10px 12px;
}

/* Seções do favoritos */
.dock-subtitle {
  font-weight: 600;
  margin: 6px 0 4px;
  opacity: 0.95;
}
.dock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.dock-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 3px 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.9rem;
}
.dock-chip:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 8px rgba(253, 205, 0, 0.4);
}

/* rede de segurança para não criar barra horizontal */
#favoritesPanel .dock-body,
#favoritesPanel .dock-list {
  overflow-x: hidden;
}

/* o painel vira âncora do overlay */
#favoritesPanel {
  position: relative;
}

/* faixa fixa que mostra o endereço */
#favoritesPanel .fav-hover {
  position: absolute;
  left: 12px;
  right: 12px;
  /* top definido via JS para ficar logo abaixo da .dock-head */
  background: #39b2d6;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.25;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);

  /* multi-linha, sem estourar */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: left;

  /* transição suave */
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#favoritesPanel .fav-hover.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* segurança: nunca barra horizontal */
#favoritesPanel .dock-body,
#favoritesPanel .dock-list {
  overflow-x: hidden;
}

/* padrão */
.dock-panel {
  order: 0;
}

/* Opções = sempre mais à direita (row-reverse) */
.dock-panel--opts {
  order: -10;
}

/* Summary no meio, Favoritos mais à esquerda (exemplo) */
.dock-panel--tipos {
  order: 0;
}
.dock-panel--favs {
  order: 1;
}

.pin-adv .pulse-once {
  animation: pulse 0.9s ease-out 1;
}
@keyframes pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(13, 110, 253, 0));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(13, 110, 253, 0.6));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(13, 110, 253, 0));
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.98);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.02);
    opacity: 1;
  }

  100% {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* Responsivo */
@media (max-width: 991.98px) {
  .dock-right {
    top: 108px;
    gap: 8px;
  } /* ajuste fino pro mobile */
  .dock-panel {
    width: min(92vw, 340px);
  }
}

/* Respeita usuários com redução de movimento */
@media (prefers-reduced-motion: reduce) {
  #loadingOverlay {
    transition: none;
  }

  .globorede {
    animation: none;
  }
}
