﻿/* ============================================================
   Map Page V2 — Unified Design Language
   ============================================================ */

.map-main { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h)); }

/* ---- SEARCH BAR ---- */
.map-search-bar {
  padding: 16px 0; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.map-search-inner { display: flex; align-items: center; gap: 16px; }
.map-search-form {
  flex: 1; display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 8px 0 16px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.map-search-form:focus-within {
  border-color: rgba(23,92,211,.4);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.map-search-icon { width: 20px; height: 20px; flex: 0 0 20px; color: var(--ink-muted); }
.map-search-icon svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.map-search-form input {
  min-width: 0; flex: 1; border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 14px; font-weight: 600;
}
.map-search-form input::placeholder { color: var(--ink-muted); font-weight: 500; }
.map-search-form button {
  height: 36px; padding: 0 16px; color: var(--white); background: var(--blue);
  border: 0; border-radius: 9px; font-size: 13px; font-weight: 800;
  transition: background .2s var(--ease);
}
.map-search-form button:hover { background: var(--blue-deep); }

.map-filters { display: flex; gap: 8px; }
.map-filters select {
  height: 42px; padding: 0 30px 0 12px;
  color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 12px; font-weight: 700; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%23526276' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer;
}

/* ---- MAP LAYOUT ---- */
.map-layout {
  flex: 1; display: grid; grid-template-columns: 380px minmax(0, 1fr);
  min-height: 0;
}

/* ---- SIDE PANEL ---- */
.map-panel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border-right: 1px solid var(--line);
}
.map-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.map-panel-head strong { font-size: 14px; }
.map-result-count { color: var(--ink-muted); font-size: 12px; }
.map-result-count em { color: var(--blue); font-style: normal; font-weight: 800; }

.map-panel-list { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 10px; }

.map-list-card {
  display: grid; grid-template-columns: 80px 1fr; gap: 12px;
  padding: 12px; background: var(--paper);
  border: 1px solid var(--line-soft); border-radius: 14px;
  cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
}
.map-list-card:hover { border-color: rgba(23,92,211,.2); transform: translateY(-1px); }
.map-list-card.active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }

.map-list-thumb { position: relative; width: 80px; height: 80px; border-radius: 10px; overflow: hidden; background: #eef3fa; }
.map-list-thumb > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.map-list-thumb.has-photo .thumb-placeholder { visibility: hidden; }
.thumb-placeholder {
  width: 80px; height: 80px; display: grid; place-items: center;
  background: linear-gradient(135deg, #eef3fa, #e4ecf6); color: #b0bdd0;
}
.thumb-placeholder svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 1.2; }

.map-list-info { min-width: 0; }
.map-list-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.map-type-chip {
  padding: 2px 7px; color: var(--blue); background: var(--blue-pale);
  border-radius: 5px; font-size: 12px; font-weight: 800;
}
.map-fail-chip {
  padding: 2px 7px; color: var(--ink); background: #edf1f6;
  border-radius: 5px; font-size: 12px; font-weight: 800;
}
.map-new-chip {
  padding: 2px 7px; color: var(--white); background: var(--blue);
  border-radius: 5px; font-size: 12px; font-weight: 800;
}
.map-warning-chip {
  padding: 2px 7px; color: #fff; background: #8a4b08;
  border-radius: 5px; font-size: 12px; font-weight: 800;
}
.map-list-info h3 { margin: 0 0 3px; font-size: 13px; letter-spacing: -.2px; }
.map-list-info p { margin: 0 0 6px; color: var(--ink-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list-price { display: flex; align-items: center; justify-content: space-between; }
.map-list-price span { font-size: 11px; color: var(--ink-soft); }
.map-list-price strong { color: var(--blue); font-size: 13px; }
.map-list-price time { color: var(--ink-muted); font-size: 10px; }
.map-list-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--blue); font-size: 10px; font-weight: 800; }
.map-list-open:hover, .map-list-open:focus-visible { color: var(--blue-deep); text-decoration: underline; }

.map-list-info p,
.map-list-price span,
.map-list-price time,
.map-list-open,
.map-region-label,
.pin-price { font-size: 12px; }

/* ---- MAP CANVAS ---- */
.map-canvas { position: relative; background: #e8eef5; overflow: hidden; }
.map-surface {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(145deg, #eaf0f8 0%, #dfe8f2 50%, #e4ecf5 100%);
}
.map-surface[data-map-canvas] { display: block; overflow: hidden; }
.map-surface.leaflet-container { width: 100%; height: 100%; background: #dfe8f2; font-family: inherit; }
.map-surface.map-tiles-unavailable {
  background-color: #e5edf5;
  background-image: linear-gradient(rgba(255,255,255,.72) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.72) 1px, transparent 1px);
  background-size: 48px 48px;
}
.map-surface.map-tiles-unavailable .leaflet-tile-pane { opacity: .18; }
.map-surface.map-tiles-unavailable .map-region-label { max-width: min(440px, calc(100% - 32px)); color: #7c2d12; border-color: #fdba74; background: rgba(255,247,237,.96); }
.leaflet-price-marker { background: transparent; border: 0; }
.leaflet-price-marker .pin-price { display: block; text-align: center; }
.leaflet-price-marker .pin-price.is-active { color: var(--white); background: var(--blue); border-color: var(--blue); }
.leaflet-price-marker .pin-dot { display: block; margin: -2px auto 0; }
.leaflet-control-attribution { font-size: 10px; }
.map-grid-bg {
  position: absolute; inset: 0;
  background-color: #e5edf5;
  background-image: linear-gradient(rgba(255,255,255,.58) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.58) 1px, transparent 1px);
  background-size: 48px 48px;
}
.map-region-label {
  position: absolute; top: 16px; left: 16px; z-index: 1000;
  padding: 8px 12px; color: var(--ink-soft); background: rgba(255,255,255,.9);
  border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 750;
  box-shadow: var(--shadow-sm);
}
.map-loading, .map-no-coordinates {
  display: grid; place-items: center; min-height: 120px; padding: 20px;
  color: var(--ink-muted); text-align: center; font-size: 12px;
}
.map-no-coordinates { position: absolute; inset: 0; z-index: 1; line-height: 1.7; }

/* ---- MAP PINS ---- */
.map-pin {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -100%); cursor: pointer;
  transition: transform .2s var(--ease);
}
.map-pin:hover { transform: translate(-50%, -100%) scale(1.1); z-index: 10; }
.map-pin[data-active] { z-index: 11; }
.map-pin[data-active] .pin-price { background: var(--blue); color: var(--white); }

.pin-price {
  padding: 4px 9px; background: var(--white);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 11px; font-weight: 850; color: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  white-space: nowrap;
}
.pin-dot {
  width: 10px; height: 10px; margin-top: -2px;
  background: var(--blue); border: 2px solid var(--white);
  border-radius: 50%; box-shadow: 0 2px 6px rgba(23,92,211,.3);
}
.pin-dot.mint { background: var(--mint); box-shadow: 0 2px 6px rgba(52,199,143,.3); }

/* ---- MAP CONTROLS ---- */
.map-controls {
  position: absolute; right: 16px; bottom: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 6px;
}
.map-ctrl {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 18px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.map-ctrl:hover { background: var(--blue-pale); color: var(--blue); }
.map-ctrl svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.map-ctrl:focus-visible, .map-list-card:focus-visible, .map-search-form button:focus-visible {
  outline: 3px solid rgba(23,92,211,.34); outline-offset: 2px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 320px; }
  .map-panel { border-right: 0; border-top: 1px solid var(--line); order: 2; }
  .map-canvas { order: 1; min-height: 380px; }
  .map-panel-list { display: grid; grid-template-columns: repeat(2, 1fr); overflow-x: auto; }
  .map-filters { display: none; }
}

@media (max-width: 620px) {
  .map-search-inner { flex-direction: column; gap: 10px; }
  .map-search-form { width: 100%; }
  .map-layout { grid-template-rows: 280px 1fr; }
  .map-panel-list { grid-template-columns: 1fr; }
  .map-list-card { grid-template-columns: 64px 1fr; }
  .map-list-thumb, .thumb-placeholder { width: 64px; height: 64px; }
}
