/* ── MAPA PAGE ──────────────────────────────────────────── */

.mapa-body {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.mapa-body .topnav { flex-shrink: 0; }

.mapa-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  overflow: hidden;
}

/* ── LEFT SIDEBAR ─────────────────────────── */
.mapa-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
}

.ms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  flex-shrink: 0;
}

.ms-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  color: var(--ink);
}

.ms-count {
  font-size: 12px; font-family: var(--font-mono);
  color: var(--ink-muted);
}

.ms-filters {
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.ftag {
  background: var(--cream-dark); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 4px 10px;
  font-size: 13px; font-family: var(--font-body); font-weight: 500;
  color: var(--ink-soft); cursor: pointer; transition: all 0.15s;
}
.ftag:hover { border-color: var(--amber); color: var(--amber); }
.ftag.active { background: var(--amber-light); border-color: var(--amber); color: var(--amber-dark); }

.ms-filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ms-toggle { gap: 6px !important; }

.toggle-label { display:flex; align-items:center; gap:10px; cursor:pointer; }
.toggle-input { display:none; }
.toggle-track { width:34px; height:20px; background:var(--border); border-radius:100px; position:relative; transition:background 0.2s; flex-shrink:0; }
.toggle-track::after { content:''; position:absolute; width:14px; height:14px; background:white; border-radius:50%; top:3px; left:3px; transition:transform 0.2s; box-shadow:var(--shadow-sm); }
.toggle-input:checked + .toggle-track { background:var(--amber); }
.toggle-input:checked + .toggle-track::after { transform:translateX(14px); }

.ms-list {
  flex: 1;
  overflow-y: auto;
}

/* Provider card in list */
.mp-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.mp-card:hover { background: var(--cream); }
.mp-card.active { background: var(--amber-light); border-left: 3px solid var(--amber); }

.mp-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.mp-info { flex: 1; min-width: 0; }
.mp-name  { font-weight: 600; font-size: 13.5px; color: var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mp-role  { font-size: 12px; color: var(--ink-soft); }
.mp-meta  { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.mp-rating { font-size: 12px; color: var(--amber); font-weight: 600; }
.mp-city   { font-size: 11px; color: var(--ink-muted); font-family: var(--font-mono); }

.mp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.mp-type-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ── MAP MAIN ─────────────────────────────── */
.mapa-main {
  position: relative;
  background: #e8f0e8;
  overflow: hidden;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#mapCanvas:active { cursor: grabbing; }

/* Map controls */
.map-controls {
  position: absolute;
  top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 10;
}

.mc-btn {
  width: 36px; height: 36px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.mc-btn:hover { background: var(--cream); }
.mc-btn.mc-active { background: var(--amber-light); border-color: var(--amber); }
.mc-sep { height: 8px; }

/* City filter */
.map-city-filter {
  position: absolute;
  top: 16px; left: 16px;
  display: flex; gap: 6px;
  z-index: 10;
  flex-wrap: wrap;
  max-width: 280px;
}

.mcf-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12.5px; font-family: var(--font-body); font-weight: 500;
  color: var(--ink-soft); cursor: pointer; transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.mcf-btn:hover { border-color: var(--amber); color: var(--amber); }
.mcf-btn.active { background: var(--amber); border-color: var(--amber); color: white; box-shadow: 0 2px 10px rgba(232,136,10,0.3); }

/* Tooltip */
.map-tooltip {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  min-width: 180px;
  pointer-events: none;
}

.map-tooltip.clickable { pointer-events: auto; }

.mt-name   { font-weight: 700; font-size: 14px; color: var(--ink); }
.mt-role   { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.mt-rating { font-size: 13px; color: var(--amber); margin-top: 4px; }
.mt-btn    { margin-top: 8px; width: 100%; pointer-events: auto; }

/* Legend */
.map-legend {
  position: absolute;
  bottom: 20px; right: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.ml-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.ml-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* Provider panel */
.provider-panel {
  position: fixed;
  right: 0; top: 62px; bottom: 0;
  width: 380px;
  background: var(--white);
  border-left: 1px solid var(--border);
  z-index: 50;
  overflow-y: auto;
  animation: slideInRight 0.3s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.provider-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,24,20,0.2);
  z-index: 49;
}

.pp-inner {
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
}

.pp-close {
  align-self: flex-end;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 12px;
  cursor: pointer; color: var(--ink-muted); font-size: 13px;
}
.pp-close:hover { background: var(--cream); }

.pp-avatar { font-size: 48px; text-align: center; }

.pp-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }
.pp-role { font-size: 13.5px; color: var(--ink-soft); margin-top: -8px; }
.pp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pp-stat { background: var(--cream); border-radius: var(--radius); padding: 10px; text-align: center; }
.pp-stat-n { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--ink); }
.pp-stat-l { font-size: 10px; color: var(--ink-muted); font-family: var(--font-mono); margin-top: 2px; }
.pp-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.pp-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 768px) {
  .mapa-layout { grid-template-columns: 1fr; }
  .mapa-sidebar { display: none; }
  .provider-panel { width: 100%; top: 0; }
}
