/* ===== 검색 페이지 전용 ===== */

/* ---------- 히어로 ---------- */
.search-hero {
  position: relative; height: 410px; margin-top: 16px;
  border-radius: 24px; overflow: hidden;
  background: var(--tds-background-elevated-neutral, #f0f0f3); /* 사진 로드 전 회색 */
}
.hero-layers div {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.1s ease;
}
.hero-layers div.on { opacity: 1; }
.hero-dim { position: absolute; inset: 0; background: rgba(15, 15, 16, 0.45); }
.search-hero { cursor: pointer; } /* 탭하면 현재 표시 중인 차량 상세로 */
.hero-copy {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 0 24px; /* 위아래 간격 동일 */
  text-align: center;
}
.hero-title {
  margin: 0; color: #fff; text-align: center;
  font-size: 42px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.35;
}
.hero-sub {
  order: -1; /* 서브카피를 타이틀 위(아이브로우)로 */
  margin: 0; font-size: 18px; font-weight: 600; text-align: center;
  color: rgba(255, 255, 255, 0.92);
}
.hero-word-line { display: inline-block; white-space: nowrap; }
/* 히어로 검색 카드 (차량명 + 일정·시간, 한 줄) */
.hero-search {
  border: 1px solid var(--line-general);
  transition: border-color 0.2s;
  display: flex; gap: 8px; align-items: center; text-align: left;
  width: min(680px, 100%); margin-top: 0; padding: 10px;
  background: #fff; border-radius: 16px; cursor: default;
  box-shadow: 0 12px 32px rgba(15, 15, 16, 0.18);
}
.hs-q {
  flex: 1 1 34%; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--bg-alternative); border-radius: 10px; padding: 11px 12px;
}
.hs-q > svg { flex-shrink: 0; color: var(--tds-primary-general); } /* 돋보기만 브랜드 연두 */
.hs-q input {
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px; width: 100%; min-width: 0; color: var(--text-general);
}
.hs-q input::placeholder { font-size: 15px; color: var(--text-alternative); } /* 일정 문구와 동일 크기·농도 */
.hs-q input::-webkit-search-cancel-button, .hs-q input::-webkit-search-decoration {
  -webkit-appearance: none; appearance: none; display: none; /* 브라우저 기본 X 제거 */
}
/* 입력 중인 칸만 연두 테두리 — 평소에는 조용하게 */
.hs-q:focus-within, .hs-dates:focus-within, .hs-trigger:focus-visible {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tds-primary-general) 55%, transparent);
}
.hs-dates {
  flex: 2 1 62%; display: flex; align-items: center; gap: 0; min-width: 0;
  box-sizing: border-box; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--bg-alternative);
  cursor: pointer;
}
.hs-date-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--tds-text-alternative); }
.hs-date-summary.has-value { color: var(--tds-text-general); }
/* 데스크탑: 통합 일정 필드 오른쪽 총시간 */
.hs-dur-d {
  flex-shrink: 0; margin-left: auto; padding-left: 14px;
  font-size: 12.5px; color: var(--text-assistive); white-space: nowrap;
}
.hs-dur-d:empty { display: none; }
@media (max-width: 640px) { .hs-dur-d { display: none; } }
.hs-date-action {
  flex: 0 0 28px; width: 28px; height: 28px; padding: 5px; margin-left: 6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--tds-text-assistive); cursor: pointer;
}
.hs-date-action svg { display: block; width: 18px; height: 18px; }
.hs-date-clear { color: var(--tds-text-neutral); }
.hs-date-calendar { margin-left: auto; }
.hs-date-action[hidden] { display: none; }
.hs-date {
  flex: 1; position: relative; display: flex; align-items: center; min-width: 0;
  background: transparent; border-radius: 0; padding: 11px 10px; cursor: pointer;
}
.hs-date + .hs-date { margin-left: 18px; }
.hs-date + .hs-date::before {
  content: '→'; position: absolute; right: 100%; width: 18px; text-align: center;
  color: var(--tds-text-assistive); pointer-events: none;
}
.hs-date.has-value { padding-right: 34px; } /* X 자리 */
@media (min-width: 641px) {
  .hs-dates .hs-date { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; }
  .hs-dates .hs-date.has-value { padding-right: 10px; }
  .hs-dates .hs-date .hs-clear { display: none; }
}
.hs-date input {
  border: none; outline: none; background: transparent; appearance: none; -webkit-appearance: none;
  font-family: inherit; font-size: 14.5px; color: var(--text-general); min-width: 0; width: 100%;
  cursor: pointer;
}
/* 값이 없을 때: 세그먼트 대신 라벨 (JS가 has-value 관리) */
.hs-ph {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-assistive); pointer-events: none; white-space: nowrap;
}
.hs-date.has-value .hs-ph { display: none; }
.hs-date:not(.has-value) input { color: transparent; }
.hs-date:not(.has-value) input::-webkit-datetime-edit { color: transparent; }
/* 값이 있을 때: 네이티브 '연도 포함' 표기 대신 '8. 1. 오전 10:00' 오버레이 */
.hs-val {
  position: absolute; left: 10px; right: 34px; top: 50%; transform: translateY(-50%);
  font-size: 14.5px; color: var(--text-general); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none;
}
.hs-date.has-value input { color: transparent; }
.hs-date.has-value input::-webkit-datetime-edit { color: transparent; }
.hs-date.has-value .hs-val { display: block; }
/* 피커로 편집 중(포커스)에는 라벨·오버레이를 숨기고 세그먼트를 보여줌 — 겹침 방지 */
.hs-date:focus-within .hs-ph { display: none; }
.hs-date:focus-within .hs-val { display: none; }
.hs-date:focus-within input { color: var(--text-general) !important; }
.hs-date:focus-within input::-webkit-datetime-edit { color: var(--text-general) !important; }

/* 모바일 통합 트리거: (달력) 언제 빌리실 건가요? */
.hs-trigger {
  display: none; align-items: center; gap: 8px; width: 100%; min-width: 0;
  background: var(--bg-alternative); border: none; border-radius: 10px;
  padding: 12px; cursor: pointer;
  font-family: inherit; font-size: 15px; color: var(--text-alternative); text-align: left;
}
.hs-trigger > svg { flex-shrink: 0; color: var(--text-assistive); }
.hs-trigger.has-value { color: var(--text-general); }
.hs-trigger.has-value > svg { color: var(--text-neutral); }
.hero-search .hs-clear, .hero-search .hs-clear svg { color: var(--tds-text-neutral); } /* 지우기 X는 검정톤 */
.hs-trigger-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 대여 시간 탑시트 (모바일) */
.date-sheet { position: fixed; inset: 0; z-index: 300; }
.date-sheet[hidden] { display: none; }
.ds-dim { position: absolute; inset: 0; background: rgba(15, 15, 16, 0.45); opacity: 0; transition: opacity 0.25s; }
.ds-panel {
  position: absolute; left: 0; right: 0; top: 0;
  background: #fff; border-radius: 0 0 20px 20px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
  transform: translateY(-100%); transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.35, 1);
}
.date-sheet.open .ds-dim { opacity: 1; }
.date-sheet.open .ds-panel { transform: none; }
.ds-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.ds-body .hs-dates { flex-direction: column; gap: 8px; }
.ds-body .hs-date {
  box-sizing: border-box; min-height: 52px; padding: 14px 16px;
}
.ds-body .hs-date.has-value { padding-right: 38px; }
.ds-body .hs-date input { min-height: 24px; padding: 0; line-height: 24px; }
.ds-body .hs-ph { left: 16px; }
.ds-body .hs-val { left: 16px; right: 38px; }
.ds-apply { width: 100%; margin-top: 14px; }
/* 일정 오류 경고 (일정 칸 아래) */
.hs-err {
  display: inline-flex; align-self: flex-start;
  margin-top: 8px; padding: 6px 10px; border-radius: 8px;
  background: #fff; color: var(--status-negative);
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
}
.hs-err[hidden] { display: none; }

/* 지우기 버튼: 절대배치로 높이 변화 없음 */
.hs-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: none; background: transparent; border-radius: 50%;
  color: var(--text-neutral); cursor: pointer;
}
.hs-clear:hover { background: rgba(23, 23, 25, 0.06); color: var(--text-neutral); }
.hs-clear[hidden] { display: none; }
.hs-q { position: relative; }
.hs-q .hs-clear { position: absolute; }
.hs-q.has-value > svg { display: none; }
.hs-q input { padding-right: 26px; }
/* 데스크탑: 서브-메인 밀착(메인 살짝 위로), 트러스트 태그는 아래로 */
@media (min-width: 641px) {
  .hero-title { margin-top: -4px; }
  .trust-tags { margin-top: 22px; } /* 알약 도형 vs 한글 베이스라인 시각보정 */
}

/* 신뢰 해시태그 — 히어로 이미지 위 반투명 칩 */
.trust-tags {
  display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 0;
}
.trust-tags span {
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(4px);
  color: #fff; font-size: 12px; font-weight: 500; line-height: 1.4;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.hero-word-line #hero-word { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .hero-layers div { transition: none; } }

/* ---------- 필터 바 (히어로 아래 원래 위치, 상단 고정) ---------- */
.filter-bar {
  position: sticky; top: 0; z-index: 60;
  background: #fff; padding: 12px 0;
}
.filter-inner { padding: 0; } /* 바깥 main.container 가 이미 좌우 여백 담당 */
/* 웹플로우 .container 의 min-height:50px, 전역 22px/160% 라인박스가 바 높이를 부풀리는 문제 방어 */
.filter-bar { font-size: 15px; line-height: 1.4; }
.filter-bar .filter-inner { min-height: 0; }
.filter-wrap { display: flex; align-items: center; } /* 칩이 라인박스 baseline 으로 내려가지 않게 */
/* 검색바가 상단에 닿으면: 그 자체로 풀폭 플랫 고정 (즉시 입력 가능), 카테고리 바가 아래에 딱 붙음 */
.hero-search.hs-fixed {
  border: 0; /* 고정 시엔 테두리 없음 */
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  transform: translateZ(0); will-change: transform; backface-visibility: hidden; /* iOS 페인트 누락 방지 */
  box-sizing: border-box; width: 100%; margin: 0; border-radius: 0; box-shadow: none;
  /* 아래 필터바 컨테이너와 동일 정렬 (JS가 스크롤바 제외 실폭으로 --page-inset 계산) */
  padding: 10px var(--page-inset, 24px);
}

@media (max-width: 640px) { .hero-search.hs-fixed { padding-left: 16px; padding-right: 16px; } } /* 카테고리 줄과 양끝 정렬 */
body.hs-fixed .filter-bar { top: calc(var(--hs-h, 60px) - 10px); }
/* 도킹 후 스크롤 멈춤 → 검색바+카테고리·칩 줄이 한 덩어리로 같은 거리만큼 위로 이동 */
.hero-search.hs-fixed,
body.hs-fixed .filter-bar { transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.35, 1); }
body.hs-hidden .hero-search.hs-fixed,
body.hs-fixed.hs-hidden .filter-bar {
  transform: translateY(calc(10px - var(--hs-h, 60px))); /* 동일 델타·동일 이징 → 틈 없음 */
}
body.hs-hidden .hero-search.hs-fixed { pointer-events: none; }
/* 대수·정렬 줄도 같은 스택에 도킹 — 내릴 땐 카테고리바 뒤로 숨고, 올리면 함께 복귀 */
body.hs-fixed .result-head {
  position: sticky; top: calc(var(--hs-h, 60px) - 10px + var(--fb-h, 58px) - 4px); /* 흐름과 동일한 위 간격 */
  padding-bottom: 4px; /* 고정 시 아래 4px 여유 */
  z-index: 55; background: #fff;
  transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.35, 1);
}
body.hs-fixed.hs-hidden .result-head {
  transform: translateY(calc(10px - var(--hs-h, 60px) - 100%)); /* 카테고리바(z:60) 아래로 미끄러져 가려짐 */
  pointer-events: none;
}
@media (max-width: 640px) { /* 카테고리바처럼 풀블리드 배경 (뒤 카드 비침 방지) */
  body.hs-fixed .result-head {
    margin-left: -16px; margin-right: -16px; width: calc(100% + 32px);
    padding-left: 16px; padding-right: 16px; box-sizing: border-box;
  }
} /* 붙었을 때 바 하단 패딩과 6px 겹쳐 밀착 (이동 중엔 하단 여백 10px 유지) */
@media (min-width: 641px) { .result-head .data-updated { display: none; } } /* 총시간은 검색카드에 표시 */

/* 빈 상태: 화면 가운데 */
.empty:not([hidden]) {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 45vh;
}
/* 고정 중엔 결과가 적어도 페이지가 짧아지지 않게 — 검색 중 화면 유지 */
body.hs-fixed .car-grid:not(:empty) { min-height: 55vh; }
body.hs-fixed .empty:not([hidden]) { min-height: 70vh; }
/* 웹플로우 전역 .container(flex) 방어 보험: 어떤 환경에서도 풀폭 유지 */
.search-hero, .filter-bar, .result-head, .car-grid, .load-more-wrap, .trust-tags, .empty { width: 100%; }
/* 좌표 버튼 + 필터 카테고리 — 항상 한 줄, 넘치면 가로 슬라이드 */
.filter-line { display: flex; align-items: center; gap: 8px; position: relative; }
/* 슬라이드 시 좌우 그라데이션 (스크롤 가능한 방향에만 표시) */
.filter-line::before, .filter-line::after, .chips-line::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 28px;
  z-index: 2; pointer-events: none; opacity: 0; transition: opacity .15s;
}
.filter-line::before { left: 0; background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
.filter-line::after  { right: 0;   background: linear-gradient(to left,  #fff, rgba(255,255,255,0)); }
.chips-line::before  { left: 0;    background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
.filter-line.fade-l::before { opacity: 1; }
.filter-line.fade-r::after  { opacity: 1; }
.chips-line.fade-l::before  { opacity: 1; }
.filter-scroll {
  flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; width: max-content; }
.filter-row .tds-chip { white-space: nowrap; flex-shrink: 0; }
.filter-master-wrap {
  position: relative; z-index: 4; flex: 0 0 auto;
  display: flex; align-items: center; background: var(--tds-background-general-general);
}
.filter-master-wrap::after {
  content: ''; position: absolute; left: 100%; top: 0; bottom: 0; width: 28px;
  background: linear-gradient(to right, var(--tds-background-general-general), transparent);
  pointer-events: none; opacity: 0; transition: opacity .15s;
}
.filter-line.fade-l .filter-master-wrap::after { opacity: 1; }
.filter-master {
  box-sizing: border-box; width: 32px; height: 32px; min-width: 32px; padding: 6px;
  flex: 0 0 32px; border-radius: 8px;
}
.filter-master .tds-chip__icon { width: 18px; height: 18px; }
/* 필터 트리거는 tds-chip(border) 사용 — 캐럿만 추가 */
.tds-chip .caret { font-size: 9px; opacity: 0.55; margin-left: 2px; }
.tds-chip--border { background: #fff; }

/* 정렬 패널 */
.sort-list { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.sort-list button {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 10px; border: none; background: transparent; border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--text-neutral); text-align: left;
}
.sort-list button:hover { background: var(--bg-alternative); }
.sort-list button.on { color: var(--primary); font-weight: 700; }
.sort-list button svg { width: 18px; height: 18px; flex-shrink: 0; }
.sort-list button span { white-space: nowrap; }

/* 드롭다운 패널 */
.filter-wrap { position: relative; }
.filter-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 70;
  min-width: 280px; max-width: 92vw;
  background: #fff; border: 1px solid var(--line-general);
  border-radius: var(--radius-card); box-shadow: var(--shadow-float);
  padding: 20px; display: none;
}
.filter-panel.open { display: block; }
.filter-panel h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px; max-height: 240px; overflow-y: auto; }
.check-grid label { white-space: nowrap; }
/* 테마 패널: 항목이 길어 줄바꿈 없이 3열로 넓게 */
[data-panel="theme"] { min-width: min(560px, 92vw); }
[data-panel="theme"] .check-grid { grid-template-columns: repeat(3, 1fr); max-height: 300px; }
.check-grid label, .sub-col label {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  font-size: 14px; color: var(--text-neutral); cursor: pointer; border-radius: 6px;
}
.check-grid label:hover, .sub-col label:hover { background: var(--bg-alternative); }
.panel-actions { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-alternative); }

/* 2단 선택 (좌: 그룹 / 우: 하위 항목) — 지역·제조사 공용 */
.twocol { display: flex; width: 420px; max-width: 84vw; border: 1px solid var(--line-alternative); border-radius: 12px; overflow: hidden; }
.group-col { width: 45%; border-right: 1px solid var(--line-alternative); max-height: 300px; overflow-y: auto; background: var(--bg-alternative); }
.sub-col { flex: 1; max-height: 300px; overflow-y: auto; padding: 6px; }
.group-row {
  display: flex; align-items: center; gap: 6px; padding: 11px 10px 11px 14px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-neutral);
  user-select: none;
}
.group-row .sel-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.group-row .arrow { margin-left: auto; color: var(--text-assistive); font-size: 12px; }
.group-row.active { background: #fff; font-weight: 700; color: var(--text-general); box-shadow: inset 3px 0 0 var(--primary); }
.panel-hint { font-size: 12px; color: var(--text-assistive); font-weight: 400; }
.sub-col .sub-all { border-bottom: 1px solid var(--line-alternative); margin-bottom: 4px; padding-bottom: 4px; }
.sub-col .sub-all label { width: 100%; }

/* 적용된 필터 칩 줄: 가로 슬라이드 + 오른쪽 초기화(그라데이션 뒤로) */
.chips-line { display: flex; align-items: center; margin-top: 12px; position: relative; }
.chips-line[hidden] { display: none; }
.chips-scroll { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips-scroll::-webkit-scrollbar { display: none; }
.active-chips { display: flex; flex-wrap: nowrap; gap: 8px; width: max-content; }
.chips-fade {
  flex-shrink: 0; width: 36px; align-self: stretch; margin-left: -36px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
  pointer-events: none; position: relative; z-index: 1;
}
.chips-reset {
  flex-shrink: 0; position: relative; z-index: 1;
  background: #fff; border: none; padding: 6px 0 6px 6px;
  font-size: 13px; font-weight: 500; color: var(--text-neutral); font-family: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
/* 칩 전체가 해제 버튼 */
.achip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-tint); color: var(--primary);
  border: none; cursor: pointer;
  border-radius: 999px; padding: 7px 12px 7px 14px;
  font-size: 13px; font-weight: 600; line-height: 1.3; font-family: inherit;
}
.achip .x { width: 13px; height: 13px; opacity: 0.65; }

/* 가격 — TDS TextInput(medium) + Chip(small) 규격 */
.price-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; }
.price-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.price-field__label { margin-left: 2px; color: var(--tds-text-neutral); }
.price-field__box {
  display: flex; align-items: center; box-sizing: border-box; height: 40px;
  padding: 7px 11px; gap: 8px; border: 1px solid var(--tds-line-general-general);
  border-radius: 12px; background: transparent; cursor: text;
}
.price-field__box:focus-within { border-color: color-mix(in srgb, var(--tds-primary-general) 40%, transparent); }
.price-field__input {
  flex: 1; min-width: 0; width: 100%; margin: 0; padding: 0; border: 0; outline: 0;
  background: transparent; color: var(--tds-text-general); caret-color: var(--tds-text-general);
}
.price-field__input::placeholder { color: var(--tds-text-assistive); opacity: 1; }
.price-field__suffix, .price-divider { flex: 0 0 auto; color: var(--tds-text-alternative); }
.price-divider { padding-bottom: 9px; }
.price-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* 결과 헤더 */
.result-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 0; margin: -4px 0 12px; } /* 위 8px 체감 */
.result-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.result-right { display: flex; align-items: center; align-self: center; height: 32px; gap: 2px; flex-shrink: 0; }
.result-head .count {
  display: inline-flex; align-items: center; height: 32px; flex-shrink: 0; color: var(--tds-text-alternative);
  font-weight: 500; font-size: 14px; line-height: 20px; letter-spacing: .0145em;
}
.my-loc, .data-updated {
  font-size: 11.5px; color: var(--text-alternative);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 좌표 활성화 토글 버튼 (필터 줄 맨 앞): 아이콘 + 현 위치 라벨 */
.loc-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  flex-shrink: 0;
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  background: transparent; border: 0;
  color: var(--text-alternative);
  --ix-color: var(--tds-text-general);
  --ix-default: var(--tds-ix-normal-default);
  --ix-hovered: var(--tds-ix-normal-hovered);
  --ix-focused: var(--tds-ix-normal-focused);
  --ix-pressed: var(--tds-ix-normal-pressed);
}
.loc-icon-btn .loc-label { font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; }
.loc-icon-btn.is-active {
  color: var(--tds-primary-general);
  background: color-mix(in srgb, var(--tds-primary-general) 5%, transparent);
}
.result-sort { position: relative; display: inline-flex; align-items: center; }
.sort-trigger {
  display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 2px 0 6px;
  border: 0; background: transparent; color: var(--tds-text-alternative); cursor: pointer;
}
.sort-trigger__value { white-space: nowrap; }
.sort-trigger__icon { width: 16px; height: 16px; color: var(--tds-text-alternative); }
.result-sort.is-open .sort-trigger__icon svg { transform: rotate(180deg); }
.sort-trigger__icon svg { transition: transform .12s; }
.sort-options {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 90;
  width: 176px; box-sizing: border-box; padding: 6px;
  border: 1px solid var(--tds-line-general-general); border-radius: 12px;
  background: var(--tds-background-elevated-general);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--tds-static-black) 14%, transparent);
}
.sort-options[hidden] { display: none; }
.sort-option {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px;
  padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--tds-text-neutral); text-align: left; cursor: pointer;
}
.sort-option:hover { background: var(--tds-fill-alternative); }
.sort-option.is-selected { color: var(--tds-primary-general); }
.sort-option svg { width: 18px; height: 18px; }

/* ---------- 전체 필터: 데스크톱 모달 / 모바일 바텀시트 ---------- */
.all-filter { position: fixed; inset: 0; z-index: 200; }
.all-filter[hidden] { display: none; }
.all-filter__dim {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  background: var(--tds-dimmer-general); cursor: default;
  opacity: 0; transition: opacity .25s;
}
.all-filter__panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-50% + 24px)) scale(.98);
  display: flex; flex-direction: column; width: min(720px, calc(100vw - 40px));
  height: min(680px, calc(100vh - 64px)); overflow: hidden;
  background: var(--tds-background-elevated-general); border-radius: 20px;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--tds-static-black) 22%, transparent);
  opacity: 0; transition: transform .28s cubic-bezier(.22,.9,.35,1), opacity .2s;
}
.all-filter.open .all-filter__dim { opacity: 1; }
.all-filter.open .all-filter__panel { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.all-filter__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 24px 16px;
}
.all-filter__header h2 { margin: 0; color: var(--tds-text-general); }
.all-filter__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 8px; border: 0; border-radius: 50%;
  background: transparent; color: var(--tds-text-general);
  --ix-color: var(--tds-text-general); --ix-hovered: var(--tds-ix-normal-hovered);
  --ix-focused: var(--tds-ix-normal-focused); --ix-pressed: var(--tds-ix-normal-pressed);
}
.all-filter__close .iconSlot { width: 24px; height: 24px; }
.all-filter__tabs {
  display: flex; flex-shrink: 0; gap: 24px; padding: 0 24px;
  width: 100%; box-sizing: border-box; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; touch-action: pan-x; overscroll-behavior-x: contain;
  border-bottom: 1px solid var(--tds-line-general-general);
}
.all-filter__tabs::-webkit-scrollbar { display: none; }
.all-filter__tab {
  position: relative; flex: 0 0 auto; padding: 10px 0 12px; border: 0;
  background: transparent; color: var(--tds-text-alternative); cursor: pointer;
}
.all-filter__tab.is-active { color: var(--tds-text-general); }
.all-filter__tab.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--tds-text-general); border-radius: 2px;
}
.all-filter__selected {
  min-height: 48px; display: flex; align-items: center; position: relative;
  padding: 0 24px; overflow: hidden;
  background: var(--tds-background-general-alternative);
  border-bottom: 1px solid var(--tds-line-general-general);
}
.all-filter__selected[hidden] { display: none; }
.all-filter__selected-scroll {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 32px 8px 0; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; cursor: grab;
}
.all-filter__selected-scroll:active { cursor: grabbing; }
.all-filter__selected-scroll::-webkit-scrollbar { display: none; }
.all-filter__selected-scroll .achip { flex: 0 0 auto; }
.all-filter__selected-fade {
  flex: 0 0 28px; align-self: stretch; margin-left: -28px;
  background: linear-gradient(to right, transparent, var(--tds-background-general-alternative));
  pointer-events: none; position: relative; z-index: 1;
}
.all-filter__selected-reset {
  flex: 0 0 auto; position: relative; z-index: 2;
  padding: 8px 0 8px 10px; border: 0; background: var(--tds-background-general-alternative);
  color: var(--tds-text-neutral); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.all-filter__body { flex: 1; overflow: auto; padding: 24px; }
.all-filter__content { display: block; min-width: 0; }
.all-filter__section-title { margin: 0 0 20px; color: var(--tds-text-general); }
.all-filter__body .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; gap: 8px 32px; }
.all-filter__body .check-grid label { padding: 8px 4px; }
.all-filter__body .twocol { width: 100%; max-width: none; }
.all-filter__body .panel-actions { display: none; }
.region-detail { min-width: 0; }
.region-subtabs {
  display: flex; flex-shrink: 0; align-items: center; gap: 24px; margin: 0; padding: 0 24px;
  min-height: 48px; box-sizing: border-box;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab;
  background: var(--tds-background-general-alternative);
  border-bottom: 1px solid var(--tds-line-general-general);
}
.region-subtabs[hidden] { display: none; }
.region-subtabs:active { cursor: grabbing; }
.region-subtabs::-webkit-scrollbar { display: none; }
.region-subtabs .group-row {
  position: relative; align-self: stretch; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  box-sizing: border-box; padding: 12px 0; border: 0; background: transparent;
  color: var(--tds-text-alternative); cursor: pointer;
}
.region-subtabs .group-row.active { color: var(--tds-text-general); box-shadow: none; }
.region-subtabs .group-row.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--tds-text-general); border-radius: 2px;
}
.region-subtabs .sel-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tds-primary-general); }
.region-detail .sub-col {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px;
  max-height: none; overflow: visible; padding: 0;
}
.region-detail .sub-all { grid-column: 1 / -1; }
.all-filter__footer {
  flex-shrink: 0; display: grid; grid-template-columns: 1fr; gap: 8px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  background: var(--tds-background-elevated-general);
  border-top: 1px solid var(--tds-line-general-general);
}
.filter-reset-all {
  width: 100%; height: 36px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 10px;
  background: var(--tds-background-elevated-general);
  color: var(--tds-text-neutral); font-family: inherit; cursor: pointer;
}
.filter-show { width: 100%; }
.filter-show { order: -1; }

/* 카드 그리드 — 데스크탑 4열 */
.car-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 20px;
  padding: 12px 0 8px;
  overflow-anchor: none; /* iOS 스크롤 위치 재보정으로 인한 헤더 깜빡임 방지 */
}
@media (max-width: 1024px) { .car-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; } }
@media (max-width: 480px)  { .car-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
/* 모바일: 세로 카드 대신 리스트 아이템 (정사각 썸네일 + 우측 정보) — 한 화면에 더 많은 차량 */
@media (max-width: 640px) {
  .car-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 0 8px; }
  /* 앱 리스트와 동일: 텍스트는 사진 윗라인부터 위→아래로 쌓임 */
  .car-card { display: flex; gap: 14px; align-items: flex-start; padding: 9px 0; }
  .car-card .thumb {
    width: 128px; height: 128px; flex: 0 0 128px;
    aspect-ratio: 1 / 1; border-radius: 12px;
  }
  .car-card:hover .thumb img { transform: none; }
  .car-card .meta { flex: 1; min-width: 0; padding: 10px 0 0; } /* 가운데보다 살짝 위 */
  .car-card .name {
    font-size: 16px; line-height: 1.35; margin-top: 0; letter-spacing: -0.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
  }
  .car-card .region { font-size: 13px; margin-top: 3px; }
  .car-card .price-row { margin-top: 6px; gap: 8px; }
  .car-card .price { flex: 0 1 auto; min-width: 0; } /* 좁으면 가격이 먼저 줄어듦 */
  .car-card .perkm { flex: 0 0 auto; } /* 주행요금은 잘리지 않음 */
  .car-card .age-chip { margin-top: 7px; }
  .car-card .price { font-size: 17px; }
  .car-card .price small { font-size: 13px; }
  .car-card .perkm { font-size: 13px; }
}



/* 더 보기 / 빈 결과 */
.load-more-wrap { display: flex; justify-content: center; padding: 32px 0 56px; }
.car-grid.grid-end { padding-bottom: 64px; } /* 더보기 없이 끝났을 때 하단 여백 */
.load-more-wrap[hidden] { display: none; }

.empty { text-align: center; padding: 80px 0; color: var(--text-alternative); }

@media (max-width: 640px) {
  .page-head h1 { font-size: 22px; }
  /* 히어로: 좌우 꽉 차게, 상세 페이지 사진과 동일한 4:3 비율 */
  .search-hero { height: auto; aspect-ratio: 4 / 3; margin: 0 -16px; border-radius: 0; width: calc(100% + 32px); } /* 상세 사진과 동일 비율 */
  /* 히어로: 데스크탑과 동일 위계 (서브/타이틀/카드/칩 정중앙) */
  .hero-copy { padding: 0 16px 24px; gap: 8px; justify-content: flex-start; }
  /* 텍스트 묶음: 카드 위 공간의 가운데(살짝 아래) — 화면이 커져도 비율 유지 */
  .hero-title { margin-top: auto; padding-top: 60px; } /* 가운데보다 살짝 아래 */
  .hero-sub { margin-bottom: auto; }
  .hero-sub { font-size: clamp(13px, 3.4vw, 18px); order: 0; } /* 모바일: 타이틀 아래로 */
  /* '우리 동네' / '~를 빌려보세요' 2줄, 크게 */
  .hero-title { font-size: clamp(28px, 7.6vw, 46px); line-height: 1.28; max-width: 100%; margin-bottom: -2px; }
  .hero-title .ht:first-child { display: block; } /* 우리 동네 뒤 줄바꿈 */
  /* 차량명만 말줄임 — 을/를 조사와 '빌려보세요'는 항상 보존 (flex라 % 순환 없음) */
  /* 자연 줄바꿈 허용 → 3줄로 넘어갈 때만 JS가 뒷글자를 …로 줄임 */
  .hero-title .hero-word-line { display: inline; max-width: none; white-space: normal; }
  .hero-title #hero-word { display: inline; overflow: visible; text-overflow: clip; white-space: normal; }
  .hero-title #hero-josa { flex-shrink: 0; }
  .trust-tags { display: none; } /* 모바일: 신뢰 칩 제거 */
  /* 카드: [차량검색 | 언제 빌리실 건가요?] 한 줄 — 두 칸 높이 동일, 아래쪽 배치 */
  .hero-search { margin: 20px 0 0; padding: 8px; gap: 6px; }
  .filter-line { min-height: 32px; }
  .filter-master-wrap { position: absolute; left: 0; top: 0; bottom: 0; }
  .filter-scroll { box-sizing: border-box; padding-left: 40px; }
  .hs-q, .hs-trigger { height: 41.5px; box-sizing: border-box; }
  .hs-q { flex: 4 1 0; padding: 0 10px; }
  .hs-trigger { display: flex; flex: 6 1 0; position: relative; padding: 0 10px; font-size: 15px; }
  .hs-trigger > svg { order: 2; margin-left: auto; } /* 달력은 데스크탑처럼 뒤(오른쪽) */
  .hs-dur {
    order: 2; flex-shrink: 0; margin-left: auto; margin-right: 26px;
    font-size: 12px; color: var(--text-assistive); white-space: nowrap;
  }
  .hs-dur:empty { display: none; }
  .hs-trigger.has-value > svg { display: none; } /* 값 있으면 X와 겹치지 않게 */

  .hs-trigger-text { white-space: normal; line-height: 1.3; }
  .hs-trigger.has-value { padding-right: 28px; }
  .hs-trigger.has-value .hs-trigger-text { font-size: 12px; min-width: 0; }
  .hs-trigger-text .tt-l1, .hs-trigger-text .tt-l2 {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* 칸 안에서 말줄임 */
  }
  .hs-trigger-text .tt-l2 { font-size: 11.5px; color: var(--text-assistive); margin-top: 1px; }
  .hs-q svg, .hs-trigger svg { width: 16px; height: 16px; } /* 아이콘 크기 통일 */
  .hs-q input { font-size: 16px; } /* iOS 확대 방지 */
  .hs-q input::placeholder { font-size: 15px; } /* 트리거 문구와 동일 크기 */
  /* 스크롤 시 풀블리드 히어로가 바 좌우로 비치지 않게 배경도 풀블리드 */
  .filter-bar, .filter-bar.stuck {
    margin-left: -16px; margin-right: -16px; width: calc(100% + 32px);
    padding: 12px 16px;
  }
  .twocol { width: 100%; }
  /* 모바일: 테마 패널도 2열로 (패널 폭은 JS가 화면 꽉 차게 통일) */
  [data-panel="theme"] .check-grid { grid-template-columns: repeat(2, 1fr); }
  .result-head { align-items: flex-start; }
  .result-left { flex-wrap: wrap; gap: 6px 8px; }
  .loc-icon-btn { width: 28px; height: 28px; padding: 0; }
  .sort-select { font-size: 13px; }
  .all-filter__panel {
    left: 0; right: 0; top: auto; bottom: 0; transform: none;
    width: 100%; height: min(82vh, 720px); border-radius: 20px 20px 0 0;
  }
  .all-filter__panel { transform: translateY(100%); opacity: 1; }
  .all-filter.open .all-filter__panel { transform: translateY(0); }
  .all-filter__header { padding: 20px 20px 16px; }
  .all-filter__tabs { gap: 22px; padding: 0 20px; }
  .all-filter__selected { padding: 8px 20px; }
  .all-filter__body { padding: 20px; }
  .all-filter__body .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .all-filter__body .twocol { border: 0; border-radius: 0; }
  .all-filter__body .group-col { width: 42%; }
  .all-filter__footer { grid-template-columns: 1fr; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
  .filter-show { order: -1; }
  .filter-reset-all { height: 34px; min-height: 34px; }
  .all-filter__selected { padding: 0 20px; }
  .region-subtabs { padding-left: 20px; padding-right: 20px; }
  .region-detail .sub-col { gap: 6px 12px; }
}
