/* ═══════════════════════════════════════════════════════════════
   POPUP GetFeatureInfo (ferramenta "Identificar")
   Usa classe própria (.gfi-popup-wrapper) — NÃO reaproveitar
   .lote-popup-wrapper aqui, pois search.css força
   .lote-popup-wrapper.leaflet-popup { display: none !important; }
   para esconder o popup do marcador de endereço.

   A tira de cabeçalho usa as cores de categoria definidas em
   tokens.css (--cat-<cor>-bg / --cat-<cor>-text), aplicadas via
   classe .gfi-popup-head.<cor> — a mesma cor usada nos chips do
   painel de camadas ativas (alpColorClass) e no menu lateral
   (.layer-category-icon.<cor>).
═══════════════════════════════════════════════════════════════ */

.gfi-popup {
  font-family: var(--font-ui);
  min-width: 360px;
  max-width: 560px;
}

.gfi-popup-head {
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cat-grey-bg);
  color: var(--cat-grey-text);
}

.gfi-popup-head.blue       { background: var(--cat-blue-bg);       color: var(--cat-blue-text); }
.gfi-popup-head.green      { background: var(--cat-green-bg);      color: var(--cat-green-text); }
.gfi-popup-head.yellow     { background: var(--cat-yellow-bg);     color: var(--cat-yellow-text); }
.gfi-popup-head.purple     { background: var(--cat-purple-bg);     color: var(--cat-purple-text); }
.gfi-popup-head.orange     { background: var(--cat-orange-bg);     color: var(--cat-orange-text); }
.gfi-popup-head.terracotta { background: var(--cat-terracotta-bg); color: var(--cat-terracotta-text); }
.gfi-popup-head.darkblue   { background: var(--cat-darkblue-bg);   color: var(--cat-darkblue-text); }
.gfi-popup-head.pink       { background: var(--cat-pink-bg);       color: var(--cat-pink-text); }
.gfi-popup-head.grey       { background: var(--cat-grey-bg);       color: var(--cat-grey-text); }

.gfi-popup-head-icon {
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,.06);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gfi-popup-head-text {
  flex: 1;
  min-width: 0;
}

/* Subtítulo — nome da categoria, tom bem suave sobre a própria cor */
.gfi-popup-head-category {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}

.gfi-popup-head-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gfi-popup-body {
  padding: 10px 14px 12px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--md-grey-300) transparent;
}

.gfi-popup-body::-webkit-scrollbar { width: 4px; }
.gfi-popup-body::-webkit-scrollbar-thumb { background: var(--md-grey-300); border-radius: 2px; }

.gfi-layer-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.gfi-layer-title:first-child { margin-top: 0; }

.gfi-layer-title-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-hint);
}

.gfi-layer-title-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-hint);
}

.gfi-layer-title-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-hint);
  opacity: .55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gfi-layer-title-name.blue       { color: var(--cat-blue-text); }
.gfi-layer-title-name.green      { color: var(--cat-green-text); }
.gfi-layer-title-name.yellow     { color: var(--cat-yellow-text); }
.gfi-layer-title-name.purple     { color: var(--cat-purple-text); }
.gfi-layer-title-name.orange     { color: var(--cat-orange-text); }
.gfi-layer-title-name.terracotta { color: var(--cat-terracotta-text); }
.gfi-layer-title-name.darkblue   { color: var(--cat-darkblue-text); }
.gfi-layer-title-name.pink       { color: var(--cat-pink-text); }
.gfi-layer-title-name.grey       { color: var(--cat-grey-text); }

.gfi-layer-title-dot.blue       { background: var(--cat-blue-text); }
.gfi-layer-title-dot.green      { background: var(--cat-green-text); }
.gfi-layer-title-dot.yellow     { background: var(--cat-yellow-text); }
.gfi-layer-title-dot.purple     { background: var(--cat-purple-text); }
.gfi-layer-title-dot.orange     { background: var(--cat-orange-text); }
.gfi-layer-title-dot.terracotta { background: var(--cat-terracotta-text); }
.gfi-layer-title-dot.darkblue   { background: var(--cat-darkblue-text); }
.gfi-layer-title-dot.pink       { background: var(--cat-pink-text); }
.gfi-layer-title-dot.grey       { background: var(--cat-grey-text); }

.gfi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gfi-table tr {
  border-bottom: 1px solid var(--md-grey-100);
  transition: background var(--t-fast);
}

.gfi-table tr:last-child { border-bottom: none; }
.gfi-table tr:hover { background: var(--md-grey-50); }

.gfi-table td.gfi-col-name {
  width: 40%;
  padding: 6px 8px;
  vertical-align: middle;
  text-align: left;
}

.gfi-col-name-inner {
  display: inline;
  writing-mode: horizontal-tb;
  transform: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gfi-table td.gfi-col-divider {
  width: 1px;
  background: var(--md-grey-200);
  padding: 0;
}

.gfi-table td.gfi-col-val {
  padding: 6px 8px 6px 10px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
  line-height: 1.4;
}

.gfi-empty {
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-hint);
}

/* Botão de fechar (×) — tom escuro sobre o cabeçalho claro */
.gfi-popup-wrapper .leaflet-popup-close-button {
  width: 18px !important;
  height: 18px !important;
  top: 10px !important;
  right: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: currentColor !important;
  opacity: .5 !important;
  line-height: 18px !important;
  text-align: center !important;
  border-radius: 50% !important;
  background: transparent !important;
  transition: background 0.15s, opacity 0.15s !important;
}

.gfi-popup-wrapper .leaflet-popup-close-button:hover {
  background: rgba(0,0,0,.08) !important;
  opacity: .9 !important;
}