/* ==========================================================================
   terms.css (이용약관 · 고객약관 · 개인정보취급방침 페이지)
   - 반응형: PC 퍼스트
     PC     : 1100px 이상 (기본값)
     Tablet : @media (max-width: 1099px)
     Mobile : @media (max-width: 767px)
   - 시안 없음 : 정보페이지(delivery.css)의 섹션 여백 · 탭 방식을 따르고,
     약관 본문(긴 법률 문서) 스타일만 이 페이지에서 새로 정의
   ========================================================================== */

/* ==========================================================================
   섹션 · 페이지 제목
   ========================================================================== */
.terms {
  width: 100%;
  padding: var(--space-64) 0 var(--space-96);
  /* 긴 문장이 "서비/스" 처럼 글자 단위로 끊기지 않고 어절 단위로 줄바꿈되게 */
  word-break: keep-all;
}

.terms__head {
  padding-bottom: var(--space-36);
}

.terms__tit {
  font-size: var(--fz-heading-l);
  font-weight: 600;
  line-height: var(--lh-heading);
  color: var(--text-primary);
}

/* ==========================================================================
   약관 종류 탭
   - 공통 .chip 재사용 (선택 상태 .is-active). 전환은 js/pages/terms.js
   - 탭 패널(.terms__panel)은 hidden 속성으로 여닫으므로 display 를 지정하지 않음
   ========================================================================== */
.terms__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  width: 100%;
  padding-bottom: var(--space-32);
  border-bottom: 1px solid var(--border-default);
}

.terms__panel {
  padding-top: var(--space-32);
}

.terms__panel:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 4px;
}

/* ==========================================================================
   약관 본문
   - 조항 제목(.terms-article__tit)은 굵게, 항(①)·호(1.)·목(가.)은 번호를
     원문 그대로 텍스트로 두고 "내어쓰기"로 둘째 줄부터 번호 뒤에 맞춤
   ========================================================================== */
.terms__intro {
  padding: var(--space-24);
  border-radius: 12px;
  background: var(--base-surface);
  font-size: var(--fz-body-xs);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.terms__intro > * + * {
  margin-top: var(--space-12);
}

.terms__doc-tit {
  margin-top: var(--space-48);
  font-size: var(--fz-body-xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.terms-article {
  margin-top: var(--space-32);
  font-size: var(--fz-body-xs);
  line-height: var(--lh-body);
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}

/* 개인정보취급방침은 문서 제목(.terms__doc-tit) 없이 안내 박스 바로 뒤에 조항이 옴 */
.terms__intro + .terms-article {
  margin-top: var(--space-48);
}

.terms-article > * + * {
  margin-top: var(--space-8);
}

.terms-article__tit {
  font-size: var(--fz-body-m);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.terms-article__note {
  color: var(--text-muted);
}

/* 번호(①, 1., 가.)는 텍스트라서 글자 폭이 제각각 — 1.4em 이면 "①" · "1." · "가." 모두 들어감 */
.terms-list > li {
  padding-left: 1.4em;
  text-indent: -1.4em;
}

.terms-list > li + li {
  margin-top: var(--space-8);
}

/* 내어쓰기(text-indent)는 상속되므로 안쪽 블록에서는 되돌림 */
.terms-list--sub,
.terms-info,
.terms-list__desc,
.terms-table {
  margin-top: var(--space-8);
  text-indent: 0;
}

.terms-list--sub > li + li {
  margin-top: 4px;
}

/* ----- 위탁처리 표 (개인정보취급방침 7조) ----- */
.terms-table table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--text-primary);
}

.terms-table th,
.terms-table td {
  padding: var(--space-12) var(--space-16);
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  vertical-align: top;
}

.terms-table th {
  background: var(--base-surface);
  font-weight: 600;
  color: var(--text-primary);
}

.terms-table th:first-child,
.terms-table td:first-child {
  width: 40%;
}

/* ==========================================================================
   Tablet (max-width: 1099px)
   ========================================================================== */
@media (max-width: 1099px) {
  .terms__tit {
    font-size: var(--fz-heading-m);
  }
}

/* ==========================================================================
   Mobile (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
  /* 공통 .chip 은 모바일에서도 12px 24px 그대로지만, delivery.css 의 FAQ 분류 탭과
     같은 값으로 이 페이지에서만 축소 */
  .terms__tabs {
    gap: 6px 4px;
  }

  .terms__tabs .chip {
    padding: 8px 16px;
  }

  .terms__intro {
    padding: var(--space-16);
  }

  .terms-table th,
  .terms-table td {
    padding: var(--space-8) var(--space-12);
  }
}
