/**
 * 商品詳情頁專用樣式（不影響首頁／總覽頁）
 */
.wx-product-detail {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px 64px;
  box-sizing: border-box;
}

.wx-product-detail__crumb {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wx-product-detail__crumb a {
  color: var(--button-color, var(--primary-color, #778ca3));
  font-weight: 700;
  text-decoration: none;
}

.wx-product-detail__crumb a:hover {
  text-decoration: underline;
}

.wx-product-detail__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  grid-template-rows: auto 1fr;
  gap: 28px 64px;
  align-items: start;
  background: transparent;
  border-radius: 0;
  padding: 8px 0 36px;
  box-shadow: none;
  border: none;
  margin-bottom: 12px;
}

.wx-product-detail__media,
.wx-product-detail__gallery-shell {
  display: contents;
}

.wx-product-detail__gallery,
.wx-product-detail__media > .wx-product-detail__img,
.wx-product-detail__media > .wx-product-detail__gallery-video,
.wx-product-detail__media > .wx-product-detail__gallery-yt,
.wx-product-detail__img-placeholder {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}

.wx-product-detail__gallery-thumbs-row {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
}

.wx-product-detail__gallery-thumbs {
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.wx-product-detail__gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.wx-product-detail__gallery-thumbs-row:not(.has-overflow) .wx-product-detail__gallery-thumbs {
  justify-content: center;
}

.wx-product-detail__gallery-thumbs-row.has-overflow-end::after,
.wx-product-detail__gallery-thumbs-row.has-overflow-start::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  z-index: 1;
}

.wx-product-detail__gallery-thumbs-row.has-overflow-end::after {
  right: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
}

.wx-product-detail__gallery-thumbs-row.has-overflow-start::before {
  left: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0), #fff);
}

.wx-product-detail__gallery-thumb {
  flex: 0 0 68px;
  width: 68px;
  min-width: 68px;
  height: 68px;
  aspect-ratio: 1;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wx-product-detail__gallery-thumb:hover {
  border-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
}

.wx-product-detail__gallery-thumb.is-active {
  border-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
  box-shadow: 0 0 0 1px var(--primary-color, var(--pos-btn-bg, #778ca3));
}

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

.wx-product-detail__gallery-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  color: #64748b;
  background: #eef2f7;
}

.wx-product-detail__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  margin: 0;
  transition: opacity 0.2s ease;
}

.wx-product-detail__media > .wx-product-detail__img,
.wx-product-detail__media > .wx-product-detail__gallery-video,
.wx-product-detail__media > .wx-product-detail__gallery-yt,
.wx-product-detail__img-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: none;
  background: var(--wx-cover-stage-bg, #ffffff);
  border-radius: 10px;
  box-sizing: border-box;
}

.wx-product-detail__img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 40px;
}

.wx-product-detail__gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wx-cover-stage-bg, #ffffff);
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.wx-product-detail__gallery-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.wx-product-detail__gallery-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-product-detail__gallery-slide[hidden] {
  display: none !important;
}

.wx-product-detail__gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.wx-product-detail__gallery-nav--prev { left: 0; }
.wx-product-detail__gallery-nav--next { right: 0; }

.wx-product-detail__gallery-nav:hover {
  background: #fff;
  border-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
  color: #4a5560;
}

.wx-product-detail__gallery-nav.hidden {
  display: none !important;
}

.wx-product-detail__gallery-thumbs-row.hidden {
  display: none;
}

.wx-product-detail__gallery-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0f172a;
  border-radius: 0;
}

.wx-product-detail__gallery-yt {
  position: relative;
  width: 100%;
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border-radius: 0;
  box-sizing: border-box;
}

.wx-product-detail__gallery-yt iframe {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  max-height: 100%;
  border: 0;
}

.wx-product-detail__summary {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
  min-height: 0;
}

.wx-product-detail__badge.preorder,
.wx-product-detail__badge.instock {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 6px 12px;
  border-radius: 6px;
}

.wx-product-detail__badge.preorder {
  color: var(--tag-custom-color, #AD6B4A);
  background:
    linear-gradient(
      color-mix(in srgb, var(--tag-custom-color, #AD6B4A) 16%, transparent),
      color-mix(in srgb, var(--tag-custom-color, #AD6B4A) 16%, transparent)
    ),
    rgba(255, 255, 255, 0.88);
  border: none;
  box-shadow: none;
}

.wx-product-detail__badge.instock {
  color: var(--instock-tag-color, #728B7E);
  background:
    linear-gradient(
      color-mix(in srgb, var(--instock-tag-color, #728B7E) 16%, transparent),
      color-mix(in srgb, var(--instock-tag-color, #728B7E) 16%, transparent)
    ),
    rgba(255, 255, 255, 0.88);
  border: none;
  box-shadow: none;
}

.wx-product-detail__title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.45;
}

.wx-product-detail__platforms {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 8px;
}

.wx-product-detail__platforms-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

.wx-product-detail__platforms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wx-product-detail__platforms .platform-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: #ffffff;
  border: none;
}

.wx-product-detail__platforms .platform-badge.ps-blue,
.wx-product-detail__platforms .platform-badge.ps5,
.wx-product-detail__platforms .platform-badge.ps4,
.wx-product-detail__platforms .platform-badge.tag-blue,
.wx-product-detail__platforms .platform-badge--ps5 {
  background: #00439c;
}

.wx-product-detail__platforms .platform-badge.ns-red,
.wx-product-detail__platforms .platform-badge.ns2,
.wx-product-detail__platforms .platform-badge.ns,
.wx-product-detail__platforms .platform-badge.tag-red,
.wx-product-detail__platforms .platform-badge--switch {
  background: #e60012;
}

.wx-product-detail__platforms .platform-badge.tag-green {
  background: #16a34a;
}

.wx-product-detail__platforms .platform-badge.tag-gray,
.wx-product-detail__platforms .platform-badge.default-gray {
  background: #64748b;
}

.wx-product-detail__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-top: 0;
}

.wx-product-detail__release-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 4px 0 0;
  padding: 12px 0;
  border-top: 1px solid #e2e9f0;
  border-bottom: 1px solid #e2e9f0;
  min-width: 0;
}

.wx-product-detail__release-band--note-only .wx-product-detail__preorder-note {
  margin-left: 0;
}

.wx-product-detail__preorder-note {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 22em);
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--tag-custom-color, #AD6B4A);
  background:
    linear-gradient(
      color-mix(in srgb, var(--tag-custom-color, #AD6B4A) 16%, transparent),
      color-mix(in srgb, var(--tag-custom-color, #AD6B4A) 16%, transparent)
    ),
    rgba(255, 255, 255, 0.88);
  border: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.wx-product-detail__facts {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 8px 14px;
  margin: 4px 0 0;
  padding: 14px 0;
  border-top: 1px solid #e2e9f0;
  border-bottom: 1px solid #e2e9f0;
}

.wx-product-detail__facts--inline {
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 1 auto;
  grid-template-columns: auto auto;
  justify-content: start;
}

.wx-product-detail__facts--follow {
  margin-top: 0;
  border-top: 0;
}

.wx-product-detail__facts dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8a8f8b;
}

.wx-product-detail__facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #3f4a52;
  line-height: 1.5;
}

.wx-product-detail__offer {
  padding: 16px 0 4px;
}

.wx-product-detail__title + .wx-product-detail__offer,
.wx-product-detail__platforms + .wx-product-detail__offer {
  margin-top: 8px;
  border-top: 1px solid #e2e9f0;
}

.wx-product-detail__price-kicker {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8a8f8b;
}

.wx-product-detail__price {
  font-size: 28px;
  font-weight: 800;
  color: #d1434f;
  line-height: 1.2;
}

.wx-product-detail__price.is-inquiry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--pos-highlight, var(--primary-color, #587493));
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--pos-highlight, var(--primary-color, #587493));
  letter-spacing: 0.06em;
}

.wx-product-detail__deposit-badge {
  font-size: 13px;
  font-weight: 700;
  color: #e67e22;
  background: #fdf6e2;
  padding: 4px 8px;
  border-radius: 6px;
}

.wx-product-detail__release {
  margin: 0 0 4px;
  font-size: 13px;
  color: #64748b;
}

.wx-product-detail__cta-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.wx-product-detail__ship-perk {
  margin: 12px 0 0;
}

.wx-product-detail__ship-perk-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.wx-ship-perk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5b6b7a;
  box-sizing: border-box;
  white-space: nowrap;
}

.wx-product-detail__ship-perk-btn:hover .wx-ship-perk-chip {
  border-color: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 35%, #dee5ed);
  color: #4a5560;
}

.wx-ship-perk-chip--home {
  color: #d1434f;
  border-color: color-mix(in srgb, #d1434f 22%, #fff);
  background: color-mix(in srgb, #d1434f 8%, #fff);
}

.wx-pay-marks {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wx-pay-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
}

.wx-pay-mark--img {
  width: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.wx-pay-mark--visa { height: 13px; }
.wx-pay-mark--mc { height: 18px; }
.wx-pay-mark--jcb { height: 18px; }
.wx-pay-mark--union { height: 18px; }
.wx-pay-mark--linepay { height: 16px; }
.wx-pay-mark--cards { height: 20px; }
.wx-pay-mark--711 {
  height: 22px;
  width: 22px;
}

.wx-pay-mark--atm {
  height: 18px;
  min-width: 30px;
  padding: 0 5px;
  border-radius: 3px;
  background: #e8edf3;
  color: #475569;
  border: 1px solid #d5dde6;
  font-size: 9px;
  font-weight: 800;
}

.wx-pay-mark--store {
  height: 22px;
  min-width: 38px;
  padding: 0 8px;
  border-radius: 4px;
  background: #ffffff;
  color: #5b6b7a;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.wx-ship-perk-chip--711 .wx-pay-mark--711 {
  height: 16px;
  width: 16px;
}

.wx-ship-pay__tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.wx-ship-info__pay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px !important;
  font-size: 13px !important;
  font-weight: 700;
  color: #334155;
}

.wx-ship-info__pay > span {
  flex: 0 1 auto;
}

.wx-ship-info__marks {
  margin: 0 0 10px !important;
}

.wx-product-detail__cta-row .wx-product-detail__cta {
  flex: 1 1 0;
  margin-top: 0;
  width: auto;
  max-width: none;
}

.wx-product-detail__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  height: 46px;
  padding: 0 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  transform: none;
  filter: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wx-product-detail__cta:hover,
.wx-product-detail__cta:active,
.wx-product-detail__cta:focus {
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
  opacity: 1;
}

.wx-product-detail__cta--cart {
  background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 12%, #fff);
  border-color: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 48%, #fff);
  color: var(--primary-color, var(--pos-btn-bg, #778ca3));
}

.wx-product-detail__cta--cart:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 22%, #fff);
  border-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
  color: var(--primary-color, var(--pos-btn-bg, #778ca3));
}

.wx-product-detail__cta--buy {
  background: var(--primary-color, var(--pos-btn-bg, #778ca3));
  border-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
  color: var(--btn-text-color, #fff);
}

.wx-product-detail__cta--buy:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 82%, #1e293b);
  border-color: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 82%, #1e293b);
  color: var(--btn-text-color, #fff);
}

.wx-product-detail__cta--sold-out {
  flex: 1 1 100%;
  background: #d0dae3;
  border-color: #d0dae3;
  color: #6b7280;
}

.wx-product-detail__body,
.wx-product-detail__video {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 24px;
  box-shadow: none;
  border: none;
  border-top: 1px solid #dee5ed;
  overflow: visible;
}

.wx-product-detail__video {
  padding: 24px 0;
}

.wx-product-detail__tabs {
  padding: 0;
}

.wx-product-detail__tablist {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  background: transparent;
  border-bottom: 1px solid #dee5ed;
}

.wx-product-detail__tab {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 14px 22px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transform: none !important;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.wx-product-detail__tab:hover,
.wx-product-detail__tab:hover:not(:disabled) {
  color: #6b7280;
  background: transparent;
  transform: none !important;
}

.wx-product-detail__tab.is-active,
.wx-product-detail__tab[aria-selected="true"] {
  color: #3f4a52;
  background: transparent;
  font-weight: 800;
  border-bottom-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
}

.wx-product-detail__tabpanels {
  padding: 24px 4px 8px;
  background: transparent;
}

.wx-product-detail__panel-title {
  margin: 0 0 18px;
  padding-left: 12px;
  border-left: 3px solid var(--primary-color, var(--pos-btn-bg, #778ca3));
  font-size: 16px;
  font-weight: 800;
  color: #3f4a52;
  line-height: 1.35;
}

.wx-product-detail__empty {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
}

.wx-spec-list {
  margin: 0;
}

.wx-spec-list__row {
  display: grid;
  grid-template-columns: minmax(7.5em, 30%) 1fr;
  gap: 10px 16px;
  padding: 12px 0;
  border-bottom: 1px solid #ebf0f5;
}

.wx-spec-list__row:last-child {
  border-bottom: 0;
}

.wx-spec-list__row dt {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
}

.wx-spec-list__row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  line-height: 1.55;
}

.wx-spec-list__p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
}

.wx-spec-list + .wx-spec-list__p {
  margin-top: 18px;
}

.wx-spec-list__p--note {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.wx-ship-info__note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tag-custom-color, #AD6B4A) 16%, #fff);
  color: #43566a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.wx-ship-info__card {
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 18%, #e8edf3);
}

.wx-ship-pay__tracks .wx-ship-info__card {
  margin-bottom: 0;
  height: 100%;
  box-sizing: border-box;
}

.wx-ship-info__card:last-child {
  margin-bottom: 0;
}

.wx-ship-info__h {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: #4a5560;
}

.wx-ship-info__card p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
  overflow-wrap: break-word;
  line-break: strict;
}

.wx-ship-info__card p:last-child {
  margin-bottom: 0;
}

.wx-ship-aftercare__list {
  margin: 4px 0 0;
  padding: 0 0 0 1.15em;
}

.wx-ship-aftercare__list li {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
}

.wx-ship-aftercare__list li:last-child {
  margin-bottom: 0;
}

.wx-ship-aftercare .wx-ship-pay__tracks {
  grid-template-columns: 1fr 1fr;
}

.wx-ship-aftercare .wx-ship-info__card:last-child {
  grid-column: 1 / -1;
}

.wx-product-detail__section-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 900;
  color: #1e293b;
}

.wx-product-detail__desc {
  font-size: 15px;
  line-height: 1.75;
  color: #334155;
  white-space: normal;
}

.wx-product-detail__desc--rich img,
.wx-product-detail__desc--rich video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

.wx-product-detail__desc--rich p[align="center"],
.wx-product-detail__desc--rich [align="center"] {
  text-align: center;
}

.wx-product-detail__desc--rich p[align="right"],
.wx-product-detail__desc--rich [align="right"] {
  text-align: right;
}

.wx-product-detail__desc--rich p[align="left"],
.wx-product-detail__desc--rich [align="left"] {
  text-align: left;
}

.wx-product-detail__desc--rich u {
  text-decoration: underline;
}

.wx-product-detail__desc--rich small {
  color: #64748b;
  font-size: 13px;
}

.wx-product-detail__desc--rich ul,
.wx-product-detail__desc--rich ol {
  margin: 10px 0 10px 1.25em;
  padding: 0;
}

.wx-product-detail__desc--rich li {
  margin-bottom: 6px;
}

/* 舊版自訂 class 向下相容 */
.wx-product-detail__desc--rich .wx-detail-center {
  text-align: center;
}

.wx-product-detail__desc--rich .wx-detail-thin {
  font-weight: 400;
  font-size: 13px;
  color: #64748b;
}

.wx-product-detail__desc--rich .wx-detail-video-wrap {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 16px auto;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #0f172a;
}

.wx-product-detail__desc--rich .wx-detail-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.wx-product-detail__video-wrap {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
}

.wx-product-detail__video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .wx-product-detail {
    padding: 12px 16px 48px;
  }

  .wx-product-detail__hero {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 20px;
    padding: 4px 0 24px;
  }

  .wx-product-detail__gallery,
  .wx-product-detail__media > .wx-product-detail__img,
  .wx-product-detail__media > .wx-product-detail__gallery-video,
  .wx-product-detail__media > .wx-product-detail__gallery-yt,
  .wx-product-detail__img-placeholder,
  .wx-product-detail__gallery-thumbs-row,
  .wx-product-detail__gallery-thumbs,
  .wx-product-detail__summary {
    grid-column: auto;
    grid-row: auto;
  }

  .wx-product-detail__gallery {
    min-height: 0;
  }

  .wx-product-detail__gallery-thumb {
    flex: 0 0 56px;
    width: 56px;
    min-width: 56px;
    height: 56px;
  }

  .wx-product-detail__cta-row {
    margin-top: 12px;
    padding-top: 8px;
  }

  .wx-product-detail__cta {
    max-width: none;
  }

  .wx-product-detail__tab {
    font-size: 12px;
    padding: 12px 6px;
  }

  .wx-product-detail__tabpanels {
    padding: 22px 20px 24px;
  }

  .wx-spec-list__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .wx-ship-pay__tracks {
    grid-template-columns: 1fr;
  }
}

.wx-product-detail__variants {
  margin: 14px 0 4px;
}

.wx-product-detail__variants-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 8px;
}

.wx-product-detail__variant-select-wrap {
  position: relative;
  width: 100%;
  max-width: none;
}

.wx-product-detail__variant-select {
  display: block;
  width: 100%;
  max-width: none;
  height: 46px;
  margin: 0;
  padding: 0 40px 0 14px;
  box-sizing: border-box;
  border: 1px solid #d1dbe4;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23778ca3' d='M1.2 1.2L6 6l4.8-4.8' stroke='%23778ca3' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  color: #3f4a52;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 46px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wx-product-detail__variant-select:hover {
  border-color: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 45%, #d1dbe4);
}

.wx-product-detail__variant-select:focus {
  border-color: var(--primary-color, var(--pos-btn-bg, #778ca3));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 16%, transparent);
  outline: none;
}

.wx-product-detail__variant-select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background-color: #f1f4f8;
}

.wx-product-detail__variant-select option:disabled {
  color: #94a3b8;
}

.wx-product-detail__cta.is-busy,
.wx-product-detail__cta.is-busy:hover,
.wx-product-detail__cta.is-busy:active,
.wx-product-detail__cta.is-busy:focus {
  cursor: pointer;
  opacity: 1;
}

.wx-product-detail__cta.is-sold-out,
.wx-product-detail__cta.is-sold-out:hover,
.wx-product-detail__cta.is-sold-out:disabled,
.wx-product-detail__cta.is-sold-out:disabled:hover {
  opacity: 1;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
  background: #d0dae3;
  border-color: #d0dae3;
  color: #6b7280;
}

.wx-product-detail__cta:disabled:not(.is-sold-out) {
  cursor: pointer;
  opacity: 1;
}

@media (max-width: 767px) {
  .wx-product-detail__cta-row {
    position: sticky;
    bottom: 0;
    z-index: 30;
    /* 按鈕列不再有白色底塊／陰影／上框線；按鈕本身浮在內容上方 */
    margin-inline: 0;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    background: transparent;
    border-top: 0;
    box-shadow: none;
  }

  body:has(.wx-product-detail__cta-row) .wx-contact-launcher {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* 預購第 N 批（2026-10-13）：第 2 批起，「預計到貨」旁加「第 N 批」小標籤；標籤與日期靠左、備註標籤仍靠右 */
.wx-product-detail__batch-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--primary-color, var(--pos-btn-bg, #778ca3));
  background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 14%, #fff);
}

.wx-product-detail__batch-tag + .wx-product-detail__facts--inline {
  margin-right: auto;
}

/* 預購剩餘名額：價格旁小字（剩 5 份以下或已滿才顯示，與商品卡片同一規則）；已滿＝紅色，與卡片已滿標籤同色 */
.wx-product-detail__remain {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--instock-tag-color, #728B7E);
}

.wx-product-detail__remain.is-full {
  color: #be123c;
}
