/* 지도 탐색 페이지 (테스트) — 에어비앤비형 1:1 분할.
   검색바·필터·칩·카드 스타일은 메인(search.css)을 그대로 쓰고, 여기선 배치만 바꾼다 */
/* 페이지 자체는 스크롤 가능 — 목록을 끝까지 스크롤하면 페이지가 이어서 내려가며
   전체 폭 푸터가 노출된다 (스크롤 체이닝). 네브바는 항상 상단 고정 */
body.page-map { overflow-x: hidden; }
body.page-map #site-header {
  position: sticky;
  top: 0;
  z-index: 90;
}
body.page-map .site-footer { display: none; } /* 지도 페이지는 푸터 없음 — 메인 찾기 페이지에 있음 */

body.page-map main.map-main {
  display: block;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ---------- 에어비앤비형 상단바: 로고(좌)·햄버거(우) 사이 중앙에 검색 필 ---------- */
body.page-map { position: relative; }
body.page-map #site-header .tc-nav-link { display: none; } /* 중앙 자리 확보 */
body.page-map .tc-appbar { display: none !important; }     /* 앱 배너 숨김 (지도 전용 화면) */
/* 로고·햄버거를 화면 좌우 끝으로 (에어비앤비식 풀블리드) — 양끝 여백은 넉넉히(시각 보정) */
body.page-map .tc-nav-container { max-width: none; padding: 0 32px; }
/* 햄버거 왼쪽 '내 차 공유하기' (map.js가 오른쪽 그룹으로 이동) — 메인과 동일한 .tc-nav-link 스타일 사용 */
body.page-map .tc-nav-group:last-child {
  display: flex;
  align-items: center;
  gap: 4px;
}
body.page-map #site-header .tc-nav-group:last-child .tc-nav-link--2nd {
  display: block;
  margin: 0 4px 0 0; /* 오른쪽 그룹에선 넓은 좌우 마진만 축소 */
  white-space: nowrap;
}

@media (min-width: 769px) {
  body.page-map .search-hero {
    position: fixed; /* 스티키 네브바와 함께 상단 고정 */
    top: 8px;
    left: 0;
    right: 0;
    width: auto;
    display: flex;
    justify-content: center;
    z-index: 95; /* 헤더(90) 위, 전체필터 모달(200) 아래 */
    min-height: 0;
    height: auto;
    padding: 0;
    margin: 0;
    background: transparent;
    pointer-events: none; /* 중앙 필 밖은 헤더 클릭 통과 */
    overflow: visible;    /* 메인의 overflow:hidden이 높이 0에서 필을 클리핑 */
    cursor: default;
  }
  body.page-map .search-hero .hero-copy {
    position: static; /* 메인의 absolute inset:0 해제 — 필이 흐름에 잡혀 중앙 정렬되게 */
    margin: 0;
    padding: 0;
    max-width: none;
    pointer-events: auto;
  }
  /* 메인 페이지와 같은 사각 박스 스타일 — 알약 컨테이너 없이 검색·날짜 박스 + 필터 버튼 */
  body.page-map .hero-search {
    width: min(640px, 50vw); /* 일정 칸이 '총 N시간'만 표시하도록 줄어 전체 폭도 축소 */
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  /* 데스크톱에도 검색 왼쪽 뒤로가기 (모바일과 동일 동작 — map.js가 생성) */
  body.page-map .map-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 10px; /* 검색·날짜 박스와 같은 사각 스타일 */
    background: #fff;
    color: var(--tds-text-general, #333);
    cursor: pointer;
    padding: 0;
  }
  body.page-map .map-back:hover { background: var(--bg-alternative, #f4f4f5); }
}
@media (max-width: 768px) {
  body.page-map .search-hero {
    min-height: 0;
    height: auto;
    background: #fff;
    padding: 10px 16px 4px;
    margin: 0;
    border-radius: 0;
  }
  body.page-map .search-hero .hero-copy { max-width: none; width: 100%; margin: 0; padding: 0; }
}

/* 검색 필 안의 전체필터 버튼 (map.js가 filter-master를 이동) — 에어비앤비식 '필터 N' 알약 */
body.page-map .hs-filter-btn {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  height: 44px; /* 검색·날짜 박스와 같은 높이 */
  padding: 0 16px;
  border-radius: 10px; /* 메인 박스들과 같은 사각 스타일 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: #fff;
}
body.page-map .hs-filter-btn .tds-chip__content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.page-map .hs-filter-label { font-size: 14px; font-weight: 600; }
/* 필터가 선택된 상태: 초록 1.5px 테두리 */
body.page-map .hs-filter-btn.is-selected {
  border: 1.5px solid var(--tds-primary-general, #00b140);
  padding: 0 15.5px; /* 테두리 증가분 보정 */
}
body.page-map .hs-filter-cnt {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tds-primary-general, #00b140);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-sizing: content-box;
}
body.page-map .hs-filter-cnt[hidden] { display: none; }

/* 필터 칩 줄은 숨기고(전체필터 모달로 대체), 선택된 칩·초기화만
   네브바 검색창 아랫줄에 중앙 정렬로 노출 */
/* 필터바는 통째로 숨김 — 목록 스크롤이 정확히 네브바 경계선에서 잘리게 (요소는 placeHeroSearch가 참조하므로 DOM엔 유지) */
body.page-map .filter-bar { display: none; }
body.page-map .filter-line { display: none; }
body.page-map .chips-line { display: none !important; } /* 선택 칩 줄 제거 — 필터 버튼 배지로 대체 */
/* 예외: 모바일 바텀시트 안으로 옮겨진 칩 줄은 표시 — 어떤 조건인지 보이게 (map.js placeChips) */
body.page-map .map-listcol > .chips-line { display: flex !important; margin-top: 2px; margin-left: -6px; padding: 2px 2px 8px; } /* pill이 혼자 튀어 보이지 않게 살짝만 당김 */
body.page-map .map-listcol > .chips-line[hidden] { display: none !important; }
body.page-map .map-listcol > .chips-line .chips-reset { display: none; } /* 전체 삭제는 정렬 드롭다운과 겹쳐 시트에선 생략 */

/* ---------- 본문: 목록·지도 1:1 ---------- */
.map-split {
  height: calc(100dvh - var(--map-hdr, 60px)); /* 네브바 높이는 map.js가 측정해 주입 */
  display: flex;
}
.map-listcol {
  width: 50%;
  flex: 0 0 50%;
  min-width: 0;
  overflow-y: auto;
  overflow-anchor: none;
  /* 상단 16px = 메인의 네브바→히어로 간격과 동일 (패딩이라 스크롤 시엔 네브바 선에서 잘림) */
  padding: 16px 12px 0 32px;
  scrollbar-width: none; /* 에어비앤비처럼 스크롤바 숨김 (스크롤은 유지) */
}
.map-listcol::-webkit-scrollbar { display: none; }
.map-listcol .result-head { margin-top: 0; padding-left: 6px; } /* 데스크톱 '지도에 표시된 차량' 들여쓰기 */
/* 에어비앤비 '숙소 1,000개 이상'처럼 큰 카운트 제목 */
body.page-map #result-count { font-size: 20px; font-weight: 600; color: #1a1a1a; }
/* 카운트(20px)와 정렬 트리거(14px)의 글자 아랫라인 정렬 */
body.page-map .result-head { align-items: baseline; }
body.page-map .result-head .result-right { align-items: baseline; }
/* 정렬 옆 GPS 버튼은 지도 페이지에선 제거 — 지도 우하단 내위치 버튼이 대신함 (동기화 로직은 유지) */
body.page-map #loc-btn { display: none; }
body.page-map #result-count::before { content: '지도에 표시된 차량\00a0'; } /* 공백 유지용 nbsp */
/* 검색·필터 중엔 리스트가 뷰포트와 무관하게 결과셋 고정 — 라벨로 상태 표시 */
body.page-map.map-filtered #result-count::before { content: '조건에 맞는 차량\00a0'; }
/* 에어비앤비처럼 작은 카드 — 1:1 분할 유지하며 폭에 따라 3→2→1열 (최대 3열) */
body.page-map #car-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 22px; }
@media (max-width: 1440px) {
  body.page-map #car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) and (min-width: 769px) {
  body.page-map #car-grid { grid-template-columns: 1fr; }
}
/* 데스크톱 지도 전체화면 — 리스트를 숨기고 지도가 전체 폭 */
body.page-map.map-fullscreen .map-listcol { display: none; }
body.page-map.map-fullscreen .map-canvas-wrap { margin-left: 32px; } /* 리스트 패딩 몫 보정 — 좌우 여백 대칭 */
.map-expand {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 45;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  cursor: pointer;
}
.map-expand:hover { background: var(--bg-alternative, #f4f4f5); }
@media (max-width: 768px) { .map-expand { display: none; } } /* 모바일은 시트가 역할 대신 */

/* 지도 라운드 카드 */
.map-canvas-wrap {
  position: relative;
  width: 50%;
  flex: 1;
  min-width: 0;
  margin: 16px 32px 24px 20px; /* 좌측: 목록 패딩 12px와 합쳐 32px — 페이지 좌우 여백과 동일 */
  border-radius: 20px;
  overflow: hidden;
}
/* 네이버 지도가 컨테이너에 position:relative를 인라인으로 덮어쓰므로
   absolute+inset 대신 명시적 100% 크기를 준다 (아니면 높이 0) */
#map-canvas { width: 100%; height: 100%; }

/* ---------- 내 위치 ---------- */
.map-myloc {
  position: absolute;
  right: 16px;
  bottom: 24px;
  z-index: 50;
  box-sizing: border-box; /* 테두리 포함 44px — 활성(테두리 2px) 시에도 정원 유지 */
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--tds-line-general-general, #e5e5e9); /* 필터 버튼과 같은 테두리 */
  border-radius: 999px; /* 라벨이 생겨 원형 → 알약 */
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #333;
  cursor: pointer;
}
.myloc-label {
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  max-width: 160px; overflow: hidden;
  transition: max-width .25s ease, opacity .18s ease;
}
.map-myloc:hover { color: var(--tds-primary-general, #00b140); }
.map-myloc.is-on {
  background: var(--tds-primary-general, #00b140); color: #fff;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); /* 숫자 클러스터와 동일한 흰 테두리 */
}
/* 켜진 뒤에는 라벨을 접고 원형으로 — 면적 최소화 (라벨 max-width 접힘 애니메이션) */
.map-myloc { transition: background .18s, padding .25s ease, gap .25s ease; }
.map-myloc.is-on { padding: 0 10px; gap: 0; } /* 10+아이콘20+10+테두리4 = 44px 정원 (border-box) */
.map-myloc.is-on .myloc-label { max-width: 0; opacity: 0; }
.map-myloc.is-on:hover { color: #fff; }
.map-myloc.is-loading { opacity: .5; pointer-events: none; }
.my-loc-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, .35), 0 1px 4px rgba(0, 0, 0, .3);
  animation: myloc-pulse 2s ease-out infinite;
}
@keyframes myloc-pulse {
  0% { box-shadow: 0 0 0 2px rgba(26, 115, 232, .35), 0 0 0 0 rgba(26, 115, 232, .35); }
  70% { box-shadow: 0 0 0 2px rgba(26, 115, 232, .35), 0 0 0 16px rgba(26, 115, 232, 0); }
  100% { box-shadow: 0 0 0 2px rgba(26, 115, 232, .35), 0 0 0 0 rgba(26, 115, 232, 0); }
}

/* ---------- 가격 마커 / 클러스터 ---------- */
.tc-marker {
  display: inline-flex;       /* 크기 다른 폰트(가격·대수) 수직 중앙 정렬 */
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  font: 700 15px/1 Pretendard Variable, Pretendard, sans-serif;
  color: #1a1a1a;
  white-space: nowrap;
  cursor: pointer;
}
.tc-marker, .tc-cluster { transition: background-color .18s, border-color .18s, color .18s; } /* 검↔초록/흰 전환 부드럽게 (호버 아웃 플래시 완화) */
.tc-marker:hover { transform: scale(1.06); }
.tc-marker.is-active {
  background: #1a1a1a; /* 선택도 호버와 동일한 검/흰 */
  border-color: #1a1a1a;
  color: #fff;
}
.tc-marker .tc-cnt { font-weight: 600; font-size: 12.5px; line-height: 1; color: var(--label-alternative, #888); }
/* 깊은 줌(15+)의 1대 배지에 붙는 차량명 — 길면 말줄임 */
.tc-marker .tc-name {
  display: inline-block;
  margin-left: 3px; /* 가격과 차명 사이 간격 (flex gap 3px에 더해 총 6px) */
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.tc-marker.is-active .tc-cnt { color: rgba(255, 255, 255, .85); }
/* 데스크톱 리스트 호버 → 해당 배지 검정/흰 강조 (선택 초록과 구분, 눈에 띄게) */
.tc-marker.is-hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
  transform: scale(1.06);
}
.tc-marker.is-hover .tc-cnt { color: rgba(255, 255, 255, .8); }
.tc-cluster.is-hover { background: #1a1a1a; transform: scale(1.08); }
/* 마커 자체에 마우스를 올려도 동일한 검/흰 강조 (선택 초록보다 우선, 터치 기기는 제외) */
@media (hover: hover) {
  .tc-marker:hover { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
  .tc-marker:hover .tc-cnt { color: rgba(255, 255, 255, .8); }
  .tc-cluster:hover { background: #1a1a1a; }
}
.tc-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tds-primary-general, #00b140);
  color: #fff;
  font: 700 14px/1 Pretendard Variable, Pretendard, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  border: 2px solid #fff;
  cursor: pointer;
}
.tc-cluster:hover { transform: scale(1.08); }
.tc-cluster.is-active { background: #1a1a1a; } /* 선택도 호버와 동일한 검/흰 */

/* ---------- 마커 팝업 (가격 마커 바로 위 앵커) ---------- */
.map-cardwrap { position: relative; width: 0; height: 0; }
.map-minicard {
  position: absolute;
  left: 0;
  bottom: 26px; /* 가격 핀 높이 + 간격 */
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 48px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28);
  overflow: hidden;
  cursor: default;
}
/* 팝업과 배지 사이 틈을 호버 영역으로 연결 (팝업 폭 전체 × 틈 높이).
   배지 '아래'는 다리가 없어 벗어나면 즉시 닫힌다 */
.map-minicard::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 11px; /* 팝업 하단(-26px)과 배지 상단(-16px) 사이 틈 */
}
/* 지도 위쪽 배지: 위 공간이 부족하면 팝업을 배지 아래로 플립 (지도는 안 움직임) */
.map-minicard.is-below { bottom: auto; top: 26px; }
.map-minicard.is-below::after { top: auto; bottom: 100%; }
.map-minicard .mc-body { display: block; text-decoration: none; color: inherit; }
.map-minicard .mc-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3; /* 차량 사진 공통 비율 — 로딩 전부터 최종 높이라 점프 없음 */
  overflow: hidden;
  background: linear-gradient(90deg, #f0f0f1 25%, #f8f8f9 50%, #f0f0f1 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.map-minicard .mc-img .th-track { height: 100%; }
.map-minicard .mc-img .th-slide { height: 100%; }
.map-minicard .mc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-minicard .mc-meta { padding: 14px 16px 16px; }
.map-minicard .mc-name { font-size: 19px; font-weight: 800; line-height: 1.25; } /* 위계 기준점: 이름 > 가격 (전 지면 공통 법칙) */
.map-minicard .mc-sub { margin-top: 4px; font-size: 13px; color: var(--label-alternative, #888); }
.map-minicard .mc-price { margin-top: 10px; display: flex; align-items: baseline; gap: 4px; }
.map-minicard .mc-price b { font-size: 18px; }
.map-minicard .mc-price small { color: var(--label-alternative, #888); }
.map-minicard .mc-km { margin-left: auto; font-size: 13px; color: var(--label-alternative, #888); }
.map-minicard .mc-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* 여러 대 — 카드 묶음 팝업 (단일보다 넓게) */
.map-minicard.is-multi { width: min(380px, calc(100vw - 48px)); }
.map-minicard .mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 8px 18px;
  font-size: 15px;
}
/* 흰 표면 위 X — 필터 모달과 동일한 TDS 패턴 (평상시 투명, 호버에만 연한 배경) */
.map-minicard .mc-close--inline {
  position: static;
  width: 32px;
  height: 32px;
  box-shadow: none;
  background: transparent;
  color: var(--tds-text-general, #333);
}
.map-minicard .mc-close--inline:hover { background: var(--tds-ix-normal-hovered, rgba(23, 23, 25, .06)); }
.map-minicard .mc-close .iconSlot,
.map-minicard .mc-close .iconSlot svg { width: 18px; height: 18px; display: block; margin: 0 auto; }
.map-minicard .mc-list {
  max-height: 416px; /* 큰 행(104px) 4개 */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 10px;
}
.mp-card {
  display: flex;
  gap: 14px;
  padding: 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}
.mp-card:hover { background: #f5f6f7; }
.mp-card .thumb {
  width: 118px;
  height: 84px;
  flex: 0 0 118px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(90deg, #f0f0f1 25%, #f8f8f9 50%, #f0f0f1 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.mp-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-card .meta { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.mp-card .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card .name .yr { color: var(--label-alternative, #888); font-weight: 400; }
.mp-card .region { font-size: 13px; color: var(--label-alternative, #888); }
.mp-card .price { font-size: 15px; font-weight: 700; }
.mp-card .price small { font-weight: 400; color: var(--label-alternative, #888); }

/* 장소 검색 지도 이동 안내 토스트 (모바일·데스크톱 공통) */
.map-geotoast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--sheet-peek, 64px) + 18px);
  z-index: 66;
  max-width: calc(100vw - 48px);
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(26, 26, 26, .88);
  color: #fff;
  font: 500 13px/1.3 Pretendard Variable, Pretendard, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.map-geotoast.show { opacity: 1; }

/* ---------- 키 안내 ---------- */
.map-keyguide[hidden] { display: none; } /* display:flex가 hidden 속성을 덮어쓰지 않게 */
.map-keyguide {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.map-keyguide__box { max-width: 460px; text-align: center; }
.map-keyguide__box h2 { margin: 0 0 12px; font-size: 20px; }
.map-keyguide__box p { font-size: 14px; color: #555; line-height: 1.6; }
.map-keyguide__box code {
  display: block;
  margin: 6px auto;
  padding: 6px 10px;
  background: #f1f2f3;
  border-radius: 8px;
  font-size: 13px;
  width: fit-content;
}

/* ---------- 모바일 (에어비앤비식): 전체화면 지도 + 바텀시트 목록 + 하단 카드 ---------- */
.sheet-grip, .sheet-row { display: none; } /* 데스크톱에선 숨김 */
.map-back { display: none; }   /* 모바일 전용 (미디어 쿼리에서 표시) */

@media (max-width: 768px) {
  /* 모바일 지도 화면엔 네브바 없음 — 뒤로가기는 검색카드 안 (에어비앤비식) */
  body.page-map #site-header { display: none; }

  /* 검색카드: 지도 위 플로팅 — 뒤로가기 + 검색 + 일정이 든 흰 카드 (메인 도킹 검색바 모양) */
  body.page-map .search-hero {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    cursor: default;
    padding: 0;
    position: fixed;
    top: 12px; /* 아래 필터 버튼과 같은 간격 — env(safe-area)는 인앱 브라우저에서 카드를 끌어내려 제거 */
    left: 12px;
    right: 12px;
    z-index: 50; /* 지도(40) 위, 바텀시트(60) 아래 */
  }
  body.page-map .search-hero .hero-copy {
    position: static;
    inset: auto;
    padding: 0;
    max-width: none;
  }
  body.page-map .hero-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0; /* 메인 히어로용 margin-top 20px 상속 제거 — 카드가 wrapper(12px)보다 내려오던 원인 */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
    padding: 8px;
  }
  .map-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; /* 아이콘 22px + 최소 여백 — 검색칸을 넓게 */
    height: 40px;
    flex: 0 0 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tds-text-general, #333);
    cursor: pointer;
    padding: 0;
  }

  /* 필터는 검색바에서 빼서 지도 위 플로팅 버튼으로 */
  body.page-map .hs-filter-btn {
    position: fixed;
    top: calc(var(--map-top, 150px) + 12px);
    right: 16px;
    z-index: 50; /* 지도(40) 위, 바텀시트(60) 아래 — 서랍 펼치면 가려짐 */
    height: 42px;
    border-radius: 999px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .22);
  }

  /* 페이지 스크롤 없음 — 지도가 화면을 채우고 목록은 바텀시트로 */
  body.page-map { overflow: hidden; height: 100dvh; }
  .map-split { display: block; height: auto; }

  /* 지도는 화면 전체 — 검색카드가 그 위에 뜬다 */
  .map-canvas-wrap {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    margin: 0;
    border-radius: 0;
    z-index: 40;
  }
  .map-myloc { bottom: calc(var(--sheet-peek, 68px) + 12px); } /* 접힌 시트 위 12px — 검색창↔필터 버튼 간격과 동일 */

  /* 모바일: 가격 배지·클러스터 원을 한 단계 작게 */
  .tc-marker { padding: 6px 10px; font-size: 13px; }
  .tc-marker .tc-cnt { font-size: 11px; }
  .tc-cluster { width: 38px; height: 38px; font-size: 13px; }

  /* 바텀시트: 기존 리스트를 서랍에 — 접힘은 카운트 바만, 펼치면 기존 리스트 */
  .map-listcol {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--map-top, 150px) + 66px); /* 풀시트도 필터 버튼(카드+12, 높이42)이 보이는 지점까지만 */
    bottom: 0;
    width: auto;
    flex: none;
    z-index: 60;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .16);
    padding: 0 16px 24px;
    overflow: visible; /* 접힘 상태에서 위로 열리는 정렬 메뉴가 잘리지 않게 */
    transform: translateY(calc(100% - var(--sheet-peek, 68px))); /* 접힘 — 핸들만 노출 (map.js가 실측 주입) */
    transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  }
  .map-listcol.is-open { transform: translateY(0); overflow-y: auto; }
  .map-listcol.is-dragging { transition: none; }

  /* 손잡이(그래버): 스크롤해도 상단에 고정 — 서랍을 내릴 때 필요 */
  .sheet-grip {
    display: flex;
    justify-content: center;
    padding: 10px 0 10px;
    position: sticky;
    top: 0;
    z-index: 3;
    touch-action: none; /* 드래그가 스크롤로 새지 않게 */
    cursor: grab;
  }
  /* 펼침 스크롤 시: 그립 영역은 불투명 흰색, 그 아래로 16px 페이드 — 카드가 그래버에 닿기 전에 사라짐 */
  .map-listcol.is-open .sheet-grip { background: #fff; }
  .map-listcol.is-open .sheet-grip::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 16px;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0));
    pointer-events: none;
  }
  .sheet-grabber { width: 40px; height: 4px; border-radius: 2px; background: #d9dadb; flex: 0 0 auto; }
  /* 카운트 | 정렬 줄: 리스트와 함께 스크롤되어 올라감 — 여백은 위로, 아래는 리스트에 밀착 */
  .sheet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 0;
    touch-action: none;
    cursor: grab;
  }
  .sheet-count { font-size: 16px; font-weight: 600; color: #1a1a1a; min-width: 0; }
  /* 접힘 상태에선 정렬 메뉴가 핸들 '위'로 열림 (화면 아래는 잘리므로) */
  .map-listcol:not(.is-open) .sort-options { top: auto; bottom: calc(100% + 6px); }

  /* 카운트·정렬 모두 핸들 줄로 — 리스트 머리줄은 통째로 숨김 */
  body.page-map .map-listcol .result-head { display: none; }

  body.page-map #car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }

  /* 가격 배지 탭 → 하단 고정 카드 — 리스트와 동일한 .car-card 그대로 (search.js 렌더) */
  /* 에어비앤비식: 컨테이너는 투명, 슬라이드 각각이 독립 카드 */
  .map-bcard {
    position: fixed;
    left: 0; /* 좌우 모두 화면 끝까지 — 스크롤 중 양옆 카드가 잘린 틈 없이 흐르게 */
    right: 0;
    bottom: calc(var(--sheet-peek, 68px) + 12px); /* 접힌 시트 위 */
    z-index: 65;
  }
  /* 카드: 사진이 위·아래·왼쪽 패딩 없이 꽉 참, 텍스트는 오른쪽 */
  .map-bcard .car-card { display: flex; gap: 12px; align-items: stretch; padding: 0; }
  .map-bcard .car-card .thumb {
    width: 140px; flex: 0 0 140px; /* 사진 가로 확대 */
    height: auto; aspect-ratio: auto; border-radius: 0;
    align-self: stretch;
  }
  .map-bcard .thumb .th-track, .map-bcard .thumb .th-slide { height: 100%; }
  .map-bcard .car-card .meta { padding: 16px 12px 16px 0; } /* 상하 여유 — 사진은 stretch라 같이 커짐 */
  .map-bcard .car-card .price-row { margin-top: 10px; } /* 주소↔가격 간격 */
  /* 닫기 — 전체필터 모달과 동일한 TDS 투명 원형 버튼 + close.svg */
  .map-bcard .bcard-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 7px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tds-text-general, #333);
    cursor: pointer;
    flex: 0 0 auto;
  }
  .map-bcard .bcard-close .iconSlot,
  .map-bcard .bcard-close svg { width: 100%; height: 100%; display: block; }
  /* 카드 '밖' 플로팅 줄: n/N 가운데 · ✕ 오른쪽 — 둘 다 검색바처럼 테두리 흰 칩 (그림자 없음) */
  .map-bcard .bcard-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
    padding: 0 12px; /* 컨테이너 좌우 0 보정 — ✕는 화면에서 12px */
  }
  .map-bcard .bcard-count {
    position: absolute;
    left: 12px; /* 카드 왼쪽 끝에 정렬 (가운데 시안 비교) */
  }
  /* ✕·n/N: 반투명 검정 + 흰 글자 — 지도를 덜 가리게 (흰 칩 시안 비교 끝) */
  .map-bcard .bcard-top .bcard-close {
    width: 40px; height: 40px; padding: 9px;
    background: rgba(26, 26, 26, .58);
    border: 0;
    border-radius: 50%;
    color: #fff;
    margin-left: auto; /* 1대짜리(카운터 없음)도 ✕는 오른쪽 */
  }
  .map-bcard .bcard-count {
    /* 예전 버전처럼 작은 pill — 세로는 줄 바닥(캐러셀에 붙임) */
    bottom: 0;
    padding: 4px 9px;
    display: inline-flex; align-items: center;
    background: rgba(26, 26, 26, .58);
    border-radius: 999px;
    color: #fff;
    font-size: 11px; font-weight: 600; line-height: 1;
  }
  /* 카드 자체를 좌우로 넘김 — 메인 카드는 좌우 12px 대칭, 양옆 카드는 화면 끝까지 흐름 */
  .map-bcard .bcard-swipe {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    /* 카드 그림자가 스크롤 클립에 잘리지 않게 상하 패딩 + 네거티브 마진 상쇄 */
    padding: 14px 12px 20px;
    margin: -14px 0 -20px;
    scroll-padding-left: 12px; /* 스냅 기준은 12px 안쪽 */
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .map-bcard .bcard-swipe::-webkit-scrollbar { display: none; }
  /* 슬라이드 = 독립 카드 (흰 배경·그림자·라운드), 다음 카드가 오른쪽에 살짝 걸침(peek) */
  .map-bcard .bcard-slide {
    /* 모든 카드 동일 폭·좌우 12px 대칭 (1장·여러 장·순서 무관) — peek은 gap 6px이 만든 6px.
       %는 패딩 제외 콘텐츠 폭 기준 그대로 (테두리 없어져 보정 불필요) */
    flex: 0 0 100%;
    min-width: 0;
    position: relative;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .22); /* 필터 버튼과 동일 그림자 — 테두리는 그림자로 충분해 제거 */
    overflow: hidden;
  }
  /* 하단 카드 안에선 사진 캐러셀 비활성 — 대표 사진만 (카드 스와이프와 제스처 충돌 방지) */
  .map-bcard .th-nav, .map-bcard .th-dots { display: none; }
  .map-bcard .thumb .th-track { overflow-x: hidden; }
  /* 모바일 시트 리스트도 캐러셀 비활성 — 사진이 작아 좌우 탐색 의미 없음, 대표 사진만 */
  .map-listcol .th-nav, .map-listcol .th-dots { display: none; }
  .map-listcol .thumb .th-track { overflow-x: hidden; }
  .map-bcard .bcard-dot.d2 { width: 4px; height: 4px; }
  .map-bcard .bcard-dot.off { display: none; }
}
/* 폰 폭: 메인과 동일하게 1열 (카드가 가로형 레이아웃으로 전환되는 구간) */
@media (max-width: 640px) {
  body.page-map #car-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* 호버 팝업의 나이 캡션 — 리스트 카드와 동일한 칩, 별도 줄 */
.map-minicard .age-chip {
  display: inline-block;
  margin-top: 9px;
  background: var(--bg-alternative, #f2f3f4);
  color: var(--text-neutral, #555);
  font-size: 12px; font-weight: 500; line-height: 1.4;
  padding: 4px 9px; border-radius: 7px;
}

/* 팝업 연식·나이 표기 — 리스트 카드와 동일 */
.map-minicard .mc-name .yr { font-size: .8em; color: var(--label-alternative, #888); font-weight: 400; }
.mp-card .age-chip { margin-top: 5px; align-self: flex-start; }
