/* ══════════════════════════════════════════════════════
 *  업체 지도 (공개) — 상단 메뉴형 (R6-2b2, 2026-11-11)
 *  /css/zones/place-map.css — inc/views/place/map-top.php 짝
 *  옛 place/css/place-map.css 의 동작용 규칙(로드뷰·바텀시트 상태·커서)을 새 톤으로 옮겼다. 옛 파일은 R6-2c 에서 삭제.
 *  PC: 머리말 70px 아래 지도 + 왼쪽 목록 패널(400px) + 그 옆 요약 카드
 *  모바일: 머리말 58px 아래 지도 + 위 검색 + 아래 바텀시트(map.js SHEET) + 요약은 아래에서 올라오는 카드
 * ══════════════════════════════════════════════════════ */
html:has(body.pm-body), body.pm-body { height: 100%; overflow: hidden; }
.pm-body .page { max-width: none; padding: 0; min-height: 0; }
.pm-body .tfoot { display: none; }

.pm-app { position: relative; height: calc(100vh - 70px); height: calc(100dvh - 70px); overflow: hidden; background: var(--ink-10); }
#mapWrap { position: absolute; inset: 0; z-index: 1; }
#kakaoMapWrap, #naverMapWrap { position: absolute; inset: 0; }
#kakaoMapWrap.rv-mode, #kakaoMapWrap.rv-mode * { cursor: url('/place/assets/img/rv-cursor.png') 16 27, crosshair !important; }

/* 불러오는 중 / 실패 */
.map-loading { position: absolute; top: 50%; left: calc(50% + 200px); transform: translate(-50%, -50%); z-index: 60; display: grid; justify-items: center; gap: 10px; padding: 22px 30px; background: rgba(255,255,255,.95); border-radius: var(--r-lg, 24px); box-shadow: var(--shadow-md); font-size: 14px; color: var(--ink-60); text-align: center; max-width: min(360px, calc(100% - 32px)); }
.map-loading.hidden { display: none; }
.pm-fallback { display: none; }
.map-loading.is-fail .pm-spin { display: none; }
.map-loading.is-fail .pm-fallback { display: inline-flex; }
.pm-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-lt); border-top-color: var(--accent); animation: pmspin 1s linear infinite; }
@keyframes pmspin { to { transform: rotate(360deg); } }

/* 지도 위 버튼 */
.map-controls { position: absolute; top: 16px; right: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.map-ctrl-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink-70); box-shadow: var(--shadow-md); cursor: pointer; }
.map-ctrl-btn svg { width: 20px; height: 20px; }
.map-ctrl-btn:hover { color: var(--accent); }
.map-ctrl-btn.active { background: var(--accent); color: #fff; }
.map-ctrl-btn.rv-active, .map-ctrl-btn.rv-active:hover { background: #2563eb; color: #fff; }
.map-ctrl-btn:focus-visible { outline: 3px solid var(--accent-md, var(--accent)); outline-offset: 2px; }

/* 로드뷰 */
#roadviewWrap { position: absolute; inset: 0; z-index: 80; display: none; background: #1a1a2e; }
#roadviewWrap.active { display: block; }
#roadviewContainer { width: 100%; height: 100%; }
.rv-close-btn { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 85; display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: 0; border-radius: var(--r-full); background: rgba(0,0,0,.72); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; backdrop-filter: blur(4px); }
#rvMiniMap { position: absolute; right: 24px; bottom: 24px; width: 200px; height: 150px; z-index: 85; border: 3px solid #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); }

/* 목록 패널 (PC) */
.side-panel { position: absolute; top: 0; left: 0; bottom: 0; width: 400px; z-index: 100; display: flex; flex-direction: column; background: var(--warm); box-shadow: 4px 0 24px rgba(0,0,0,.08); transition: transform .3s ease; }
.side-panel.collapsed { transform: translateX(-400px); }
.panel-toggle { position: absolute; top: 50%; right: -30px; transform: translateY(-50%); width: 30px; height: 64px; display: grid; place-items: center; border: 0; border-radius: 0 12px 12px 0; background: var(--paper); color: var(--ink-60); box-shadow: 4px 2px 10px rgba(0,0,0,.08); cursor: pointer; }
.panel-toggle svg { width: 16px; height: 16px; transition: transform .3s; }
.side-panel.collapsed .panel-toggle svg { transform: rotate(180deg); }
.mobile-handle { display: none; }

.panel-header { padding: 16px 16px 4px; background: var(--paper); border-bottom: 1px solid var(--ink-10); }
.pm-search { display: flex; gap: 6px; }
.pm-q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: var(--r-full); background: var(--warm); color: var(--ink-60); position: relative; }
.pm-q svg { width: 18px; height: 18px; flex: none; }
.pm-q input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 14.5px; color: var(--ink); }
.pm-q input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.pm-search .btn { height: 42px; border-radius: var(--r-full); }
.filter-chips-wrap { position: relative; margin-top: 10px; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; scroll-behavior: smooth; }
.filter-chips::-webkit-scrollbar { display: none; }
.f-chip, .mob-f-chip { flex: none; height: 32px; padding: 0 13px; border: 1px solid var(--ink-15); border-radius: var(--r-full); background: var(--paper); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-70); cursor: pointer; white-space: nowrap; }
.f-chip:hover, .mob-f-chip:hover { border-color: var(--accent); color: var(--accent-dk); }
.f-chip.active, .mob-f-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.f-chip:focus-visible, .mob-f-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-scroll-btn { position: absolute; top: 0; width: 32px; height: 32px; display: none; place-items: center; border: 0; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-sm); color: var(--ink-70); cursor: pointer; z-index: 2; }
.filter-scroll-btn.show { display: grid; }
.filter-scroll-btn svg { width: 14px; height: 14px; }
.filter-scroll-left { left: -4px; }
.filter-scroll-right { right: -4px; }

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; }
.result-count { font-size: 14px; color: var(--ink-60); }
.result-count em { font-style: normal; font-weight: 800; color: var(--ink); font-size: 16px; }
.result-sort { height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-full); background: var(--paper); box-shadow: var(--shadow-sm); font: inherit; font-size: 13px; color: var(--ink-70); cursor: pointer; }
.place-list { flex: 1; overflow-y: auto; padding: 0 12px 12px; display: grid; align-content: start; gap: 8px; overscroll-behavior: contain; }
.loading-more { display: none; padding: 10px; text-align: center; font-size: 13px; color: var(--ink-60); }
.no-results { margin: 8px 12px; display: grid; justify-items: center; gap: 4px; background: var(--paper); border-radius: var(--r-lg, 24px); }

/* 목록 카드 */
.pm-card { display: flex; gap: 12px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-sm); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.pm-card:hover { box-shadow: var(--shadow-md); }
.pm-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
.pm-card:focus-visible { outline: 3px solid var(--accent-md, var(--accent)); outline-offset: 2px; }
.pm-ph { position: relative; flex: none; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: var(--ink-10); }
.pm-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-ph-ic { display: none; }
.pm-ph.is-noimg, .pm-dph.is-noimg { display: grid; place-items: center; background: linear-gradient(140deg, var(--accent-lt), var(--warm)); }
.is-noimg .pm-ph-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.75); color: var(--accent); }
.is-noimg .pm-ph-ic svg { width: 20px; height: 20px; }
.pm-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pm-cat { font-size: 12px; font-weight: 600; color: var(--accent-dk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-ad { display: inline-block; margin-right: 6px; padding: 1px 6px; border: 1px solid var(--ink-30); border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.4; color: var(--ink-70); vertical-align: 1px; } /* 유료 우선 노출 '광고' 표시 (약관 v1.2 제11조) */
.pm-name { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pm-loc { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12.5px; color: var(--ink-60); }
.pm-loc svg { width: 14px; height: 14px; flex: none; }
.pm-loc em { font-style: normal; font-weight: 700; color: var(--accent-dk); margin-left: 4px; }
.pm-meta, .pm-dmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: auto; }
.pm-meta b, .pm-dmeta b { color: var(--ink); }
.pm-ask, .pm-muted { color: var(--ink-60); font-size: 12.5px; }
.pm-rate { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--ink); }
.pm-rate svg { width: 14px; height: 14px; color: var(--gold, #D9A441); fill: currentColor; }
.pm-rate small { font-weight: 500; color: var(--ink-60); }

/* 업체 요약 (PC: 패널 옆 카드) */
.detail-layer { position: absolute; top: 16px; left: 446px; bottom: auto; max-height: calc(100% - 32px); width: 380px; z-index: 200; display: none; flex-direction: column; background: var(--paper); border-radius: var(--r-lg, 24px); box-shadow: var(--shadow-lg); overflow: hidden; }
.detail-layer.open { display: flex; }
.detail-layer.panel-collapsed { left: 46px; }
#dlFullLink { display: none; }   /* map.js 가 주소를 넣는 자리 — 새 화면은 본문의 '상세 보기 · 문의' 버튼 하나만 보인다 */
.dl-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--ink-10); }
.dl-back { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-full); background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-70); cursor: pointer; }
.dl-back:hover { background: var(--warm); }
.dl-actions { display: flex; gap: 6px; }
.dl-btn { height: 34px; padding: 0 12px; border: 1px solid var(--ink-15); border-radius: var(--r-full); background: var(--paper); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-70); cursor: pointer; }
.dl-btn.wish-active { border-color: var(--accent); color: var(--accent); }
.dl-body { overflow-y: auto; overscroll-behavior: contain; }
.dl-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 220px; font-size: 13.5px; color: var(--ink-60); }
.pm-dph { display: grid; gap: 4px; height: 180px; background: var(--ink-10); }
.pm-dph.g2 { grid-template-columns: 2fr 1fr; }
.pm-dph.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pm-dph.g3 img:first-child { grid-row: span 2; }
.pm-dph img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.pm-dph.is-noimg .pm-ph-ic { width: 56px; height: 56px; }
.pm-dbody { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.pm-dname { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.pm-promo { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: 2px 0 0; padding: 5px 10px; border-radius: var(--r-full); background: var(--accent-lt); color: var(--accent-dk); font-size: 12.5px; font-weight: 700; }
.pm-promo svg { width: 14px; height: 14px; }
.pm-intro { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-70); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pm-dact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pm-dact .btn-acc { margin-left: auto; }

/* 지도 말풍선 (map.js) */
.map-iw { min-width: 180px; max-width: 240px; padding: 12px 14px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-md); font-size: 13px; }
.map-iw .iw-name { font-weight: 700; color: var(--ink); margin-bottom: 2px; font-size: 14px; }
.map-iw .iw-cat { font-size: 12px; color: var(--ink-60); margin-bottom: 4px; }
.map-iw .iw-price, .map-iw .iw-dist { font-size: 12.5px; font-weight: 600; color: var(--accent-dk); }
.map-iw .iw-link { display: inline-block; margin-top: 8px; padding: 6px 12px; border-radius: var(--r-full); background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 700; }

.mobile-search-overlay { display: none; }

/* ── 모바일 ── */
@media (max-width: 768px) {
  .pm-app { height: calc(100vh - 58px); height: calc(100dvh - 58px); }
  .map-loading { left: 50%; top: 40%; }
  .mobile-search-overlay { display: block; position: absolute; top: 0; left: 0; right: 0; z-index: 90; padding: 10px 12px 8px; background: linear-gradient(180deg, rgba(255,255,255,.96) 70%, rgba(255,255,255,0)); }
  .pm-msearch { display: flex; align-items: center; gap: 6px; }
  .pm-msearch .icon-btn { flex: none; background: var(--paper); box-shadow: var(--shadow-sm); }
  .pm-msearch .pm-q { background: var(--paper); box-shadow: var(--shadow-sm); padding-right: 4px; }
  .pm-q-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #fff; flex: none; cursor: pointer; }
  .pm-q-btn svg { width: 17px; height: 17px; }
  .mob-filter-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
  .mob-filter-chips::-webkit-scrollbar { display: none; }
  .mob-f-chip { box-shadow: var(--shadow-sm); }

  .side-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 40%; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.12); transform: none !important; transition: height .3s cubic-bezier(.4,0,.2,1); padding-bottom: env(safe-area-inset-bottom); }
  .panel-toggle, .panel-header { display: none; }
  .mobile-handle { display: flex; justify-content: center; padding: 12px 0 6px; cursor: grab; touch-action: none; flex: none; }
  .mobile-handle-bar { width: 44px; height: 5px; border-radius: 4px; background: var(--ink-15); }
  .result-bar { padding: 2px 16px 10px; touch-action: none; }
  .side-panel.sheet-peek .place-list, .side-panel.sheet-peek .loading-more, .side-panel.sheet-peek .no-results { display: none !important; }
  .side-panel.sheet-full { border-radius: 0; }
  .pm-ph { width: 76px; height: 76px; }

  .map-controls { top: auto; right: 12px; bottom: calc(40% + 14px); transition: bottom .3s cubic-bezier(.4,0,.2,1); }
  .map-ctrl-btn { width: 42px; height: 42px; }

  .detail-layer { top: auto; left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-height: 78%; z-index: 210; border-radius: 22px; }
  .pm-dph { height: 150px; }
  .pm-dact .btn { flex: 1; justify-content: center; }
  .pm-dact .btn-acc { flex-basis: 100%; margin-left: 0; }

  #rvMiniMap { width: 140px; height: 105px; right: 16px; bottom: 16px; border-radius: 10px; }
  .rv-close-btn { top: 12px; padding: 8px 16px; font-size: 13px; }
  .pm-q input, .result-sort { font-size: 16px; }   /* iOS 입력 확대 방지 */
}
@media (prefers-reduced-motion: reduce) {
  .pm-spin { animation-duration: 3s; }
  .side-panel, .map-controls { transition: none; }
}
