@layer components {

.product-page {
  display: grid;
  gap: 22px;
}
.product-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13px;
}
.product-breadcrumb a:hover { color: var(--primary); }
.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 390px;
  gap: 22px;
  align-items: stretch;
}
.product-left-col {
  display: grid;
  gap: 22px;
  grid-template-rows: auto 1fr;
  min-width: 0;
}
.product-overview {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.product-overview-inner {
  padding: 26px;
}
.product-meta {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.product-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.product-title {
  font-size: clamp(19px, 2.4vw, 27px);   /* 기존의 약 2/3 */
  line-height: 1.06;
  letter-spacing: 0;
  font-weight: 900;
}
.product-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.highlight-item {
  min-height: 98px;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.highlight-item .label {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}
.highlight-item .value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.highlight-item .sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.product-summary {
  display: grid;
  gap: 10px;
}
.summary-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(208,213,221,.6);
}
.summary-row:last-child { border-bottom: 0; }
.summary-label {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.summary-value {
  color: var(--text);
  min-width: 0;
  font-weight: 600;
}
.purchase-panel {
  position: sticky;
  top: calc(var(--header-total, 144px) + 20px);
  align-self: start;
}
.purchase-card {
  border-radius: 20px;
  background: #fff;
  /* .card 의 overflow:hidden(base.html)은 카드 모서리까지 꽉 차는 요소(.card-header 등)를
     둥근 모서리에 맞춰 깎기 위한 규칙이다. 구매 카드는 card-header 없이 .card-body 하나뿐이고
     내부 요소가 전부 padding 안쪽에 있어 깎을 것이 없다 — 전액환불 툴팁만 잘리므로 해제한다. */
  overflow: visible;
}
.price-block {
  padding: 22px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.price-block .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.price-main {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.price-main strong {
  font-size: clamp(19px, 2.4vw, 27px);   /* product-title와 동일 크기 */
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--text);
}
.price-main span {
  color: var(--text-2);
  font-weight: 700;
}
.option-list {
  display: grid;
  gap: 10px;
}
.option-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.option-card:hover {
  border-color: rgba(91,108,255,.45);
  box-shadow: 0 2px 8px rgba(16,24,40,.05);
}
.option-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option-card.is-disabled {
  opacity: .52;
  cursor: not-allowed;
  background: var(--bg-soft);
}
@keyframes refund-glow {
  0%, 40%, 100% {
    box-shadow: none;
    border-color: var(--line);
  }
  15% {
    box-shadow: 0 0 0 3px rgba(59,130,246,.14);
    border-color: rgba(59,130,246,.6);
  }
  30% {
    box-shadow: 0 0 0 1px rgba(59,130,246,.06);
    border-color: rgba(59,130,246,.3);
  }
}
.option-card.has-refund-glow:not(.is-selected):not(.is-disabled) {
  animation: refund-glow 3s ease-in-out infinite;
}
.option-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.option-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.option-price {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.option-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.option-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.option-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.option-pill-refund {
  position: relative;
  cursor: default;
}
.ui-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #101828;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
}
.ui-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #101828;
}
.option-pill-refund:hover .ui-tooltip,
.qty-hint:hover .ui-tooltip {
  display: block;
}
.purchase-summary {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.purchase-summary .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
  font-size: 13px;
}
.purchase-summary .row strong {
  color: var(--text);
  font-size: 14px;
}
.purchase-summary .row.total strong {
  color: var(--text);
  font-size: 22px;
  letter-spacing: -.03em;
}
.safe-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.safe-box svg {
  flex-shrink: 0;
  color: var(--success);
  margin-top: 1px;
}
.safe-box strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -.02em;
}
.safe-box p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.6;
}
.detail-card {
  border-radius: 20px;
}
.detail-card .card-body {
  display: grid;
  gap: 16px;
}
.status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.3);
  background: rgba(148,163,184,.06);
}
.status-banner.is-soldout {
  border-color: rgba(239,68,68,.25);
  background: rgba(239,68,68,.05);
}
.status-banner.is-paused {
  border-color: rgba(234,179,8,.3);
  background: rgba(234,179,8,.06);
}
.status-banner .icon {
  display: flex;
  align-items: center;
  line-height: 1;
}
.status-banner .title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.02em;
}
.status-banner .sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}
.badge-ad {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid rgba(180,83,9,.25);
}
.stock-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}
.stock-alert svg {
  flex-shrink: 0;
}
.notice-list {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.notice-list .notice-critical {
  color: var(--danger);
  font-weight: 800;
}
.option-guide {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty-btn {
  min-width: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}
.qty-input {
  width: 52px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 0;
  font-size: 15px;
  font-weight: 700;
}
.qty-hint {
  position: relative;
  cursor: default;
}
.unavailable-note {
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 700;
}
.seller-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.seller-name-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.seller-name {
  font-weight: 700;
  letter-spacing: -.02em;
  transition: color .15s ease;
}
.seller-name-btn:hover .seller-name {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.seller-rate {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(59,130,246,.1);
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
/* 거래 10건 이하 — 성공률 대신 '신규 판매자'. 실패처럼 보이지 않게 장식색(보라)으로 둔다. */
.seller-rate.is-new {
  background: rgba(124,92,255,.1);
  color: var(--accent);
}
.follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  /* 버튼 색은 인디고 하나 — 하늘색(#60a5fa)은 흰 바탕 대비가 2.5:1 이었다 */
  border: 1px solid rgba(72,87,214,.16);
  color: var(--primary-text);
  background: var(--primary-soft);
  cursor: pointer;
  transition: .15s;
}
.follow-chip:hover {
  background: rgba(72,87,214,.16);
}
.follow-chip.is-following {
  border-color: var(--line);
  color: var(--text-2);
  background: var(--bg-soft);
  cursor: default;
}
.description-body {
  color: var(--text-2);
  line-height: 1.9;
  font-size: 15px;
}
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .product-hero {
    grid-template-columns: 1fr;
  }
  .purchase-panel {
    position: static;
  }
}
@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
  /* 좁은 화면에서는 페이지 좌우 여백이 툴팁이 삐져나가는 폭보다 작다.
     중앙 기준으로 두면 화면 밖으로 나가 가로 스크롤이 생기므로 왼쪽 기준으로 붙인다. */
  .option-pill-refund .ui-tooltip {
    left: 0;
    transform: none;
  }
  .option-pill-refund .ui-tooltip::after {
    left: 24px;
    transform: none;
  }
  .product-overview-inner {
    padding: 20px;
  }
  .product-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .highlight-item {
    min-height: auto;
    padding: 10px 8px;
    text-align: center;
  }
  .highlight-item .label {
    font-size: 12px;
    line-height: 1.35;
    word-break: keep-all;
    white-space: nowrap;
  }
  .highlight-item .value {
    margin-top: 4px;
    font-size: 15px;
  }
  .summary-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .inline-actions {
    width: 100%;
  }
  .inline-actions .btn {
    flex: 1 1 100%;
  }
  .purchase-card .inline-actions { display: none; }
  .purchase-card .card-body {
    padding: 18px;
  }
  .seller-name-btn { min-height: 44px; padding-block: 8px; }
}
@media (max-width: 360px) {
  .highlight-item .value { font-size: 14px; }
}
button.follow-chip { min-height: 44px; }

.mobile-buy-bar {
  display: none;
}
@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
  .mobile-buy-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--line);
    padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-shadow: 0 -8px 24px rgba(16,24,40,.10);
  }
  /* 바가 화면 맨 아래에 떠 있으므로 끝까지 내렸을 때 푸터 마지막 줄이 바 밑에 깔리지 않게, 바 높이(77px)만큼
     푸터 아래를 띄운다. 본문에 여백을 두면 그 뒤에 오는 푸터가 그대로 가려진다(2026-10-07). */
  body:has(.mobile-buy-bar) footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .mobile-buy-bar-price {
    flex: 1;
    min-width: 0;
  }
  .mobile-buy-bar-price .label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0;
  }
  .mobile-buy-bar-price .value {
    font-size: 22px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0;
    line-height: 1.1;
  }
}
/* 가로로 든 휴대폰: 하단 바 위아래 여백을 줄여 내용이 보이는 높이를 늘린다(재점검 D2). 버튼 높이는 그대로. */
@media (max-height: 500px) and (pointer: coarse) {
  .mobile-buy-bar { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .mobile-buy-bar-price { display: flex; align-items: baseline; gap: 8px; }
  .mobile-buy-bar-price .value { font-size: 18px; }
}

.ui-tooltip.touch-visible {
  display: block;
}


/* 공유 버튼(2026-11-08 U16) — 배지 줄 오른쪽 끝. 배지보다 높아 줄 높이를 늘리지 않게 위아래 여백을 당긴다 */
.product-share-btn { margin-left: auto; margin-block: -6px; }

}
