/* 상품 상세 전용 */

/* 상단 이미지 (자막 태그는 좌하단) */
.product-hero { position: relative; height: calc(360 * var(--u)); overflow: hidden; background: var(--grey-100); }
.product-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.product-hero .cap-tag { position: absolute; left: 16px; bottom: 16px; }

/* 상품 요약 */
.product-summary { display: flex; flex-direction: column; gap: calc(6 * var(--u)); padding: calc(22 * var(--u)) calc(20 * var(--u)) calc(24 * var(--u)); }
.product-summary__title { font-size: max(18px, calc(18 * var(--u))); font-weight: 500; line-height: 1.4; }
.product-summary .price-line { align-items: baseline; }
.product-summary__note { font-size: var(--fs-caption1); font-weight: 400; color: var(--grey-500); }
.product-summary__specs {
  display: grid; grid-template-columns: calc(64 * var(--u)) 1fr; gap: 8px 12px;
  margin-top: calc(18 * var(--u)); padding-top: calc(24 * var(--u)); padding-bottom: calc(4 * var(--u));
  box-shadow: inset 0 1px 0 var(--grey-200);
  font-size: var(--fs-body3); font-weight: 400; line-height: 1.5;
}
.product-summary__specs dt { color: var(--grey-500); }
.product-summary__specs dd { color: var(--grey-400); }

/* 옵션 선택 (섹션 간격만 기본보다 넓게) */
.product-options { gap: calc(24 * var(--u)); }
.option-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.option-group legend { padding: 0; margin-bottom: calc(12 * var(--u)); }
.option-group__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.option-group__item { position: relative; display: block; }
.option-group__label {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: calc(44 * var(--u));
  border-radius: 4px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--grey-300);
  font-size: var(--fs-body2);
}
.option-group__soldout { font-size: var(--fs-caption2); }
.option-group__item input:checked + .option-group__label { box-shadow: inset 0 0 0 1.5px var(--grey-900); font-weight: 600; }
.option-group__item input:disabled + .option-group__label { background: var(--grey-100); box-shadow: none; color: var(--grey-400); }
.option-group__item input:disabled + .option-group__label .option-group__name { text-decoration: line-through; }
.option-group__item input:focus-visible + .option-group__label { outline: 2px solid var(--purple-500); outline-offset: 2px; }

/* 선택한 옵션 + 총 금액 */
.selected-list { display: flex; flex-direction: column; gap: 8px; }
.selected-option { display: flex; flex-direction: column; gap: calc(12 * var(--u)); padding: calc(16 * var(--u)); border-radius: 4px; background: var(--grey-100); }
.selected-option__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.selected-option__label { font-size: var(--fs-body3); line-height: 1.45; }
.selected-option__remove { margin: -14px -14px -14px 0; color: var(--grey-400); }
.selected-option__foot { display: flex; justify-content: space-between; align-items: center; }
.selected-option__price { font-size: var(--fs-body2); font-weight: 600; }
.selected-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; }
.selected-total__count { font-size: var(--fs-body3); font-weight: 400; color: var(--grey-500); }
.selected-total__price { font-size: var(--fs-title2); font-weight: 600; }

/* 옵션 선택 안내·오류 문구 (토큰에 오류 전용 색이 없어 본문 진한 색을 굵게 사용) */
.product-error { font-size: var(--fs-caption1); font-weight: 600; line-height: 1.5; color: var(--grey-900); }

/* 상세 설명(상품 본문): 이미지는 폭에 맞추고 세로로 이어 붙인다 (시안: 위아래 32) */
.product-detail { padding: calc(32 * var(--u)) 0; font-size: var(--fs-body2); line-height: 1.7; }
.product-detail > * + * { margin-top: calc(12 * var(--u)); }
.product-detail img { display: block; width: 100%; max-width: 450px; height: auto; margin: 0 auto; }
.product-detail figure { margin: 0; }
.product-detail > :not(:has(img)) { padding-inline: calc(20 * var(--u)); }

/* 상세 하단 안내: 배송·교환·반품·A/S 표 + 펼침 안내 (시안 ShippingPolicy) */
.product-notice { padding: calc(28 * var(--u)) calc(20 * var(--u)) calc(32 * var(--u)); background: var(--white); }
.product-notice__title { margin-bottom: calc(16 * var(--u)); font-size: var(--fs-title3); font-weight: 600; }
.product-notice__title span { letter-spacing: -0.16px; }
.product-notice__table { margin-bottom: calc(24 * var(--u)); border-top: 1px solid var(--grey-300); }
.product-notice__row { display: grid; grid-template-columns: calc(96 * var(--u)) minmax(0, 1fr); border-bottom: 1px solid var(--grey-200); }
.product-notice__row:last-child { border-bottom-color: var(--grey-300); }
.product-notice__row dt { display: flex; align-items: center; justify-content: center; padding: calc(14 * var(--u)) calc(12 * var(--u)); background: var(--grey-100); text-align: center; font-size: var(--fs-body3); font-weight: 500; line-height: 1.5; color: var(--grey-900); word-break: keep-all; }
.product-notice__row dd { padding: calc(14 * var(--u)) 0 calc(14 * var(--u)) calc(16 * var(--u)); font-size: var(--fs-body3); font-weight: 400; line-height: 1.6; color: var(--grey-500); word-break: keep-all; }
.product-notice__more { border-bottom: 1px solid var(--grey-200); }
.product-notice__more:first-of-type { border-top: 1px solid var(--grey-200); }
.product-notice__more summary { display: flex; align-items: center; justify-content: space-between; height: calc(56 * var(--u)); font-size: var(--fs-body2); font-weight: 500; color: var(--grey-900); cursor: pointer; list-style: none; }
.product-notice__more summary::-webkit-details-marker { display: none; }
.product-notice__more summary .icon { color: var(--grey-400); transition: transform 160ms ease-out; }
.product-notice__more[open] summary .icon { transform: rotate(180deg); }
.product-notice__body { display: flex; flex-direction: column; gap: calc(24 * var(--u)); padding: 4px 0 calc(24 * var(--u)); }
.product-notice__group h4 { margin-bottom: 6px; font-size: var(--fs-caption1); font-weight: 400; line-height: 1.5; color: var(--grey-400); }
.product-notice__group p { font-size: var(--fs-body3); font-weight: 400; line-height: 1.6; color: var(--grey-500); word-break: keep-all; }
.product-notice__group p + p { margin-top: 6px; }
.product-notice__seller { display: grid; grid-template-columns: calc(96 * var(--u)) minmax(0, 1fr); gap: 8px 16px; padding: 4px 0 calc(24 * var(--u)); font-size: var(--fs-body3); font-weight: 400; line-height: 1.6; }
.product-notice__seller dt { color: var(--grey-400); }
.product-notice__seller dd { color: var(--grey-500); word-break: break-all; }

/* 웹용 요소와 래퍼: 모바일에서는 숨기거나 레이아웃에 영향이 없게 둔다 */
.product-back, .product-specs-web { display: none; }
/* 모바일 순서(시안 MVP v2): 탭(고정) > 사진 > 요약 > 띠 > 옵션 > 띠 > 상세 > 띠 > 배송·교환·반품 */
.product-layout { display: flex; flex-direction: column; }
.product-main, .product-info { display: contents; }
.product-tabs { order: 0; }
.product-hero { order: 1; }
.product-summary { order: 2; }
.product-info > .band { order: 3; }
.product-options { order: 4; }
.product-band--lead { order: 5; }
.product-detail { order: 6; }
.product-band--mid { order: 7; }
.product-notice { order: 8; }
/* 상단 바는 스크롤해도 위에 고정(탭이 그 아래에 붙는다) */
.single-lp_product .top-bar { position: sticky; top: 0; z-index: 6; background: var(--white); }
/* 탭: 상세 영역까지 내려오면 나타난다 (높이 0 자리표시자에 붙인다) */
.product-tabs { position: sticky; top: calc(16 * var(--u) + 44px); z-index: 5; height: 0; }
.product-tabs .tab-bar { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-8px); transition: opacity 160ms ease-out, transform 160ms ease-out; }
.product-tabs.is-shown .tab-bar { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
@media (prefers-reduced-motion: reduce) { .product-tabs .tab-bar { transition: none; } }

/* ===== 웹 (600px 이상) ===== */
@media (min-width: 600px) {
  .page--web main { display: flex; flex-direction: column; gap: 24px; padding: 24px var(--gutter) 80px; }
  .product-back { display: flex; align-items: center; align-self: flex-start; gap: 4px; height: 36px; font-size: 14px; font-weight: 400; color: var(--grey-500); }
  .product-layout { gap: 24px; }
  .product-hero { min-width: 0; height: auto; aspect-ratio: 1 / 1; border-radius: 8px; }
  .product-info { display: flex; flex-direction: column; min-width: 0; gap: 24px; margin-top: 8px; order: 2; }
  .product-info .band { display: none; }
  .product-info > * { order: 0; }
  .product-hero { order: 1; }
  .product-tabs { order: 3; top: 0; height: auto; }
  .product-tabs .tab-bar { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
  .product-band--lead { display: none; }
  .product-detail { order: 4; }
  .product-band--mid { order: 5; }
  .product-notice { order: 6; }

  /* 요약·옵션: 시안(웹) 값 */
  .product-summary { padding: 0; gap: 8px; }
  .product-summary__title { font-size: 22px; }
  .product-summary .price-line { font-size: 26px; }
  .product-summary .price-line__original { font-size: 15px; }
  .product-summary__note { font-size: 14px; }
  .product-summary__specs { grid-template-columns: 72px 1fr; gap: 10px 12px; margin-top: 16px; padding: 20px 0; box-shadow: inset 0 1px 0 var(--grey-200), inset 0 -1px 0 var(--grey-200); }
  .product-summary__specs dd { color: var(--grey-900); font-weight: 500; }
  .product-summary__specs .is-info, .product-summary__specs:not(:has(dt:not(.is-info))) { display: none; }

  .product-options { padding: 0; }
  .selected-total__price { font-size: 24px; }

  /* 상세 설명·안내: 폭에 맞춘다 */
  .product-detail { width: 100%; margin: 0; padding: 32px 0; box-shadow: none; }
  .product-detail > :not(:has(img)) { padding-inline: 0; }
  .product-notice { width: 100%; margin: 0; padding: 28px 0 32px; }
  .product-notice__title { margin-bottom: 16px; font-size: 17px; }
  .product-notice__row { grid-template-columns: 112px minmax(0, 1fr); }
  .product-notice__seller { grid-template-columns: 112px minmax(0, 1fr); }
  .product-notice__row dt { padding: 14px 12px; }
  .product-notice__row dd { padding: 14px 0 14px 16px; }

  .product-specs-web { display: grid; grid-template-columns: 72px 1fr; gap: 10px 12px; padding-top: 24px; box-shadow: inset 0 1px 0 var(--grey-200); font-size: 14px; font-weight: 400; line-height: 1.5; }
  .product-specs-web dt { color: var(--grey-500); }
  .product-specs-web dd { color: var(--grey-600); }
}

/* 웹 두 열(1024 이상): 왼쪽 사진·탭·상세·안내, 오른쪽 400 고정 */
@media (min-width: 1024px) {
  .product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; gap: clamp(32px, 4vw, 56px); }
  .product-main { display: flex; flex-direction: column; min-width: 0; }
  .product-main .product-hero { flex: none; margin-bottom: 40px; }
  .product-info { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; margin-top: 0; }
  .product-tabs { position: sticky; top: 0; z-index: 5; }
  .product-options { padding-top: 24px; box-shadow: inset 0 1px 0 var(--grey-200); }
  .product-band--mid { display: block; }
}
