/* Philco — Map Shortcode CSS
 * Projetado para fundo de seção #206A7A (teal)
 * Elementos sobre o fundo teal: texto branco
 * Elementos com fundo próprio (sidebar, card, overlay): branco + texto escuro
 * Cor de destaque: var(--philco-cor, #0d7d8a)
 */

*, *::before, *::after { box-sizing: border-box; }

.philco-mapa-section {
  font-family: 'DM Sans', 'Inter', sans-serif;
  background: transparent;
  color: #fff;
  padding: 60px 0 0;
}

/* ── Header ─────────────────────────────────────────────────────── */

.philco-mapa-header {
  text-align: center;
  padding: 0 24px 40px;
}

.philco-mapa-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #206A7A;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.philco-mapa-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  margin: 0 0 10px;
}

.philco-mapa-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Stats bar ──────────────────────────────────────────────────── */

.philco-mapa-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 0 24px 36px;
  flex-wrap: wrap;
}

.philco-mapa-stat { text-align: center; }

.philco-mapa-stat__num {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.philco-mapa-stat__lbl {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 3px;
}

/* ── Map wrapper ────────────────────────────────────────────────── */

.philco-mapa-wrap {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.philco-mapa-map {
  flex: 1;
  min-width: 0;
  position: relative;
}

/* ── Leaflet overrides ──────────────────────────────────────────── */

.philco-mapa-section .leaflet-container {
  background: #e8f3f5 !important;
}

.philco-mapa-section .leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1a3a42 !important;
  border-color: rgba(32, 106, 122, 0.25) !important;
}

.philco-mapa-section .leaflet-control-zoom a:hover {
  background: #fff !important;
  color: #206A7A !important;
}

.philco-mapa-section .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.82) !important;
  color: rgba(26, 58, 66, 0.5) !important;
  font-size: 10px !important;
}

.philco-mapa-section .leaflet-control-attribution a {
  color: #206A7A !important;
}

/* ── Loading overlay ────────────────────────────────────────────── */

.philco-mapa-loading {
  position: absolute;
  inset: 0;
  z-index: 2000;
  background: rgba(232, 246, 248, 0.97);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.4s ease;
}

.philco-mapa-loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

.philco-mapa-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(32, 106, 122, 0.18);
  border-top-color: #206A7A;
  border-radius: 50%;
  animation: philcoSpin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes philcoSpin {
  to { transform: rotate(360deg); }
}

.philco-mapa-loading-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(26, 58, 66, 0.85);
  letter-spacing: 0.01em;
}

.philco-mapa-loading-sub {
  font-size: 11px;
  color: rgba(26, 58, 66, 0.5);
  min-height: 16px;
  text-align: center;
  max-width: 240px;
}

.philco-mapa-progress-bar {
  width: 200px;
  height: 3px;
  background: rgba(32, 106, 122, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.philco-mapa-progress-fill {
  height: 100%;
  background: #206A7A;
  border-radius: 2px;
  width: 0%;
  transition: width 0.25s ease;
}

/* ── Sidebar ────────────────────────────────────────────────────── */

.philco-mapa-sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.philco-mapa-sidebar__top {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(32, 106, 122, 0.1);
}

.philco-mapa-sidebar__top h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(26, 58, 66, 0.45);
  margin: 0 0 10px;
}

.philco-mapa-search {
  width: 100%;
  background: rgba(32, 106, 122, 0.05);
  border: 1px solid rgba(32, 106, 122, 0.2);
  border-radius: 6px;
  padding: 7px 10px;
  color: #1a3a42;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.philco-mapa-search::placeholder {
  color: rgba(26, 58, 66, 0.32);
}

.philco-mapa-search:focus {
  border-color: #206A7A;
  background: rgba(32, 106, 122, 0.07);
}

/* ── Instalador list ────────────────────────────────────────────── */

.philco-mapa-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.philco-mapa-list::-webkit-scrollbar { width: 3px; }

.philco-mapa-list::-webkit-scrollbar-thumb {
  background: rgba(32, 106, 122, 0.22);
  border-radius: 4px;
}

.philco-item {
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 9px;
}

.philco-item:hover {
  background: rgba(32, 106, 122, 0.07);
  border-color: rgba(32, 106, 122, 0.22);
}

.philco-item.active {
  background: rgba(32, 106, 122, 0.12);
  border-color: #206A7A;
}

.philco-item__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #206A7A;
}

.philco-item__name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(26, 58, 66, 0.88);
  line-height: 1.3;
}

.philco-item__city {
  font-size: 11px;
  color: rgba(26, 58, 66, 0.48);
  margin-top: 1px;
}

.philco-item--no-coords {
  opacity: 0.55;
  cursor: default;
}

.philco-item--no-coords .philco-item__dot {
  background: rgba(32, 106, 122, 0.25);
  border: 1px dashed rgba(32, 106, 122, 0.4);
}

/* ── Detail card (popup flutuante) ──────────────────────────────── */

.philco-mapa-card {
  position: absolute;
  width: 280px;
  background: #ffffff;
  border: 1px solid rgba(32, 106, 122, 0.25);
  border-radius: 10px;
  padding: 16px 18px 14px;
  z-index: 999;
  pointer-events: all;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(32, 106, 122, 0.06);
  animation: philcoCardPop 0.16s ease;
}

@keyframes philcoCardPop {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* Seta para cima (card acima do marcador) */
.philco-mapa-card::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: var(--arrow-x, 50%);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-right: 1px solid rgba(32, 106, 122, 0.25);
  border-bottom: 1px solid rgba(32, 106, 122, 0.25);
  transform: translateX(-50%) rotate(45deg);
}

/* Seta para baixo (card abaixo do marcador) */
.philco-mapa-card.arrow-down::after {
  bottom: auto;
  top: -7px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(32, 106, 122, 0.25);
  border-top: 1px solid rgba(32, 106, 122, 0.25);
  transform: translateX(-50%) rotate(45deg);
}

.philco-mapa-card__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(26, 58, 66, 0.32);
  cursor: pointer;
  font-size: 15px;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s;
  line-height: 1;
}

.philco-mapa-card__close:hover { color: #1a3a42; }

.philco-mapa-card__tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #206A7A;
  font-weight: 700;
  margin-bottom: 3px;
}

.philco-mapa-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #0d2830;
  margin: 0 0 14px;
  padding-right: 22px;
  line-height: 1.3;
}

.philco-mapa-card__row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.philco-mapa-card__row:last-child { margin-bottom: 0; }

.philco-mapa-card__ico {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: rgba(32, 106, 122, 0.08);
  border: 1px solid rgba(32, 106, 122, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1;
}

.philco-mapa-card__info {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(26, 58, 66, 0.58);
}

.philco-mapa-card__info strong {
  color: rgba(26, 58, 66, 0.82);
  display: block;
  font-size: 11px;
  margin-bottom: 1px;
  font-weight: 600;
}

/* ── Footer ─────────────────────────────────────────────────────── */

.philco-mapa-footer {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
}

.philco-mapa-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.philco-mapa-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .philco-mapa-sidebar { display: none; }
  .philco-mapa-wrap    { height: 420px !important; }
  .philco-mapa-card    { width: 240px; }
}

/* ── Filtros (estado / cidade / botões) ─────────────────────────── */

.philco-mapa-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 16px 24px 20px;
}

.philco-mapa-filtros__grupo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}

.philco-mapa-filtros__grupo label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

.philco-mapa-filtros__grupo--btn {
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.philco-mapa-select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: #1a3a42;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23206A7A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.philco-mapa-select option {
  background: #fff;
  color: #1a3a42;
}

.philco-mapa-select:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.philco-mapa-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.philco-mapa-btn-buscar {
  padding: 8px 20px;
  background: #ffffff;
  color: #206A7A;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.philco-mapa-btn-buscar:hover {
  background: rgba(255, 255, 255, 0.88);
}

.philco-mapa-btn-limpar {
  padding: 8px 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}

.philco-mapa-btn-limpar:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

/* ── Empty state na sidebar ─────────────────────────────────────── */

.philco-list-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(26, 58, 66, 0.32);
  line-height: 1.7;
}

/* ── MarkerCluster overrides ────────────────────────────────────── */

.philco-mapa-section .marker-cluster-small,
.philco-mapa-section .marker-cluster-medium,
.philco-mapa-section .marker-cluster-large {
  background-color: rgba(32, 106, 122, 0.2) !important;
}

.philco-mapa-section .marker-cluster-small div,
.philco-mapa-section .marker-cluster-medium div,
.philco-mapa-section .marker-cluster-large div {
  background-color: rgba(32, 106, 122, 0.72) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

/* ── Responsivo filtros ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .philco-mapa-filtros             { flex-direction: column; padding: 12px 16px 16px; }
  .philco-mapa-filtros__grupo      { min-width: 100%; }
  .philco-mapa-filtros__grupo--btn { flex: 1; }
  .philco-mapa-btn-buscar          { flex: 1; }
  .philco-mapa-btn-limpar          { flex: 1; }
  .philco-mapa-btn-geolocate       { flex: 1; justify-content: center; }
}

/* ── Overview labels (contagem por estado) ──────────────────────── */

.philco-overview-label {
  background:  transparent !important;
  border:      none !important;
  box-shadow:  none !important;
  display:     flex;
  flex-direction: column;
  align-items: center;
  cursor:      pointer;
  pointer-events: auto;
}

.philco-ov-sigla {
  font-size:      10px;
  font-weight:    700;
  letter-spacing: 0.06em;
  color:          rgba(26, 58, 66, 0.55);
  line-height:    1;
}

.philco-ov-total {
  font-size:   13px;
  font-weight: 800;
  color:       #206A7A;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.philco-overview-label:hover .philco-ov-sigla {
  color: #0d2830;
}

.philco-overview-label:hover .philco-ov-total {
  filter: brightness(0.82);
}

/* ── Botão Perto de mim ─────────────────────────────────────────── */

.philco-mapa-btn-geolocate {
  display:      inline-flex;
  align-items:  center;
  gap:          6px;
  padding:      8px 14px;
  background:   transparent;
  color:        rgba(255, 255, 255, 0.68);
  border:       1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  cursor:       pointer;
  font-size:    12px;
  font-family:  inherit;
  white-space:  nowrap;
  transition:   color 0.2s, border-color 0.2s;
}

.philco-mapa-btn-geolocate:hover:not(:disabled) {
  color:        #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.philco-mapa-btn-geolocate:disabled {
  opacity: 0.4;
  cursor:  not-allowed;
}
