/**
 * 엔스타일투어 리뉴얼 - 여행상품 예약 (/{지역}/prod/reserve)
 * base.css → region.css → prod.css → prod-view.css 다음에 로드
 * 테마: 지역 제목 띠 · 카테고리는 지역 테마, 예약 영역은 사이트 기본 색상 (.theme-site)
 * 입력 폼은 base.css 공통 컴포넌트(.form-card / .form-row / .chip / .check …) 사용
 */

/* ==========================================================
   1. 위치 / 제목
   ========================================================== */
.pv-crumb .is-current { color: var(--text-secondary); font-weight: 700; }
.pv-crumb a:last-of-type { color: var(--text-tertiary); font-weight: 400; } /* 마지막 항목(예약)만 강조 */

.rv-page { padding-bottom: 5rem; }
.rv-head { margin-bottom: 1.75rem; }
.rv-head .pv-sec-title { margin-bottom: 0.6rem; }
.rv-lead { font-size: 0.88rem; line-height: 1.7; color: var(--text-secondary); }

/* ==========================================================
   2. 배치 : PC [입력 폼 | 상품 요약(따라옴)] / 모바일 상품 요약 → 입력 폼
   ========================================================== */
.rv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "main side";
  gap: 2.5rem;
  align-items: start;
}

.rv-main { grid-area: main; min-width: 0; }
.rv-side { grid-area: side; position: sticky; top: calc(var(--header-h) + 1.25rem); min-width: 0; }

/* ==========================================================
   3. 상품 요약 카드
   ========================================================== */
.rv-summary { border: 1px solid var(--line); border-top: 3px solid var(--region); background: var(--white); }
.rv-summary-photo { overflow: hidden; aspect-ratio: 980 / 460; background: var(--region-sub); }
.rv-summary-photo img { width: 100%; height: 100%; object-fit: cover; }
.rv-summary-body { padding: 1.4rem 1.5rem 1.5rem; }
.rv-summary-title { margin-top: 0.8rem; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.4px; line-height: 1.45; }
.rv-summary .pv-route { font-size: 0.78rem; }

.rv-summary-info { margin-top: 1.1rem; border-top: 2px solid var(--ink); }
.rv-summary-info .row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.rv-summary-info dt { flex: none; font-weight: 700; color: var(--text-primary); }
.rv-summary-info dd { min-width: 0; text-align: right; color: var(--text-secondary); }
.rv-summary-info .price strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.4px; color: var(--text-primary); }
.rv-tel { font-weight: 700; color: var(--text-primary); }
.rv-tel:hover { text-decoration: underline; text-underline-offset: 3px; }
.rv-notes { margin-top: 1rem; }

/* ==========================================================
   4. 입력 폼 보완
   ========================================================== */
.rv-main .form-row .form-field > .chip-group { margin-left: 0.25rem; } /* 한글이름 옆 성별 */
.rv-main #optionGroup { gap: 0.5rem; }
.rv-cnt { width: 140px; }
.rv-cnt-help { font-size: 0.8rem; color: var(--text-tertiary); }
.rv-main .textarea { min-height: 130px; }

/* 날짜 입력 : 다른 입력창과 같은 높이 / 달력 아이콘 색 */
.rv-main input[type="date"] { min-height: 44px; font-family: inherit; color: var(--text-primary); }
.rv-main input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }

/* ==========================================================
   5. 약관 동의
   ========================================================== */
.rv-agree-all { display: flex; width: 100%; padding: 0.95rem 1.1rem; border: 1px solid var(--region); background: var(--region-sub); font-size: 0.92rem; font-weight: 800; color: var(--text-primary); }

.rv-terms { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.rv-terms-title { margin-bottom: 0.6rem; font-size: 0.92rem; font-weight: 800; color: var(--text-primary); }
.rv-terms-title .req { margin-left: 0.2rem; font-size: 0.78rem; font-weight: 700; color: var(--gold-deep); }

/* 약관 본문 : 기존 약관 조각(.serviceBox > .ttt / .tit / .txt)을 작은 스크롤 상자로 */
.rv-terms-box {
  max-height: 180px;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  background: var(--ivory);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-secondary);
  word-break: keep-all;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
}

.rv-terms-box:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.rv-terms-box .ttt { display: none; } /* 제목은 위 .rv-terms-title 로 표시 */
.rv-terms-box .tit { margin: 1rem 0 0.3rem; font-weight: 800; color: var(--text-primary); }
.rv-terms-box .tit:first-child, .rv-terms-box .ttt + .tit { margin-top: 0; }
.rv-terms-box .txt + .txt { margin-top: 0.5rem; }
.rv-terms-box b, .rv-terms-box strong { color: var(--text-primary); }
.rv-terms-box table { width: 100%; margin: 0.5rem 0; border-collapse: collapse; }
.rv-terms-box th, .rv-terms-box td { padding: 0.4rem 0.55rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.rv-terms-box th { background: var(--white); color: var(--text-primary); }
.rv-terms-item > .check { margin-top: 0.7rem; color: var(--text-primary); font-weight: 700; }

.rv-main .form-actions .btn-primary { min-width: 220px; justify-content: center; }

/* ==========================================================
   6. 반응형
   ========================================================== */
@media (max-width: 1024px) {
  .rv-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; gap: 1.5rem; }
  .rv-side { position: static; }

  /* 상품 요약 : [사진 | 상품명 · 가격] 가로 배치로 짧게 */
  .rv-summary { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .rv-summary-photo { aspect-ratio: auto; min-height: 100%; }
}

@media (max-width: 768px) {
  .rv-page { padding-bottom: 3rem; }
  .rv-head { margin-bottom: 1.25rem; }
  .rv-lead { font-size: 0.82rem; }

  .rv-summary { display: block; }
  .rv-summary-photo { aspect-ratio: 980 / 460; }
  .rv-summary-body { padding: 1.1rem 1.1rem 1.25rem; }
  .rv-summary-title { font-size: 1.05rem; }

  .rv-main .form-row .form-field > .chip-group { margin-left: 0; }
  .rv-main #guestEnLastName, .rv-main #guestEnFirstName { flex: 1 1 0; width: auto; min-width: 0; }
  .rv-main input[type="date"] { width: 100%; }
  .rv-main .input, .rv-main .select, .rv-main .textarea { font-size: 16px; } /* iOS 확대 방지 */

  /* 위치 표시 : 한 줄 유지 (넘치면 옆으로 밀어서 보기) */
  .pv-crumb { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .pv-crumb::-webkit-scrollbar { display: none; }
  .pv-crumb > * { flex: none; }


  .rv-terms-box { max-height: 150px; padding: 0.85rem 0.95rem; }
  .rv-main .form-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .rv-main .form-actions > * { min-width: 0; padding-left: 0.75rem; padding-right: 0.75rem; white-space: nowrap; justify-content: center; }
  .rv-main .form-actions .btn-primary { min-width: 0; } /* PC 최소 폭(220px) 해제 */
}
