/* 상품 상세 — 그룹 헤더 + 금액 옵션 목록 */
.product-section {
  padding-block: 16px 40px;
}

.product-page {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  min-width: 0;
}

.product-page__title {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
}

.product-page__desc {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.product-breadcrumb {
  margin-bottom: 8px;
}

.product-breadcrumb__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.product-breadcrumb__icon {
  display: block;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.product-breadcrumb__link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.product-breadcrumb__link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}

/* 그룹 헤더 — 이미지 하단 · 찜 · 판매중 하단 정렬 */
.product-group-head {
  --product-meta-size: 0.75rem;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.product-group-head__visual {
  flex-shrink: 0;
  width: 64px;
  aspect-ratio: 1.586 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  border: 1px solid #ebebeb;
}

.product-group-head__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.product-group-head__visual--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
}

.product-group-head__visual--empty img {
  width: 42%;
  height: auto;
  object-fit: contain;
}

.product-group-head__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.product-group-head__category {
  margin: 0;
  font-size: var(--product-meta-size);
  font-weight: 600;
  line-height: 1.3;
  color: #888;
}

/* 타이틀 — 상품명만 */
.product-group-head__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.product-group-head__title {
  margin: 0;
  min-width: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.product-group-head__meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 8px 10px;
  min-width: 0;
  margin-left: auto;
}

.product-group-head__count {
  margin: 0;
  flex-shrink: 0;
  font-size: var(--product-meta-size);
  font-weight: 600;
  line-height: 1.3;
  color: #888;
  text-align: right;
  white-space: nowrap;
}

/* 옵션 목록 */
.product-option-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.product-option-list__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

@media (max-width: 767px) {
  .product-option-list__head > .product-option-list__cell:not(.product-option-list__cell--face):not(.product-option-list__cell--price) {
    display: none;
  }
}

.product-option-list__cell--price {
  grid-column: 2 / -1;
  text-align: right;
  padding: 0;
  border: none;
  background: transparent;
}

.product-option-list__price-label--desktop {
  display: none;
}

.product-option-list__price-label--mobile {
  font-size: 0.875rem;
  font-weight: 700;
  color: #dc2626;
}

.product-option-list__cell--face {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1a1a1a;
}

.product-option-list__face-label {
  flex-shrink: 0;
}

.product-option-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.product-option-sort__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #888;
  font-size: 0.5625rem;
  line-height: 1;
  cursor: pointer;
}

/* 보이는 크기는 20px 그대로, 누르는 영역만 세로 44px까지 넓힌다 */
.product-option-sort__btn {
  position: relative;
}

.product-option-sort__btn::before {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

.product-option-sort__btn.is-active {
  color: #2563eb;
  border-color: #2563eb;
  background: #eff6ff;
}

.product-option-sort__btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/*
 * 모바일: 액면가 | 판매가격
 *         수량   | 카트 + 즉시구입
 */
.product-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "face  price  price"
    "qty   cart   buy"
    "note  note   note";
  column-gap: 8px;
  row-gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #eee;
  min-width: 0;
  background: #fff;
}

.product-option:last-child {
  border-bottom: none;
}

.product-option.is-soldout {
  opacity: 0.7;
  background: #fafafa;
}

.product-option__face-cell {
  grid-area: face;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.product-option__price {
  grid-area: price;
  text-align: right;
  align-self: center;
}

.product-option__qty {
  grid-area: qty;
  min-width: 0;
}

.product-option__cart-cell {
  grid-area: cart;
  display: flex;
  justify-content: flex-end;
}

.product-option__buy-cell {
  grid-area: buy;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.product-option__face {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
}

.product-option__face-prefix,
.product-option__face-amount {
  min-width: 0;
  max-width: 100%;
}

.product-option__face-prefix {
  flex: 1 0 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}

.product-option__face-prefix[hidden] {
  display: none;
}

.product-option__face-amount {
  white-space: nowrap;
}

.product-option__price-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.3;
  white-space: nowrap;
}

.product-option__cart {
  flex-shrink: 0;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #333;
}

.product-option__cart:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.product-option__buy {
  min-width: 88px;
  min-height: 40px;
  padding-inline: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
}

/* 수량 */
.qty-control {
  --qty-inset: 2px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.qty-control__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 40px;
  padding: 0;
  border: none;
  background: #f5f5f5;
  color: #333;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.qty-control__btn:disabled,
.qty-control__btn.is-at-max {
  opacity: 0.45;
  cursor: not-allowed;
}

.qty-control__input:read-only {
  color: #4b5563;
  background: #f3f4f6;
}

.qty-control__btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  z-index: 1;
}

.qty-control__input {
  width: 2.25rem;
  min-width: 0;
  min-height: 40px;
  padding: 0 var(--qty-inset);
  border: none;
  border-inline: 1px solid #eee;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  background: #fff;
  -moz-appearance: textfield;
}

.qty-control__input::-webkit-outer-spin-button,
.qty-control__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-control__input:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  z-index: 1;
}

.product-option__qty-note {
  grid-area: note;
  margin: 0;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.product-option__qty-note[hidden] {
  display: none;
}

.product-detail__guide {
  margin: 16px 0 0;
  padding: 12px 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #555;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.product-notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #444;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.product-notice__title {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a1a;
}

.product-notice__list {
  margin: 0;
  padding-left: 1.25em;
  list-style: disc;
}

.product-notice__list li + li {
  margin-top: 8px;
}

.product-proxy-notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #0c4a6e;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.product-proxy-notice__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  color: #0369a1;
}

.product-proxy-notice__icon {
  flex-shrink: 0;
  color: #0284c7;
}

.product-proxy-notice__list {
  margin: 0;
  padding-left: 1.25em;
  list-style: disc;
}

.product-proxy-notice__list li + li {
  margin-top: 8px;
}

.product-proxy-notice strong {
  font-weight: 700;
  color: #075985;
}

@media (min-width: 768px) {
  .product-section {
    padding-block: 32px 64px;
  }

  .product-breadcrumb__link {
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .product-group-head {
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .product-group-head {
    --product-meta-size: 0.8125rem;
  }

  .product-group-head__visual {
    width: 120px;
    border-radius: 10px;
  }

  .product-group-head__title {
    font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  }

  .product-option-list {
    border-radius: 12px;
    border-color: #e5e5e5;
  }

  .product-option-list__head > .product-option-list__cell:not(.product-option-list__cell--face) {
    display: flex;
  }

  .product-option-list__cell--price {
    grid-column: auto;
    text-align: center;
    color: inherit;
  }

  .product-option-list__price-label--mobile {
    display: none;
  }

  .product-option-list__price-label--desktop {
    display: inline;
  }

  .product-option-list__head > .product-option-list__cell--face {
    flex-wrap: nowrap;
    justify-content: center;
    font-size: inherit;
    font-weight: inherit;
  }

    /* PC: 칸마다 실선 (표 형태) / 모바일은 행 구분만 유지 */
    /* 왼쪽 문구가 없으면 액면·카트 균형. 문구가 하나라도 있으면 액면을 넓힌다. */
    .product-option-list__head {
    display: grid;
    /* 액면가 | 판매가격 | 수량 | 카트 | 즉시구입 */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(112px, 1fr) minmax(132px, 0.9fr) minmax(96px, 0.75fr);
    gap: 0;
    padding: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.875rem;
    font-weight: 800;
    color: #1a1a1a;
    text-align: center;
  }

  .product-option-list__head > * {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 12px 10px;
    border-right: 1px solid #e5e5e5;
  }

  .product-option-list__head > *:last-child {
    border-right: none;
  }

  .product-option-list__head > .product-option-list__cell:nth-child(4) {
    white-space: nowrap;
  }

  .product-option-list.is-face-wide .product-option-list__head,
  .product-option-list.is-face-wide .product-option {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) minmax(112px, 1fr) 72px minmax(96px, 0.75fr);
  }

  .product-option-list.is-face-wide .product-option-list__head > .product-option-list__cell:nth-child(4) {
    white-space: normal;
    padding-inline: 4px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .product-option {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(112px, 1fr) minmax(132px, 0.9fr) minmax(96px, 0.75fr);
    grid-template-areas:
      "face price qty cart buy"
      "note note note note note";
    gap: 0;
    align-items: stretch;
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
  }

  .product-option:last-child {
    border-bottom: none;
  }

  .product-option-list__body .product-option:nth-child(even) {
    background: #fcfcfc;
  }

  .product-option > * {
    min-width: 0;
    padding: 12px 10px;
    border-right: 1px solid #e5e5e5;
  }

  .product-option > *:last-child,
  .product-option__buy-cell,
  .product-option__qty-note {
    border-right: none;
  }

  .product-option__qty-note {
    border-top: 1px solid #fde68a;
  }

  /*
   * 액면가·판매가격:
   * 칸 안에서는 가운데로 모으고, 숫자 블록만 오른쪽 정렬
   */
  .product-option__face-cell {
    justify-content: center;
    text-align: center;
  }

  .product-option__face {
    justify-content: flex-end;
    align-items: baseline;
    min-width: 0;
    max-width: 100%;
    font-size: 1rem;
  }

  .product-option__face-prefix {
    flex: 0 1 auto;
    max-width: 100%;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    white-space: normal;
    overflow: visible;
    overflow-wrap: break-word;
    word-break: keep-all;
  }

  .product-option__face-amount {
    flex: 0 0 auto;
    min-width: 5.5em;
    font-size: 1rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .product-option__price {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .product-option__price-value {
    min-width: 6em;
    text-align: right;
    font-size: 1.0625rem;
    font-variant-numeric: tabular-nums;
  }

  .product-option__qty {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .product-option__cart-cell {
    align-items: center;
    justify-content: center;
  }

  .product-option__buy-cell {
    align-items: center;
    justify-content: center;
  }

  .product-option__cart {
    width: 44px;
    min-height: 44px;
  }

  .product-option__buy {
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: 14px;
    border-radius: 999px;
    font-size: 0.875rem;
  }

  .qty-control {
    min-height: 44px;
    width: 100%;
    max-width: 148px;
  }

  .qty-control__btn {
    width: 40px;
    min-height: 44px;
    flex-shrink: 0;
  }

  .qty-control__input {
    flex: 1;
    width: auto;
    min-width: 2.5rem;
    min-height: 44px;
  }

  .product-detail__guide {
    margin-top: 20px;
    padding: 12px 16px;
    font-size: 0.9375rem;
  }

  .product-notice {
    margin-bottom: 20px;
    padding: 16px 18px;
    font-size: 0.9375rem;
  }

  .product-notice__title {
    font-size: 1rem;
  }

  .product-proxy-notice {
    margin-bottom: 20px;
    padding: 16px 18px;
    font-size: 0.9375rem;
  }

  .product-proxy-notice__title {
    font-size: 1rem;
  }
}

.product-review-jump {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #94a3b8;
  text-decoration: none;
}

.product-review-jump__icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.product-review-jump:hover {
  color: #d97706;
}

.product-review-jump:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.product-reviews {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  scroll-margin-top: calc(72px + env(safe-area-inset-top, 0px));
}

.product-reviews__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.product-reviews__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

.product-reviews__summary {
  margin: 0 0 0 auto;
  color: #4b5563;
  white-space: nowrap;
}

.product-reviews__empty {
  margin: 0;
  color: #4b5563;
}

.product-reviews__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-reviews__item {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.product-reviews__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.product-reviews__stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  color: #d97706;
}

.product-reviews__star {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.product-reviews__author,
.product-reviews__date {
  color: #6b7280;
  font-size: 0.875rem;
}

.product-reviews__body {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
}

.product-reviews__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.product-reviews__pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 44px;
  padding-inline: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.product-reviews__pager-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.product-reviews__pager-num {
  min-width: 2rem;
  text-align: center;
  font-weight: 700;
}
