/* =============================================================
   treatment-detail.css — C3 시술 상세(/treatments/{id}) 페이지 전용
   시안: Figma TheKKOT-yhlee · node 9:719(모바일 393) / 9:486(데스크탑 1280)

   모바일: 히어로가 화면 끝까지 붙고(프레임 패딩을 음수 마진으로 벗어난다)
           앵커 탭이 헤더 아래 sticky 로 따라온다.
   데스크탑: 본문(좌) + 고정 카드(우) 2단. 탭·플로팅 버튼은 사라진다.
   ============================================================= */

/* ---------------------------------------------------------------
   히어로 이미지
   --------------------------------------------------------------- */
.td-hero {
  /* 모바일은 풀블리드 — 프레임 좌우 패딩을 벗어난다 */
  margin: 0 calc(-1 * var(--kb-frame-pad));
}

.td-hero img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: var(--kb-gray-50);
}

/* ---------------------------------------------------------------
   시술명 + 핵심 메타 (시안 상세 top)
   --------------------------------------------------------------- */
.td-top {
  padding: 30px 0;
}

.td-subtitle {
  color: var(--kb-gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.td-title {
  color: var(--kb-gray-900);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 30px;
}

.td-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.td-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--kb-gray-600);
  font-size: 0.8125rem;
  font-weight: 500;
}

.td-meta-row::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
}

.td-meta-clock::before {
  -webkit-mask: url("../img/treatment/icon/icon-clock.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-clock.svg") center / contain no-repeat;
}

.td-meta-level::before {
  -webkit-mask: url("../img/treatment/icon/icon-level.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-level.svg") center / contain no-repeat;
}

/* division 밴드도 모바일 풀블리드 */
main .t-division {
  margin: 0 calc(-1 * var(--kb-frame-pad));
}

/* ---------------------------------------------------------------
   모바일 앵커 탭 — 헤더(50px) 아래 sticky
   --------------------------------------------------------------- */
.td-tabs {
  position: sticky;
  top: 50px;
  z-index: 30; /* 헤더(40)보다는 아래 */
  display: flex;
  gap: 12px;
  margin: 0 calc(-1 * var(--kb-frame-pad));
  padding: 0 var(--kb-frame-pad);
  background: var(--kb-white);
  border-bottom: 1px solid var(--kb-gray-300);
}

.td-tabs a {
  padding: 16px 2px;
  color: var(--kb-gray-500);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* 컨테이너 하단선 위에 겹친다 */
}

.td-tabs a.is-current {
  color: var(--kb-gray-900);
  font-weight: 700;
  border-bottom-color: var(--kb-gray-900);
}

/* 앵커 이동 시 sticky 헤더+탭에 가리지 않게 */
.td-section {
  scroll-margin-top: 110px;
}

/* ---------------------------------------------------------------
   본문 섹션
   --------------------------------------------------------------- */
.td-section {
  padding: 24px 0;
}

.td-section h2 {
  color: var(--kb-gray-900);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.td-copy {
  color: var(--kb-gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 22px;
  white-space: pre-line; /* 운영자가 넣은 줄바꿈 유지 */
}

/* ---------------------------------------------------------------
   정보요약 — 2×2 그리드 (시안 정보요약)
   --------------------------------------------------------------- */
.td-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 12px;
  padding: 24px 0;
  border-top: 1px solid var(--kb-gray-200);
  border-bottom: 1px solid var(--kb-gray-200);
}

.td-summary-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.td-summary-item > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.td-summary-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--kb-radius);
  background: var(--kb-main-50);
}

.td-summary-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--kb-main-600);
}

.td-icon-clock::before {
  -webkit-mask: url("../img/treatment/icon/icon-clock.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-clock.svg") center / contain no-repeat;
}

.td-icon-timer::before {
  -webkit-mask: url("../img/treatment/icon/icon-timer.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-timer.svg") center / contain no-repeat;
}

.td-icon-level::before {
  -webkit-mask: url("../img/treatment/icon/icon-level.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-level.svg") center / contain no-repeat;
}

.td-icon-calendar::before {
  -webkit-mask: url("../img/treatment/icon/icon-calendar.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-calendar.svg") center / contain no-repeat;
}

.td-summary-label {
  color: var(--kb-gray-600);
  font-size: 0.875rem;
  font-weight: 500;
}

.td-summary-value {
  color: var(--kb-gray-900);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------
   이런 분께 권합니다 — 체크리스트
   --------------------------------------------------------------- */
.td-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.td-checklist li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--kb-gray-700);
  font-size: 0.875rem;
  font-weight: 500;
}

.td-checklist li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--kb-gray-700);
  -webkit-mask: url("../img/treatment/icon/icon-check.svg") center / contain no-repeat;
  mask: url("../img/treatment/icon/icon-check.svg") center / contain no-repeat;
}

/* ---------------------------------------------------------------
   진행 순서 — 자동 넘버링 (procedure_steps '|' split)
   번호 원 뒤로 세로 연결선이 지나간다 (시안 Line 9)
   --------------------------------------------------------------- */
.td-steps {
  position: relative;
}

.td-steps::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: var(--kb-gray-200);
}

.td-steps li {
  position: relative; /* 연결선 위로 */
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 12px 0;
}

.td-step-num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 100px;
  background: var(--kb-main-50);
  color: var(--kb-main-600);
  font-family: var(--kb-font-display);
  font-size: 0.8125rem;
  font-weight: 600;
}

.td-step-name {
  color: var(--kb-gray-800);
  font-size: 0.875rem;
  font-weight: 700;
}

/* ---------------------------------------------------------------
   이 시술이 포함된 프로그램 (모바일 · 2열)
   --------------------------------------------------------------- */
.td-programs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.td-program-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.td-program-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--kb-radius);
  background: var(--kb-gray-50);
  margin-bottom: 8px;
}

.td-program-name {
  color: var(--kb-gray-800);
  font-size: 1rem;
  font-weight: 700;
}

.td-program-meta {
  color: var(--kb-gray-500);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---------------------------------------------------------------
   태블릿 — 히어로만 조금 키운다
   --------------------------------------------------------------- */
@media (min-width: 560px) {
  .td-hero img {
    height: 360px;
  }
}

/* ---------------------------------------------------------------
   데스크탑 — 본문(좌) + 고정 카드(우) 2단 (시안 9:486)
   --------------------------------------------------------------- */
@media (min-width: 1100px) {
  .td-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 384px;
    gap: 20px;
    align-items: start;
    padding-top: 50px;
    padding-bottom: 30px;
  }

  .td-hero {
    margin: 0; /* 풀블리드 해제 */
  }

  .td-hero img {
    height: 562px;
    border-radius: 12px;
  }

  .td-section {
    padding: 30px 0;
  }

  #td-about h2 {
    font-size: 1.25rem;
  }

  .td-summary {
    padding: 30px 0;
  }

  /* 우측 고정 카드 */
  .td-aside {
    position: sticky;
    top: 90px; /* 헤더 70 + 20 */
  }

  .td-aside-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 30px 24px;
    border: 1px solid var(--kb-gray-300);
    border-radius: 12px;
    background: var(--kb-white);
  }

  .td-aside-head {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--kb-gray-300);
  }

  .td-aside-head .td-title {
    font-size: 1.5rem;
  }

  .td-aside-programs {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .td-aside-programs-title {
    color: var(--kb-gray-900);
    font-size: 1rem;
    font-weight: 600;
  }

  .td-aside-program {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .td-aside-program img {
    flex: none;
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--kb-radius);
    background: var(--kb-gray-50);
  }

  .td-aside-program-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .td-aside-cta {
    width: 100%;
  }
}
