/* Mapa de óticas parceiras — identidade Uplab/Autofokus (branco + navy + royal + ciano, Poppins). */
:root {
  --navy: #10264E;
  --royal: #1E70BE;
  --ciano: #27BED2;
  --ciano-escuro: #159bb0;
  --texto: #10264E;
  --texto-suave: #5b6b85;
  --borda: #e3e8f0;
  --fundo: #ffffff;
  --fundo-suave: #f4f7fb;
  --sombra: 0 6px 24px rgba(16, 38, 78, .14);
  --raio: 14px;
  --painel-largura: 360px;
  --fonte: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--fonte);
  color: var(--texto);
  background: var(--fundo-suave);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; }

.app {
  position: relative;
  display: grid;
  grid-template-columns: var(--painel-largura) 1fr;
  height: 100%;
  width: 100%;
  background: var(--fundo-suave);
}
.app:fullscreen { background: var(--fundo); }

/* ───── painel lateral ───── */
.painel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--fundo);
  border-right: 1px solid var(--borda);
  z-index: 5;
}
.painel-alca { display: none; }
.painel-topo { padding: 14px 14px 8px; border-bottom: 1px solid var(--borda); }

.busca {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px;
  border: 1.5px solid var(--borda); border-radius: 12px; background: var(--fundo);
  transition: border-color .15s, box-shadow .15s;
}
.busca:focus-within { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(30, 112, 190, .15); }
.busca svg { width: 18px; height: 18px; fill: none; stroke: var(--texto-suave); stroke-width: 2; flex: none; }
.busca input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14px; color: var(--texto);
}
.busca input::placeholder { color: #8b98ad; }
.busca input::-webkit-search-cancel-button { display: none; }
.limpar {
  border: 0; background: var(--fundo-suave); color: var(--texto-suave);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--borda); background: var(--fundo); color: var(--texto);
  font-size: 12.5px; font-weight: 500; transition: all .15s;
}
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.chip:hover { border-color: var(--royal); }
.chip.ativo { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-af.ativo { background: var(--royal); border-color: var(--royal); }
.chip-hy.ativo { background: var(--ciano-escuro); border-color: var(--ciano-escuro); }
.chip-perto { margin-left: auto; border-color: var(--ciano); color: var(--ciano-escuro); }
.chip-perto.ativo { background: var(--ciano); border-color: var(--ciano); color: #fff; }
.chip-perto.ocupado { opacity: .6; pointer-events: none; }

.resumo { margin: 10px 2px 2px; font-size: 12.5px; color: var(--texto-suave); }
.resumo strong { color: var(--texto); font-weight: 600; }

/* ───── lista ───── */
.lista { list-style: none; margin: 0; padding: 6px 8px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.lista::-webkit-scrollbar { width: 8px; }
.lista::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 8px; }
.item { margin: 0; }
.item button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 1.5px solid transparent; border-radius: 12px; background: transparent;
  transition: background .12s, border-color .12s;
}
.item button:hover { background: var(--fundo-suave); }
.item.selecionado button { background: #eaf3fc; border-color: var(--royal); }
.item-nome { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--texto); line-height: 1.25; }
.item-nome .ponto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--royal); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(30,112,190,.35); }
.item-end { margin: 3px 0 0 18px; font-size: 12px; color: var(--texto-suave); line-height: 1.35; }
.item-meta { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 18px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.tag-af { background: #e5effa; color: var(--royal); }
.tag-hy { background: #dff6f9; color: var(--ciano-escuro); }
.tag-aprox { background: #fff3dc; color: #9a6200; }
.dist { margin-left: auto; font-size: 11.5px; color: var(--texto-suave); font-weight: 500; }
.vazio { padding: 26px 16px; text-align: center; color: var(--texto-suave); font-size: 13px; line-height: 1.5; }

.painel-rodape { padding: 8px 14px 10px; border-top: 1px solid var(--borda); font-size: 10.5px; color: #8b98ad; line-height: 1.4; }
.painel-rodape a { color: inherit; }

/* ───── mapa ───── */
.mapa { position: relative; min-height: 0; }
.maplibregl-map { font-family: var(--fonte); }
.maplibregl-ctrl-group { box-shadow: var(--sombra) !important; border-radius: 10px !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 36px !important; height: 36px !important; }
.maplibregl-ctrl-attrib { font-size: 10px; }

.pin { display: flex; align-items: center; gap: 6px; cursor: pointer; will-change: transform; }
.pin .ponto {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--royal); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(16,38,78,.35);
  transition: transform .12s;
}
.pin.hybrid .ponto { background: var(--ciano-escuro); }
.pin.aprox .ponto { background: #fff; border-color: var(--royal); }
.pin .rotulo {
  padding: 3px 8px; border-radius: 6px; background: #fff; color: var(--navy);
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(16,38,78,.22); max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}
.pin:hover .ponto, .pin.selecionado .ponto { transform: scale(1.25); }
.pin.selecionado .rotulo { background: var(--navy); color: #fff; }

.cluster {
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 13px;
  border: 3px solid rgba(255,255,255,.9); box-shadow: 0 3px 10px rgba(16,38,78,.35);
  transition: transform .12s;
}
.cluster.medio { width: 46px; height: 46px; font-size: 14px; }
.cluster.grande { width: 56px; height: 56px; font-size: 15px; background: var(--royal); }
.cluster:hover { transform: scale(1.08); }

.maplibregl-popup { max-width: 300px !important; font-family: var(--fonte); }
.maplibregl-popup-content { padding: 14px 16px 12px; border-radius: 14px; box-shadow: var(--sombra); }
.maplibregl-popup-close-button { font-size: 20px; padding: 2px 8px; color: var(--texto-suave); }
.pop-nome { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0 18px 4px 0; line-height: 1.25; }
.pop-end { font-size: 12.5px; color: var(--texto-suave); line-height: 1.4; margin: 0; }
.pop-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.pop-acoes { display: flex; gap: 8px; margin-top: 12px; }
.pop-acoes a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; border-radius: 999px; text-decoration: none; font-size: 12.5px; font-weight: 600;
}
.pop-acoes .rota { background: var(--ciano); color: #fff; }
.pop-acoes .rota:hover { background: var(--ciano-escuro); }
.pop-acoes .fone { border: 1.5px solid var(--borda); color: var(--navy); }
.pop-acoes .fone:hover { border-color: var(--royal); }
.pop-aprox { margin: 8px 0 0; font-size: 11px; color: #9a6200; }

.aviso {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; box-shadow: var(--sombra); z-index: 6; max-width: 90%; text-align: center;
}

/* ───── celular: mapa em cima, lista como gaveta embaixo ───── */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .mapa { grid-row: 1; height: 100%; }
  .painel {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 46%; max-height: 82%;
    border-right: 0; border-top: 1px solid var(--borda);
    border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(16,38,78,.16);
    transition: height .25s ease;
  }
  .painel.recolhido { height: 150px; }
  .painel.aberto { height: 82%; }
  .painel-alca {
    display: flex; align-items: center; justify-content: center;
    height: 20px; border: 0; background: transparent; cursor: pointer; padding: 6px 0 0;
  }
  .painel-alca span { width: 44px; height: 5px; border-radius: 3px; background: #cfd8e6; }
  .painel-topo { padding: 4px 12px 8px; }
  .busca { height: 40px; }
  .chip { height: 28px; padding: 0 10px; font-size: 12px; }
  .chip-perto { margin-left: 0; }
  .painel-rodape { display: none; }
  .pin .rotulo { max-width: 150px; font-size: 10.5px; }
  .maplibregl-ctrl-top-right { top: 8px; right: 8px; }
}
