body.product-detail-page {
  overflow-x: hidden;
  background: #f5f5f5;
  color: #000;
}

html:has(body.product-detail-page) {
  overflow-x: clip;
}

.product-detail-page main {
  background: #f5f5f5;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 879px;
  padding: 330px var(--gutter) 100px;
}

.detail-hero__inner,
.detail-section__inner,
.detail-info__group {
  width: min(1600px, 100%);
}

.detail-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 756px;
  align-items: center;
  gap: 150px;
  min-height: 449px;
}

.detail-hero__copy {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 80px;
}

.detail-hero__heading {
  display: grid;
  gap: 30px;
}

.detail-hero__category,
.detail-hero h1,
.detail-hero__description {
  margin: 0;
}

.detail-hero__category {
  color: #888;
  font-family: var(--font-latin);
  font-size: 24px;
  font-weight: 400;
  line-height: 24px;
}

.detail-hero h1 {
  color: #000;
  font-family: var(--font-latin);
  font-size: clamp(38px, 3.125vw, 60px);
  font-weight: 700;
  line-height: 1.4;
}

.detail-hero__description {
  max-width: 744px;
  color: #000;
  font-size: 18px;
  font-weight: 400;
  line-height: 30px;
  word-break: keep-all;
}

.detail-hero__category,
.detail-hero h1,
.detail-hero__description,
.detail-hero__visual {
  opacity: 1;
  transform: translateY(0);
}

body.is-product-detail-ready .detail-hero__category,
body.is-product-detail-ready .detail-hero h1,
body.is-product-detail-ready .detail-hero__description,
body.is-product-detail-ready .detail-hero__visual {
  animation: productDetailHeroFadeUp .72s var(--ease) forwards;
}

body.is-product-detail-ready .detail-hero h1 {
  animation-delay: .12s;
}

body.is-product-detail-ready .detail-hero__description {
  animation-delay: .24s;
}

body.is-product-detail-ready .detail-hero__visual {
  animation-delay: .18s;
}

@keyframes productDetailHeroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-hero__visual {
  position: relative;
  z-index: 1;
  width: 756px;
  height: 449px;
  flex: 0 0 auto;
  pointer-events: none;
}

.detail-hero__circle,
.detail-hero__image,
.detail-hero__image img,
.detail-hero__badge {
  pointer-events: none;
}

.detail-hero__circle {
  position: absolute;
  left: 80px;
  top: -86px;
  width: 596px;
  height: 596px;
  border-radius: 50%;
  background: #e8e8e8;
}

.detail-hero__image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.detail-hero__image img {
  object-fit: contain;
  transition: opacity .32s var(--ease);
}

.detail-hero__viewer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s var(--ease);
}

.detail-hero__viewer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(0, 0, 0, .12);
  border-top-color: var(--primary);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: detailHeroViewerSpin .8s linear infinite;
  transition: opacity .24s var(--ease);
}

.detail-hero__viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 0;
  touch-action: none;
  transition: opacity .32s var(--ease);
}

.detail-hero__viewer.is-dragging canvas {
  cursor: grabbing;
}

body.has-detail-hero-viewer .detail-hero__visual,
body.has-detail-hero-viewer .detail-hero__image {
  pointer-events: auto;
}

body.has-detail-hero-viewer .detail-hero__image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118%;
  height: 156%;
  overflow: visible;
  transform: translate(-50%, -50%);
}

body.has-detail-hero-viewer .detail-hero__viewer,
body.is-detail-hero-viewer-loaded .detail-hero__viewer {
  opacity: 1;
  pointer-events: auto;
}

body.has-detail-hero-viewer .detail-hero__image > .img-cover,
body.is-detail-hero-viewer-loaded .detail-hero__image > .img-cover {
  opacity: 0;
}

body.is-detail-hero-viewer-loading .detail-hero__viewer::before {
  opacity: 1;
}

body.is-detail-hero-viewer-loaded .detail-hero__viewer::before {
  opacity: 0;
  animation-play-state: paused;
}

body.is-detail-hero-viewer-loaded .detail-hero__viewer canvas {
  opacity: 1;
}

@keyframes detailHeroViewerSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

body.is-incontinence-product .detail-hero__image,
body.is-incontinence-product .feature-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.is-incontinence-product .detail-hero__image {
  overflow: visible;
}

body.is-incontinence-product .detail-hero__image .img-cover {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: scale(.85);
}

body.is-incontinence-product .feature-card__media .img-cover {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

body.is-positioning-product .detail-hero__image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

body.is-positioning-product .detail-hero__image .img-cover {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: translate(-50px, -10px) scale(.9);
}

.detail-hero__badge {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
  transition: opacity .28s var(--ease), visibility .28s var(--ease);
}

/* 돌리는 동안만 배지를 감춘다(3D 뷰어 / 360 이미지 시퀀스 공통).
   손을 떼면 JS 가 클래스를 지우고 위 transition 으로 다시 부드럽게 나타난다. */
body.is-detail-hero-viewer-dragged .detail-hero__badge,
body.is-detail-hero-sequence-dragged .detail-hero__badge {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.product-detail-page:not(.has-detail-hero-badge) .detail-hero__badge,
.detail-hero__badge[hidden] {
  display: none;
}

.detail-hero__badge img {
  width: 73px;
  height: 74px;
  object-fit: cover;
}

.detail-features {
  display: flex;
  justify-content: center;
  min-height: 2122px;
  padding: 0 var(--gutter) 160px;
}

.detail-section__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.detail-section__title {
  margin: 0;
  color: #000;
  font-family: var(--font-latin);
  font-size: 40px;
  font-weight: 700;
  line-height: 40px;
}

.detail-section__unit {
  font-family: var(--font-ko);
  font-size: 20px;
  font-weight: 500;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.detail-features .detail-section__title,
.detail-features .feature-card,
.detail-info__group .detail-section__title,
.detail-info__group .spec-table,
.detail-info__group .spec-matrix-wrap {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .72s var(--ease), transform .72s var(--ease);
  will-change: opacity, transform;
}

.detail-features.is-visible .detail-section__title,
.detail-features.is-visible .feature-card,
.detail-info__group.is-visible .detail-section__title,
.detail-info__group.is-visible .spec-table,
.detail-info__group.is-visible .spec-matrix-wrap {
  opacity: 1;
  transform: translateY(0);
}

.detail-info__group.is-visible .spec-table,
.detail-info__group.is-visible .spec-matrix-wrap {
  transition-delay: .16s;
}

.detail-features.is-visible .feature-card:nth-child(1) { transition-delay: .14s; }
.detail-features.is-visible .feature-card:nth-child(2) { transition-delay: .26s; }
.detail-features.is-visible .feature-card:nth-child(3) { transition-delay: .38s; }
.detail-features.is-visible .feature-card:nth-child(4) { transition-delay: .50s; }

.feature-card {
  min-width: 0;
  min-height: 921px;
  padding: 50px;
  border-radius: 20px;
  background: #fff;
}

.feature-card__inner {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 80px;
}

.feature-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1448 / 1086;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #dedede;
}

.feature-card__media--cell {
  aspect-ratio: 1472 / 1069;
}

.feature-card__media--zone,
.feature-card__media--airgrid,
.feature-card__media--valves {
  aspect-ratio: 1448 / 1086;
}

.feature-card__media img {
  pointer-events: none;
}

.feature-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 40px;
}

.feature-card__heading {
  display: grid;
  gap: 20px;
}

.feature-card__eyebrow,
.feature-card h3,
.feature-card__description {
  margin: 0;
}

.feature-card__eyebrow {
  color: var(--primary);
  font-family: var(--font-latin);
  font-size: 18px;
  font-weight: 700;
  line-height: 18px;
}

.feature-card h3 {
  color: #000;
  font-size: clamp(28px, 2.35vw, 45px);
  font-weight: 700;
  line-height: 45px;
  word-break: keep-all;
}

.feature-card__description {
  max-width: 672px;
  color: #000;
  font-size: 24px;
  font-weight: 400;
  line-height: 36px;
  word-break: keep-all;
}

/* body[data-lang="en"].product-detail-page :is(.detail-hero h1, .detail-hero__description, .feature-card h3, .feature-card__description),
body[data-lang="ja"].product-detail-page :is(.detail-hero h1, .detail-hero__description, .feature-card h3, .feature-card__description),
body[data-lang="de"].product-detail-page :is(.detail-hero h1, .detail-hero__description, .feature-card h3, .feature-card__description) {
  max-width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: auto;
}

body[data-lang="en"].product-detail-page .feature-card h3,
body[data-lang="ja"].product-detail-page .feature-card h3,
body[data-lang="de"].product-detail-page .feature-card h3 {
  font-size: 43px;
  line-height: 1.2;
}

body[data-lang="en"].product-detail-page .feature-card__description,
body[data-lang="ja"].product-detail-page .feature-card__description,
body[data-lang="de"].product-detail-page .feature-card__description {
  line-height: 1.5;
} */

.detail-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 100px;
  padding: 160px var(--gutter);
  background: #fff;
}

.detail-info__group {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.spec-table {
  width: 100%;
}

.spec-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #ccc;
}

.spec-row--top {
  border-top-color: #000;
}

.spec-row--bottom {
  border-bottom: 1px solid #ccc;
}

.spec-row--single {
  grid-template-columns: 1fr;
}

.spec-cell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 60px;
  min-height: 58px;
  align-items: center;
  padding: 20px 10px;
  color: #000;
  font-size: 18px;
  line-height: 18px;
}

.spec-cell strong,
.spec-cell span {
  min-width: 0;
  margin: 0;
  word-break: keep-all;
}

.spec-cell strong {
  font-weight: 700;
  white-space: nowrap;
  overflow-wrap: normal;
}

.spec-cell span {
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-line;
}

.spec-matrix-wrap {
  width: 100%;
  overflow-x: auto;
}

.spec-matrix {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #000;
  font-size: 18px;
  line-height: 1.45;
}

.spec-matrix th,
.spec-matrix td {
  min-height: 58px;
  padding: 18px 20px;
  border-top: 1px solid #ccc;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.spec-matrix th {
  overflow-wrap: normal;
}

.spec-matrix thead th {
  border-top-color: #000;
  font-weight: 700;
}

.spec-matrix tbody tr:last-child th,
.spec-matrix tbody tr:last-child td {
  border-bottom: 1px solid #ccc;
}

.spec-matrix tbody th {
  font-weight: 700;
}

.spec-matrix td {
  font-weight: 400;
}

.detail-info__actions {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 58px;
}

.detail-list-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 20px 30px;
  border: 1px solid #222;
  border-radius: 10px;
  background: #222;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  line-height: 18px;
  text-decoration: none;
  transition: background .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}

.detail-list-button:hover,
.detail-list-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 1600px) {
  .detail-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(470px, 47.25vw);
    gap: clamp(70px, 9.375vw, 150px);
  }

  .detail-hero__visual {
    width: 100%;
    height: auto;
    aspect-ratio: 756 / 449;
  }

  .detail-hero__circle {
    left: 10.58%;
    top: -19.15%;
    width: 78.84%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .detail-hero__badge {
    left: 50%;
    top: 50%;
    width: clamp(86px, 7.5vw, 120px);
    height: clamp(86px, 7.5vw, 120px);
  }

  .detail-hero__badge img {
    width: clamp(52px, 4.5625vw, 73px);
    height: clamp(53px, 4.625vw, 74px);
  }

  .feature-card {
    min-height: 0;
    padding: clamp(34px, 3.125vw, 50px);
  }

  .feature-card__inner {
    gap: clamp(50px, 5vw, 80px);
  }

  .feature-card h3 {
    font-size: clamp(24px, 2.65vw, 42px);
    line-height: 1.12;
  }

  .feature-card__description {
    font-size: clamp(19px, 1.5vw, 24px);
    line-height: 1.5;
  }
}

@media (max-width: 1180px) {
  .detail-hero {
    min-height: auto;
    /* .products-title 는 1180 구간이 없어 1024 까지 330px 을 유지한다.
       제품 목록 -> 상세로 넘어갈 때 상단이 튀지 않도록 여기서도 내리지 않는다. */
    /* padding-top: 260px; */
  }

  .detail-hero__inner {
    grid-template-columns: 1fr;
    gap: 110px;
  }

  .detail-hero__copy {
    gap: 48px;
  }

  .detail-hero__visual {
    width: min(660px, 100%);
    justify-self: center;
  }

  /* 제품군별로 상단 여백이 달라지지 않도록 해제한다. */
  body.is-positioning-product .detail-hero {
    /* padding-top: 260px; */
  }

  /* 자세변환용구 전용 보정(원본 크기 + translate(-50px,-10px) scale(.9))은
     데스크톱 히어로 크기를 전제로 한 고정 px 이동이라, 히어로가 축소되는
     반응형에서 이미지가 한쪽으로 쏠리고 상하 가운데도 어긋난다.
     안전손잡이(기본 스타일)와 동일하게 컨테이너에 맞춰 정렬되도록 되돌린다. */
  body.is-positioning-product .detail-hero__image {
    display: block;
    overflow: hidden;
  }

  body.is-positioning-product .detail-hero__image .img-cover {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: none;
  }

  body.is-incontinence-product .detail-hero {
    /* padding-top: 240px; */
    /* padding-bottom: 120px; */
  }

  body.is-incontinence-product .detail-hero__inner {
    gap: 46px;
  }

  body.is-incontinence-product .detail-hero__copy {
    align-items: center;
    gap: 38px;
    text-align: center;
  }

  body.is-incontinence-product .detail-hero__description {
    max-width: 680px;
  }

  body.is-incontinence-product .detail-hero__visual {
    width: min(560px, 78vw);
    margin-inline: auto;
    aspect-ratio: 1 / 1;
  }

  body.is-incontinence-product .detail-hero__circle {
    left: 50%;
    top: 50%;
    width: 88%;
    transform: translate(-50%, -50%);
  }

  body.is-incontinence-product .detail-hero__image .img-cover {
    max-width: 82%;
    max-height: 82%;
    transform: none;
  }

  .detail-features {
    min-height: 0;
  }

  .feature-grid {
    gap: 30px;
  }

  .feature-card__copy {
    gap: 30px;
  }

  .spec-cell {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 34px;
  }
}

@media (max-width: 1024px) {
  .detail-hero {
    padding: 260px var(--gutter) 88px;
  }

  .detail-hero__category {
    font-size: 18px;
    line-height: 1.25;
  }

  /* .detail-hero h1 {
    font-size: clamp(30px, 9vw, 52px);
  } */

  .detail-hero__description {
    font-size: 16px;
    line-height: 1.75;
  }

  .detail-features {
    padding-bottom: 100px;
  }

  .detail-section__title {
    font-size: 26px;
    line-height: 1.1;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card__eyebrow {
    font-size: 14px;
    line-height: 1.2;
  }

  .feature-card h3 {
    font-size: clamp(21px, 7vw, 36px);
  }

  .feature-card__description {
    font-size: 16px;
    line-height: 1.6;
  }

  .detail-info {
    gap: 90px;
    padding-block: 100px;
  }

  .spec-row {
    grid-template-columns: 1fr;
  }

  .spec-row > .spec-cell + .spec-cell {
    border-top: 1px solid #ccc;
  }

  .spec-cell {
    grid-template-columns: minmax(104px, 34%) minmax(0, 1fr);
    gap: 18px;
    min-height: 54px;
    font-size: 15px;
    line-height: 1.35;
  }
}

/* 768px 이하: 본문/표/버튼을 모바일 크기로.
   버튼은 min-height 고정 대신 패딩으로 높이를 잡아,
   글자가 줄면 버튼도 같은 비율로 줄어들게 한다. */
@media (max-width: 768px) {
  /* 1024 구간의 상단 260px 은 좁은 화면에서 과하다. 하단 값은 페이지별로 유지. */
  .detail-hero {
    padding: 220px var(--gutter) 88px;
  }

  .detail-hero__inner {
    gap: 100px;
  }

  /* 기본값 43px 는 좁은 화면에서 너무 크다.
     선택자를 그대로 반복해야 위쪽 body[data-lang=...] 규칙(0,2,2)을 이긴다. */
  /* body[data-lang="en"].product-detail-page .feature-card h3,
  body[data-lang="ja"].product-detail-page .feature-card h3,
  body[data-lang="de"].product-detail-page .feature-card h3 {
    font-size: 36px;
  } */

  .detail-section__unit {
    font-size: 18px;
  }

  .spec-matrix {
    font-size: 15px;
  }

  .detail-info__actions {
    min-height: auto;
  }

  .detail-list-button {
    min-height: auto;
    padding: 16px 20px;
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .detail-hero {
    /* .products-title 는 768 의 220px 을 그대로 유지하므로 여기서도 내리지 않는다. */
    /* padding-top: 170px; */
    padding-bottom: 70px;
  }

  .detail-hero__inner {
    gap: 80px;
  }

  .detail-hero__copy {
    gap: 34px;
  }

  .detail-hero__heading {
    gap: 16px;
  }

  .detail-hero h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  /* 112% + 음수 마진은 좌우 gutter 를 넘어 화면 끝까지 흘려보내던 값이다.
     .detail-hero 의 padding(var(--gutter)) 안에 들어오도록 되돌린다. */
  .detail-hero__visual {
    width: 100%;
    margin-inline: 0;
  }

  .detail-features {
    padding-bottom: 80px;
  }

  .detail-section__inner,
  .detail-info__group {
    gap: 28px;
  }

  .feature-grid {
    gap: 20px;
  }

  .feature-card {
    padding: 24px;
    border-radius: 14px;
  }

  .feature-card__inner {
    gap: 34px;
  }

  .feature-card__media {
    border-radius: 12px;
  }

  .feature-card h3 {
    font-size: 25px;
  }

  .detail-info {
    gap: 50px;
    padding-block: 80px;
  }

  .spec-cell {
    padding: 16px 0;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 4px;
  }
}

@media (max-width: 390px) {
  .feature-card h3 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-hero__category,
  .detail-hero h1,
  .detail-hero__description,
  .detail-hero__visual,
  .detail-features .detail-section__title,
  .detail-features .feature-card,
  .detail-info__group .detail-section__title,
  .detail-info__group .spec-table {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none !important;
  }
}

/* ===== 제품 상세 히어로 360도 이미지 시퀀스 ===== */
/* has-detail-hero-sequence 는 뷰어가 실제로 붙은 뒤 JS가 추가한다.
   JS가 실패하면 기존 정지 이미지가 그대로 보인다. */

.detail-hero__sequence {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.detail-hero__sequence.is-dragging {
  cursor: grabbing;
}

.detail-hero__sequence:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.detail-hero__sequence-frame {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

body.has-detail-hero-sequence .detail-hero__visual,
body.has-detail-hero-sequence .detail-hero__image {
  pointer-events: auto;
}

body.has-detail-hero-sequence .detail-hero__image > .img-cover {
  opacity: 0;
}

/* 이미지가 박스 밖으로 넘치는 제품군(요실금 등)에서도 넘친 부분까지 끌 수 있게 한다.
   .detail-hero__image img 의 pointer-events:none 을 덮어쓴다. */
body.has-detail-hero-sequence .detail-hero__image .detail-hero__sequence-frame {
  pointer-events: auto;
}

/* 컷 preload 진행 막대 */
.detail-hero__sequence::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 96px;
  height: 2px;
  border-radius: 2px;
  background: rgba(17, 17, 17, .12);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

body.is-detail-hero-sequence-loading .detail-hero__sequence::after {
  opacity: 1;
  background-image: linear-gradient(#111, #111);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: calc(var(--sequence-progress, 0) * 100%) 100%;
}

@media (prefers-reduced-motion: reduce) {
  .detail-hero__sequence::after {
    transition: none;
  }
}
