/* 商品详情：对齐 Figma Make ProductDetail（与首页 SHIBAKEN 系配色一致） */

.page-product-sbk {
  --pds-bg: #faf8f5;
  --pds-ink: #2c231a;
  --pds-ink-soft: #4a3f35;
  --pds-muted: #8b7355;
  --pds-line: #d4c4b0;
  --pds-cream: #e8dfd6;
  --pds-card: #f3ede4;
  --pds-white: #ffffff;
  margin: 0;
  min-height: 100vh;
  background: var(--pds-bg);
  color: var(--pds-ink-soft);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
}

.page-product-sbk a {
  color: inherit;
  text-decoration: none;
}

.pds-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* 主区（顶栏为全站 sbk-nav，fixed，预留上内边距） */
.pds.sbk-site-chrome .pds-main {
  flex: 1;
}

.pds-main {
  padding-top: 6rem;
  padding-bottom: 5rem;
}

.pds-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .pds-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.pds-stage {
  position: relative;
  aspect-ratio: 1;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 2px;
  background: var(--pds-cream);
}

.pds-stage__badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: rgba(44, 35, 26, 0.75);
  color: var(--pds-bg);
  border-radius: 2px;
}

.pds-stage :is(img, video) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pds-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .pds-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

.pds-thumb {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  background: var(--pds-cream);
  transition: border-color 0.2s, transform 0.15s;
}

.pds-thumb:hover {
  transform: scale(1.02);
}

.pds-thumb[aria-current="true"] {
  border-color: var(--pds-ink);
}

.pds-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pds-thumb--video span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pds-bg);
  background: var(--pds-ink);
}

/* 右侧购买区 */
.pds-eyebrow {
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  color: var(--pds-muted);
  margin: 0 0 0.75rem;
}

.pds-title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--pds-ink);
}

.pds-price {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  font-weight: 600;
  color: var(--pds-ink);
}

.pds-price--has-range {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.pds-desc {
  margin: 0 0 2rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--pds-ink-soft);
}

.pds-flavor-box {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--pds-card);
  border-radius: 2px;
}

.pds-flavor-box__label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pds-ink);
}

.pds-flavor-box__text {
  font-size: 1rem;
  color: var(--pds-ink-soft);
}

.pds-field {
  margin-bottom: 1.5rem;
}

.pds-field__label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pds-ink);
}

/* 规格 pill：按数量自适应列数（2 个不会留空第三格；多 SKU 可加密） */
.pds-pills {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.25rem), 1fr));
}

/* 研磨等需要固定两列排版（如 4 个选项 2×2）时保留 */
.pds-pills--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 选项较多时略缩小最小格宽，仍用网格换行，避免单格过宽 */
.pds-pills--sku {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.25rem), 1fr));
}

/* 扁平 SKU（仅「选择规格」一行、无重量×研磨矩阵）：固定双列多行，长文案可换行 */
.pds-pills--flat-sku {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pds-pills--flat-sku .pds-pill {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

.pds-pill {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  border: 2px solid var(--pds-line);
  border-radius: 2px;
  background: var(--pds-white);
  color: var(--pds-ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.pds-pill:hover {
  border-color: var(--pds-muted);
}

.pds-pill--active {
  border-color: var(--pds-ink);
  background: var(--pds-ink);
  color: var(--pds-bg);
}

.pds-pill--disabled,
.pds-pill:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-style: dashed;
  color: var(--pds-muted);
  background: rgba(243, 243, 243, 0.65);
  filter: grayscale(0.85) blur(0.35px);
  box-shadow: none;
}

.pds-pill--disabled.pds-pill--active,
.pds-pill:disabled.pds-pill--active {
  border-color: var(--pds-line);
  background: rgba(243, 243, 243, 0.65);
  color: var(--pds-muted);
  filter: grayscale(0.85) blur(0.35px);
}

/* 矩阵模式：当前重量下不可售组合（研磨/重量占位）——比整行 disabled 更“虚”，但仍占位提示不可选 */
.pds-pill--muted,
.pds-pill--muted:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  border-style: dashed;
  color: var(--pds-muted);
  background: rgba(243, 243, 243, 0.55);
  filter: grayscale(0.9) blur(0.55px);
  box-shadow: none;
}

.pds-qty-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pds-qty {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--pds-line);
  border-radius: 2px;
  overflow: hidden;
}

.pds-qty button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--pds-ink);
  cursor: pointer;
  transition: background 0.2s;
}

.pds-qty button:hover {
  background: var(--pds-card);
}

.pds-qty input {
  width: 3.5rem;
  border: none;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--pds-ink);
  background: transparent;
  appearance: textfield;
  -moz-appearance: textfield;
}

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

.pds-qty input:focus {
  outline: none;
}

.pds-stock-hint {
  font-size: 0.875rem;
  color: var(--pds-muted);
}

.pds-buy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.pds-cta-wrap {
  display: block;
  width: 100%;
  align-self: stretch;
}

.pds-cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  align-self: stretch;
}

.pds-cta {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 2px;
  background: var(--pds-ink);
  color: var(--pds-bg);
  transition: background 0.2s, transform 0.15s;
  border: 2px solid var(--pds-ink);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.pds-cta:hover {
  background: #4a3f35;
  transform: scale(1.01);
}

.pds-cta--site {
  background: var(--pds-ink);
  color: var(--pds-bg);
}

.pds-cta--taobao {
  background: transparent;
  color: var(--pds-ink);
  border-color: var(--pds-line);
}

.pds-cta--taobao:hover {
  background: var(--pds-card);
  border-color: var(--pds-muted);
}

.page-product-sbk a.pds-cta,
.page-product-sbk a.pds-cta:hover {
  color: inherit;
}

.page-product-sbk a.pds-cta--site,
.page-product-sbk a.pds-cta--site:hover {
  color: var(--pds-bg);
}

.pds-ship-note {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--pds-muted);
}

.pds-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--pds-muted);
  opacity: 0.9;
}

/* 白色区块 */
.pds-white {
  background: var(--pds-white);
  padding: 5rem 0;
}

.pds-white-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

@media (min-width: 1024px) {
  .pds-white-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.pds-section-title {
  margin: 0 0 2rem;
  font-size: 2rem;
  font-weight: 600;
  color: var(--pds-ink);
}

.pds-spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pds-spec {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--pds-bg);
  border-radius: 2px;
}

.pds-spec__icon {
  flex-shrink: 0;
  padding: 0.5rem;
  background: var(--pds-ink);
  border-radius: 2px;
  color: var(--pds-bg);
  display: grid;
  place-items: center;
}

.pds-spec__label {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--pds-muted);
}

.pds-spec__value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--pds-ink);
}

.pds-brew-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pds-brew-card {
  padding: 1.5rem;
  background: var(--pds-bg);
  border-radius: 2px;
}

.pds-brew-card--dark {
  background: var(--pds-ink);
}

.pds-brew-card__title {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pds-ink);
}

.pds-brew-card--dark .pds-brew-card__title {
  color: var(--pds-bg);
}

.pds-brew-card__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--pds-ink-soft);
}

.pds-brew-card__text--muted {
  color: var(--pds-line);
}

.pds-rich {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pds-line);
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--pds-ink-soft);
}

/* 详情富文本（caption）内外链图：铺满内容区宽度，避免淘宝导出小图/固定 width 缩在左侧 */
.pds-rich :where(img),
.pds-rich-img {
  box-sizing: border-box;
  display: block !important;
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
}

.pds-rich :where(video) {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
}

.pds-rich :where(iframe) {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  width: 100%;
}

.pds-rich :where(figure) {
  margin: 1rem 0;
  max-width: 100%;
}

.pds-rich :where(p) {
  margin: 0.75rem 0;
}

/* 富文本长图拼接：编辑器常把每张图包在 <p>，这里强制清零间距避免断层。 */
.pds-rich .tb-detail-gallery {
  margin: 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
}

.pds-rich .tb-detail-gallery p {
  margin: 0 !important;
  padding: 0;
  line-height: 0;
}

.pds-rich .tb-detail-gallery p br {
  display: none;
}

.pds-rich .tb-detail-gallery img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0;
  border: 0;
}

