/* ===== 상세 페이지 전용 ===== */

/* 히어로 갤러리
   - 데스크탑: 튜로 스타일 (메인 1장 + 오른쪽 작은 2장, 컨테이너 폭)
   - 모바일: 상단 꽉 차게, 사진 원본 비율 유지 */
.hero-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 24px 0; }

.hero-desktop {
  position: relative;
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 8px; border-radius: 20px; overflow: hidden;
  aspect-ratio: 2.2 / 1;
}
.hero-desktop .g-item {
  position: relative; overflow: hidden; cursor: pointer;
  background: linear-gradient(90deg, #f0f0f1 25%, #f8f8f9 50%, #f0f0f1 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.hero-desktop .g-item:first-child { grid-row: span 2; }
.hero-desktop .g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.hero-desktop .g-item:hover img { transform: scale(1.03); }
.g-ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--text-assistive); font-size: 13px; cursor: default;
}
.all-photos {
  position: absolute; right: 16px; bottom: 16px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line-heavy);
  border-radius: 10px; padding: 9px 16px; font-size: 13.5px; font-weight: 600;
}

.hero-mobile { display: none; position: relative; background: var(--bg-alternative); }
/* 스크롤 스냅 캐러셀 — 네이티브 스와이프 애니메이션 */
.hero-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: start;
  overflow: hidden; cursor: pointer;
  /* 이미지 로딩 전 스켈레톤 (고정 비율이라 레이아웃 점프 없음) */
  background: linear-gradient(90deg, #f0f0f1 25%, #f8f8f9 50%, #f0f0f1 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide .hero-empty {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--text-assistive); font-size: 14px;
}

/* 모바일: 상세 진입 시 오른쪽에서 슬라이드 인 (View Transitions 미지원 브라우저용 폴백) */
@media (max-width: 720px) {
  #hero-slot, #main, .mobile-cta {
    animation: pageIn 0.26s cubic-bezier(0.22, 0.9, 0.35, 1) both;
  }
}
/* View Transitions 지원 시 페이지 전체 전환이 담당하므로 폴백 애니메이션 끔 */
@supports (view-transition-name: root) {
  @media (max-width: 720px) {
    #hero-slot, #main, .mobile-cta { animation: none; }
  }
}
@keyframes pageIn {
  from { transform: translateX(28px); opacity: 0.4; }
  to   { transform: none; opacity: 1; }
}

.hero-btn {
  position: absolute; top: 16px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); color: var(--text-general);
  transition: transform .15s;
}
.hero-btn:hover { transform: scale(1.06); }
.hero-btn.back { left: 16px; }
.hero-btn.share { right: 16px; }
.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: none; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.hero-nav.prev { left: 14px; } .hero-nav.next { right: 14px; }
.hero-mobile .counter {
  position: absolute; right: 14px; bottom: 14px; z-index: 5;
}
.tds-counter { display: inline-flex; align-items: center; border-radius: 9999px; background: color-mix(in srgb, var(--tds-inverse-background) 55%, transparent); }
.tds-counter--medium { gap: 4px; padding: 3px 8px; }
.tds-counter__value { color: var(--tds-inverse-text); }
.tds-counter__slash { color: var(--tds-static-white); }
.tds-text-reset { margin: 0; }
@media (max-width: 720px) {
  .hero-wrap { padding: 0; }
  .hero-desktop { display: none; }
  .hero-mobile { display: block; }
}

/* 타이틀 */
.detail-top { padding: 4px 0 20px; }
.detail-title h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.theme-chips span {
  font-size: 13px; font-weight: 500; padding: 6px 13px; border-radius: 8px;
  background: var(--bg-alternative); color: var(--text-neutral); line-height: 1.4;
}
.detail-title .sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.detail-title .sub .loc { font-size: 14.5px; color: var(--text-neutral); font-weight: 500; }

/* 본문 2단 레이아웃 */
.detail-body { display: grid; grid-template-columns: 1fr 380px; gap: 48px; padding: 10px 0 24px; align-items: start; }
@media (max-width: 960px) { .detail-body { grid-template-columns: 1fr; } }

.section-block { padding: 28px 0; border-top: 1px solid var(--line-general); }
.section-block:first-child { border-top: none; padding-top: 0; }
.section-block h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 18px; }
/* 섹션 제목 + 우측 버튼 (요금 계산하기) */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sec-head h2 { margin-bottom: 0; }
.calc-open-btn { background: #fff; }
@media (min-width: 961px) { .calc-open-btn { display: none; } } /* 데스크탑은 우측 카드가 계산기 */
/* 섹션 제목 옆 ⓘ는 제목 텍스트와 수직 중앙 정렬 */
.section-block h2 .info { vertical-align: middle; margin-left: 8px; margin-top: -2px; }

/* 스펙 그리드 (2×2) */
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.spec-item { background: var(--bg-alternative); border-radius: 12px; padding: 14px 16px; }
.spec-item .k { font-size: 12px; color: var(--text-alternative); }
.spec-item .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

/* 옵션 */
.opt-group { margin-bottom: 18px; }
.opt-group:last-child { margin-bottom: 0; }
.opt-group h3 { font-size: 14px; font-weight: 600; color: var(--text-neutral); margin-bottom: 10px; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chips .chip {
  padding: 7px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line-general); font-size: 13.5px; color: var(--text-neutral);
}

/* 요금 테이블 */
.fee-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fee-table td { padding: 12px 4px; border-bottom: 1px solid var(--line-alternative); }
.fee-table td:last-child { text-align: right; font-weight: 600; }
.fee-table tr:last-child td { border-bottom: none; }
/* ⓘ 트리거 + tds-tooltip 배치 */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; vertical-align: 1px;
  border-radius: 50%; background: transparent;
  border: 1px solid var(--line-heavy); color: var(--text-alternative);
  font-size: 10px; font-weight: 700; font-style: normal; line-height: 1;
  cursor: help; position: relative;
}
.info .info-tip {
  display: none; position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%); z-index: 40;
  width: max-content; max-width: 260px; white-space: normal;
  text-align: left; font-weight: 400;
}
/* 탭 = .on 토글(재탭 시 닫힘). 호버는 마우스 기기에서만 — 터치는 :hover가 잔류해 안 닫히는 문제 방지 */
.info.on .info-tip { display: inline-flex; }
@media (hover: hover) and (pointer: fine) {
  .info:hover .info-tip { display: inline-flex; }
}
/* 모바일: 가운데 정렬 시 화면 밖으로 나가므로 ⓘ 기준 왼쪽 정렬 + 꼬리 위치 보정 */
@media (max-width: 640px) {
  .info .info-tip { left: -22px; transform: none; max-width: min(260px, calc(100vw - 48px)); }
  .info .info-tip .tds-tooltip__tail { left: 30px; right: auto; }
}

/* 지도 */
#map-box {
  width: 100%; height: 340px; border-radius: 16px; overflow: hidden;
  background: var(--bg-alternative); position: relative;
  position: relative; z-index: 0; isolation: isolate; /* 지도 내부 컨트롤이 고정 CTA 위로 못 올라오게 */
}
.map-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--text-alternative); font-size: 14px; text-align: center; padding: 20px;
}
/* 차량 위치 주소 (지도 위) */
.loc-addr { margin-bottom: 14px; }
.loc-addr .loc-region { font-size: 13.5px; color: var(--text-alternative); }
.loc-addr .loc-detail { font-size: 15px; font-weight: 600; margin-top: 3px; line-height: 1.5; }

/* 앱 유도 섹션 (차량 소개 · 이용 후기) */
.app-teaser {
  background: var(--bg-alternative); border-radius: 14px; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.app-teaser p { font-size: 14.5px; color: var(--text-neutral); }
.app-teaser p b { display: block; font-size: 15px; color: var(--text-general); margin-bottom: 2px; }
.app-teaser .btn-outline { flex-shrink: 0; padding: 10px 18px; font-size: 14px; background: #fff; }
@media (max-width: 640px) {
  /* 모바일: '앱에서 보기' 버튼 꽉 차게 */
  .app-teaser { flex-direction: column; align-items: stretch; }
  .app-teaser .tds-border-button { width: 100%; box-sizing: border-box; }
}

/* 예약 사이드 카드 */
.book-card {
  /* 웹플로우 네브바가 sticky라면 top 값을 네브바 높이만큼 키울 것 */
  position: sticky; top: 24px; align-self: start;
  background: #fff; border: 1px solid var(--line-general);
  border-radius: 20px; box-shadow: var(--shadow-card);
  padding: 28px;
}
.book-card .price {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
}
.book-card .price small { font-size: 15px; font-weight: 500; color: var(--text-alternative); }
.book-card .price-km { font-size: 15px; font-weight: 500; color: var(--text-alternative); letter-spacing: 0; }
.book-card .price-sub { font-size: 12.5px; color: var(--text-alternative); margin-bottom: 2px; } /* 가격 위 라벨 */
.book-list { margin: 18px 0; }
.book-list .row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 15px; border-bottom: 1px solid var(--line-alternative); }
.book-list .row:last-child { border-bottom: none; }
.book-list .row span:first-child { color: var(--text-alternative); }
.book-list .row span:last-child { font-weight: 600; }
/* 계산 내역: 행 구분선 없이 촘촘하게 */
#fee-breakdown .row { border-bottom: none; padding: 5px 0; }
/* 총액 행 = 셰브론 토글 (모바일에서 상세 접기 / 데스크탑은 항상 펼침) */
#fee-breakdown { margin-top: 4px; }
#fee-breakdown .row.total { margin-top: 0; padding: 6px 4px 8px; } /* 양끝 4px = 세부요금 행과 정렬 */
#fee-breakdown .row.total span { font-weight: 700; font-size: 17px; color: var(--text-heavy); }
.tot-toggle {
  width: 100%; background: none; border: none; font-family: inherit;
  text-align: left; cursor: pointer;
}
.tot-toggle .tot-lbl { display: inline-flex; align-items: center; gap: 7px; }
.tot-toggle .tot-lbl svg { color: var(--text-alternative); transition: transform 0.2s; }
#fee-breakdown.expanded .tot-lbl svg { transform: rotate(180deg); }
.tot-toggle .tot-amt { color: var(--primary) !important; }
/* 상세 내역: grid-rows 트랜지션으로 부드럽게 펼침/접힘 */
#fee-breakdown .fee-detail {
  display: grid; grid-template-rows: 1fr; /* 항상 펼침 */
}
#fee-breakdown .tot-toggle { pointer-events: none; }
#fee-breakdown .tot-lbl svg { display: none; }
#fee-breakdown .fd-inner { overflow: hidden; min-height: 0; padding-bottom: 0; }
@media (min-width: 961px) {
  #fee-breakdown .fee-detail { grid-template-rows: 1fr; } /* 웹은 항상 펼침 */
  .tot-toggle { cursor: default; pointer-events: none; }
  .tot-toggle .tot-lbl svg { display: none; } /* 웹은 셰브론 불필요 */
}
/* 라운드 인풋과 텍스트 시작선 맞춤 — 4px 들여쓰기 통일 */
.book-card .price,
.book-card .price-sub,
.trip-form label,
#fee-breakdown .row,
.fee-fixed .row,
.trip-range,
.pickup,
.tot-toggle { padding-left: 4px; padding-right: 4px; }

/* 보험·타운카케어 별도 부과 뱃지 */
.sep-badge {
  font-style: normal; font-size: 10.5px; font-weight: 500;
  color: var(--text-alternative); background: var(--bg-alternative);
  border-radius: 4px; padding: 2px 6px; margin-right: 6px; vertical-align: 1px;
}
/* 요금 안내 하단 안내문 */
.fee-note { margin-top: 14px; }

/* 계산 내역 안내문 — 작게, 가운데 정렬 */
.calc-note {
  font-size: 11.5px; color: var(--text-assistive); text-align: center;
  margin: 8px 0 16px;
}
.base-note { font-size: 12px; color: var(--text-assistive); margin: -2px 0 4px; }

/* 대여 시간·주행거리 입력 */
.trip-form { display: grid; gap: 10px; margin-top: 18px; }
.trip-form label { font-size: 12.5px; font-weight: 600; color: var(--text-alternative); display: grid; gap: 5px; }
/* text-input(solid) 스펙 값 적용 — 16px 미만이면 iOS가 포커스 시 확대하므로 16px */
.trip-form input {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  -webkit-appearance: none; appearance: none; /* iOS datetime-local 고유 폭이 카드 밖으로 튀는 것 방지 */
  padding: 11px 12px; border: 1px solid var(--tds-line-general-alternative);
  border-radius: 12px; font-family: inherit; font-size: 16px; text-align: left;
  font-weight: 400; color: var(--text-general); background: var(--tds-fill-alternative); outline: none;
}
.trip-form input::-webkit-date-and-time-value { text-align: left; }
.trip-form input:focus { border-color: color-mix(in srgb, var(--tds-primary-general) 40%, transparent); }

@media (max-width: 960px) {
  /* 시트 헤더: 요금 세부정보 + X */
  .sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0 0; margin-bottom: 16px; /* 세 시트 공통: 제목 아래 16px */
  }
  .sheet-title { color: var(--tds-text-general); } /* 크기·굵기는 tds-heading2-bold */
  .sheet-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: transparent; color: var(--text-neutral); cursor: pointer;
  }
  /* 시트에선 상단 가격 헤더 숨김 (행 목록의 총 대여료가 대신) */
  .book-card .price, .book-card .price-sub { display: none; }
  #fee-breakdown { margin-top: 0; }
  .trip-form { margin-top: 0; }
}

.trip-date-field { position: relative; display: block; }
.trip-date-field .trip-date-display {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center;
  padding: 0 12px; color: var(--tds-text-general); pointer-events: none;
}
.trip-date-field input { color: transparent; cursor: pointer; }
.trip-date-field input::-webkit-datetime-edit { color: transparent; }
.trip-date-field input:focus { color: transparent; }
.trip-date-field input:focus::-webkit-datetime-edit { color: transparent; }

/* 픽업·반납 장소 — 위아래 라인, 간격은 '예상 총 대여료' 행과 동일 */
.pickup {
  border-top: 1px solid var(--line-alternative);
  border-bottom: 1px solid var(--line-alternative);
  padding: 13px 0; margin: 14px 0 6px;
}
.pickup .k { font-size: 12.5px; font-weight: 600; color: var(--text-alternative); }
.pickup .v { font-size: 14px; font-weight: 500; margin-top: 6px; line-height: 1.5; }

.book-card .book-cta { width: 100%; margin-top: 4px; box-sizing: border-box; }
/* CTA 아래 한 줄 안내: 일정은 앱에서 실시간 확인 */
.cta-note { margin: 8px 0 0; text-align: center; font-size: 13px; line-height: 1.5; color: var(--text-alternative); }
.mobile-cta .tds-solid-button { flex-shrink: 0; }
.care-note { text-align: center; font-size: 12.5px; color: var(--text-alternative); margin-top: 12px; }

/* 모바일 하단 바 */
.mobile-cta {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-general);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  align-items: center; justify-content: space-between; gap: 16px;
}
.mobile-cta .p { font-size: 18px; font-weight: 700; }
.mobile-cta .p small { font-size: 13px; font-weight: 500; color: var(--text-alternative); }
.mobile-cta .btn-primary { flex-shrink: 0; }
/* 시트 핸들 (모바일 전용) */
.sheet-handle { display: none; }
/* 시트 헤더 (모바일 시트 전용) */
@media (min-width: 961px) { .sheet-head { display: none; } }
/* km 입력: trip-form 밖으로 이동한 뒤에도 동일 스타일 */
.km-field { display: block; position: relative; margin: -2px 0 12px; } /* 주행요금 행에 밀착 */
.km-field input::placeholder { font-size: 15px; font-weight: 400; color: var(--text-alternative); } /* 행 라벨과 동일 */
.km-field input { padding-right: 38px; }
.km-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-assistive); cursor: pointer;
}
.km-clear[hidden] { display: none; }
.km-suffix {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--text-general); pointer-events: none;
}
.km-suffix[hidden] { display: none; }
.km-field input {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  -webkit-appearance: none; appearance: none;
  padding: 11px 12px; border: 1px solid var(--tds-line-general-alternative);
  border-radius: 12px; font-family: inherit; font-size: 16px; text-align: left;
  font-weight: 400; color: var(--text-general); background: var(--tds-fill-alternative); outline: none;
}
.km-field input:focus { border-color: color-mix(in srgb, var(--tds-primary-general) 40%, transparent); }
/* 보험·단독사고 고정 영역 */
.fee-fixed { border-top: 1px solid var(--line-alternative); padding-top: 4px; }
.fee-fixed .row { border-bottom: none; }
/* 이용 시간 블록 — 데스크탑·시트 공통 */
.trip-range {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 2px 0 12px; border-bottom: 1px solid var(--line-alternative); margin-bottom: 12px;
}
.tr-change { flex-shrink: 0; background: #fff; align-self: center; }
.trip-form label.trip-io { display: none; } /* 픽업·반납 개별 필드는 전역 숨김 (값 보관용) */
.tr-main { min-width: 0; }
.tr-dur { font-size: 17px; font-weight: 700; }
.tr-text { font-size: 15px; color: var(--text-alternative); margin-top: 2px; }
.sheet-dim {
  display: none; position: fixed; inset: 0; z-index: 110;
  background: rgba(0, 0, 0, 0.42);
}
.sheet-dim.open { display: block; }

@media (max-width: 960px) {
  /* 모바일: 계산기 카드 = 바텀시트 — 평소엔 완전히 숨김, 총액 탭으로만 열림 */
  .book-card {
    position: fixed !important; left: 0; right: 0; bottom: 0; top: auto !important; z-index: 120;
    margin: 0; border-radius: 20px 20px 0 0; border-bottom: none;
    max-height: 86dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateY(110%);
    visibility: hidden; pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1), visibility 0s linear 0.32s;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .book-card.sheet-open {
    transform: translateY(0);
    visibility: visible; pointer-events: auto;
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1), visibility 0s;
  }
  .book-card { padding: 10px 16px calc(28px + env(safe-area-inset-bottom)); } /* 좌우는 모바일 웹 컨테이너와 동일(16px) */
  .sheet-handle {
    display: block; width: 40px; height: 4px; border-radius: 2px;
    background: var(--line-heavy); margin: 0 auto 12px; cursor: pointer;
  }
  .book-card .trip-form { margin-top: 12px; gap: 8px; }
  .book-card .pickup { display: none; } /* 시트에서는 픽업 장소 제외 (본문 섹션에서 안내) */
  .mobile-cta { display: flex; }
  body { padding-bottom: 76px; }
}
/* 하단 바: 총액(밑줄) 버튼 */
.mcta-total {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: none; border: none; padding: 0; font-family: inherit; text-align: left;
}
.mcta-total small { font-size: 11.5px; color: var(--text-alternative); font-weight: 500; }
.mcta-total span {
  font-size: 18px; font-weight: 700; color: var(--text-heavy);
  text-decoration: underline; text-underline-offset: 3px;
}

/* 비슷한 차량 (최대 6대) */
.similar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
@media (max-width: 960px) { .similar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  /* 모바일: 가로 스크롤 카드 */
  .similar-grid {
    display: flex; overflow-x: auto; gap: 14px;
    margin: 0 -16px; padding: 0 16px 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .similar-grid::-webkit-scrollbar { display: none; }
  .similar-grid .car-card { flex: 0 0 70%; max-width: 280px; }
}

/* 라이트박스 */
.lightbox {
  position: fixed; inset: 0; height: 100dvh; z-index: 200;
  background: #0F0F10; /* 불투명 — 딤 위 틈 보임 방지 */
  display: none; flex-direction: column; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
/* 드래그 디스미스 transform 대상 (스크롤 컨테이너 밖 래퍼) */
.lb-stage { width: 100%; height: 100%; display: flex; will-change: transform; }
/* 드래그 시작·닫힘 애니메이션 동안 UI 숨김 (사진과 겹침 방지) */
.lightbox.dragging .lb-close,
.lightbox.dragging .lb-nav,
.lightbox.dragging .lb-count,
.lightbox.dismissing .lb-close,
.lightbox.dismissing .lb-nav,
.lightbox.dismissing .lb-count { opacity: 0; transition: opacity 0.15s; }
/* 스크롤 스냅 캐러셀 트랙 */
.lb-track {
  display: flex; width: 100vw; height: 100%; align-items: stretch;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  touch-action: pan-x; /* 세로 제스처는 드래그 디스미스가 처리 */
  cursor: grab;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-track:active { cursor: grabbing; }
.lb-slide {
  flex: 0 0 100vw; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
}
.lb-slide img {
  max-width: min(92vw, 1040px); max-height: 80vh; object-fit: contain; border-radius: 8px;
  background: #1a1a1c; /* 로딩 전 자리 표시 */
  -webkit-user-drag: none; user-select: none;
}
/* 닫기·이전·다음: 큰 화면에서는 이미지 가장자리 근처에 배치, 아이콘은 flex 정중앙 */
.lightbox .lb-close {
  position: absolute; top: calc(24px + env(safe-area-inset-top));
  right: max(20px, calc(50% - 580px)); z-index: 5; /* 오른쪽 버튼 열에 정렬 */
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.14); border: none; color: #fff; padding: 0; line-height: 0;
}
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  width: 48px; height: 48px; border-radius: 50%; padding: 0; line-height: 0;
}
.lightbox .lb-prev { left: max(20px, calc(50% - 580px)); }
.lightbox .lb-next { right: max(20px, calc(50% - 580px)); }
/* 줌 대응 */
.lb-slide img { transform-origin: center center; will-change: transform; }
.lightbox .lb-count { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); color: rgba(255,255,255,.7); font-size: 14px; z-index: 5; }
@media (max-width: 720px) {
  /* iOS 주소창 전환 구간까지 검정으로 덮기 (피커 풀모달과 동일 처리) */
  .lightbox { top: -100px; bottom: -100px; height: auto; }
  .lightbox .lb-close { top: calc(124px + env(safe-area-inset-top)); }
  .lightbox .lb-count { bottom: calc(124px + env(safe-area-inset-bottom)); }
  .lb-slide img { max-width: 100vw; width: 100vw; border-radius: 0; }
  .lightbox .lb-nav { display: none; } /* 모바일: 스와이프로 넘김 */
  .lightbox .lb-close { right: 16px; }
}

/* 로딩/404 */
.not-found { text-align: center; padding: 120px 0; }
