/* ============================================================
   Client map view
   ============================================================ */

html, body { height: 100%; }
body { overflow: hidden; }

.map-shell {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: calc(100vh - 64px);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

/* LEFT — list */
.map-list {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}

.map-list-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.map-list-head .top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.map-list-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.map-list-head .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.map-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.map-search .ms { color: var(--text-muted); }
.map-search input {
  flex: 1;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 14px;
}

.map-filters {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.map-filters .chip { font-size: 12px; padding: 5px 10px; flex-shrink: 0; }
.map-filters .chip.active {
  background: var(--dark);
  color: var(--text-on-dark);
  border-color: var(--dark);
}

.map-results { flex: 1; overflow-y: auto; padding: 8px 0; }

.map-result {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.map-result:hover { background: var(--surface-2); }
.map-result.selected {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 0 var(--signal);
}

.map-result .num {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  align-self: flex-start;
  margin-top: 2px;
}
.map-result.selected .num { background: var(--signal); color: var(--signal-on); }
.map-result.featured .num::after {
  content: '★';
  position: absolute;
  top: -4px; right: -4px;
  font-size: 10px;
  color: var(--signal);
}

.map-result .info { min-width: 0; }
.map-result .info .n {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.map-result .info .m {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.map-result .info .m .star { color: var(--signal); font-weight: 600; }
.map-result .info .m .mono { color: var(--text-2); }
.map-result .info .tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.map-result .info .tag { font-size: 10px; padding: 2px 7px; }

.map-result .price {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  align-self: flex-start;
  margin-top: 2px;
}
.map-result .price .unit { font-size: 10px; color: var(--text-muted); font-weight: 400; display: block; }

/* RIGHT — map */
.map-canvas {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e9e6df 0%, #d8d3c2 100%);
}

/* fake map grid */
.map-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(15, 17, 21, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 17, 21, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* fake streets */
.map-streets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-streets svg { width: 100%; height: 100%; }

.map-pin {
  position: absolute;
  width: 40px; height: 40px;
  transform: translate(-50%, -100%);
  cursor: pointer;
  z-index: 5;
}
.map-pin .marker {
  width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0;
  background: var(--surface);
  border: 2px solid var(--dark);
  transform: rotate(-45deg);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(15,17,21,0.18);
}
.map-pin .marker span {
  transform: rotate(45deg);
}
.map-pin.selected .marker {
  background: var(--signal);
  border-color: var(--dark);
  transform: rotate(-45deg) scale(1.15);
  z-index: 6;
}
.map-pin.featured .marker {
  background: var(--dark);
  color: var(--signal);
}
.map-pin.featured.selected .marker {
  background: var(--signal);
  color: var(--signal-on);
}
.map-pin .shadow {
  position: absolute;
  bottom: -6px; left: 50%;
  width: 14px; height: 5px;
  background: rgba(15,17,21,0.25);
  border-radius: 50%;
  transform: translateX(-50%);
  filter: blur(2px);
}

/* user location */
.map-me {
  position: absolute;
  width: 16px; height: 16px;
  background: var(--info);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(31, 76, 171, 0.2);
  transform: translate(-50%, -50%);
  z-index: 4;
}
.map-me::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--info);
  opacity: 0.4;
  animation: pulse-me 2s ease-in-out infinite;
}
@keyframes pulse-me {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* radius circle */
.map-radius {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  border: 1.5px dashed rgba(31, 76, 171, 0.4);
  background: rgba(31, 76, 171, 0.04);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

/* controls */
.map-controls {
  position: absolute;
  top: 20px; right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}
.map-ctrl {
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  box-shadow: var(--sh-1);
}
.map-ctrl:hover { background: var(--surface-3); }
.map-ctrl.group { padding: 0; }
.map-ctrl.group button {
  width: 100%;
  background: transparent;
  border: 0;
  font-family: inherit;
  display: grid; place-items: center;
  cursor: pointer;
  padding: 9px 0;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.map-ctrl.group button:last-child { border-bottom: 0; }
.map-ctrl.group button:hover { background: var(--surface-3); color: var(--text); }

.map-view-toggle {
  position: absolute;
  top: 20px; left: 20px;
  z-index: 20;
}

/* floating selected-center card */
.map-card {
  position: absolute;
  bottom: 24px; left: 24px;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 16px;
  box-shadow: var(--sh-3);
  z-index: 15;
}
.map-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.map-card-head .ph {
  width: 56px; height: 56px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #2a2c32 0%, #1c1e23 100%);
  display: grid; place-items: center;
}
.map-card-head .ph .ms { color: var(--signal); font-size: 26px; }
.map-card-head .titles { flex: 1; padding: 0 12px; min-width: 0; }
.map-card-head .titles .n {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.map-card-head .titles .m {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 10px;
}
.map-card-head .titles .m .star { color: var(--signal); font-weight: 600; }
.map-card-head .close {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 0;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--text-muted);
}

.map-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 5px 0;
}
.map-card-row .ms { color: var(--text-muted); font-size: 16px; }
.map-card-row strong { font-weight: 600; }

.map-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.map-card-foot .price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.map-card-foot .price .muted { font-size: 11px; color: var(--text-muted); }
.map-card-foot .price .v {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.map-card-foot .actions { display: flex; gap: 6px; }
.map-card-foot .actions button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}
.map-card-foot .actions .primary {
  background: var(--dark);
  color: var(--text-on-dark);
  border-color: var(--dark);
  padding: 8px 14px;
}
