/* =========================
   基础变量：统一控制颜色、尺寸与间距
   ========================= */
:root {
  --brand-text: #2f3440;
  --brand-muted: #6e7380;
  --brand-border: #d9dde4;
  --brand-accent: #86a7b2;
  --brand-accent-dark: #668692;
  --brand-danger: #b04444;
  --swatch-size: 44px;
  --thumb-size: 88px;
}

/* 页面基础样式 */
body {
  background: #f5f4f1;
  color: var(--brand-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

code {
  color: inherit;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

/* 详情页整体外层间距 */
.product-shell {
  padding-block: 28px 56px;
}

/* 商品卡片：控制圆角、阴影与整体裁切 */
.product-card {
  background: #fff;
  border: 1px solid #eceff4;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.06);
  overflow: hidden;
}

.product-gallery,
.product-summary {
  padding: 28px;
}

.breadcrumb-nav {
  font-size: 0.95rem;
  color: var(--brand-muted);
  margin-bottom: 22px;
}

.breadcrumb-nav a {
  color: inherit;
  text-decoration: none;
}

.product-title {
  font-size: clamp(2rem, 2.8vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 18px;
}

.product-price {
  font-size: 2rem;
  line-height: 1;
  color: #cb7526;
  font-weight: 700;
  margin-bottom: 24px;
}

.utility-btn {
  min-height: 48px;
  border-radius: 8px;
  border: 0;
  background: var(--brand-accent);
  color: #fff;
  font-weight: 600;
  padding-inline: 18px;
  margin-bottom: 28px;
  transition: background-color 0.2s ease;
}

.utility-btn:hover {
  background: var(--brand-accent-dark);
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #596071;
  background: #f4f6f8;
  border: 1px solid #e8ecf2;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* 主图区域：作为主视觉展示窗口 */
.gallery-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: #f2f3f4;
  border: 1px solid #edf0f4;
}

.gallery-main-link {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  display: block;
  background: transparent;
  cursor: zoom-in;
}

.gallery-stage img,
.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 主图左右箭头 */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 42px;
  height: 42px;
  padding:0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.gallery-nav-svg {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
}

.gallery-prev {
  left: 16px;
}

.gallery-next {
  right: 16px;
}

.gallery-nav:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.04);
}

.gallery-nav:disabled,
.gallery-nav.swiper-button-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gallery-nav:focus-visible,
.zoom-chip:focus-visible,
.swatch-item:focus-visible,
.button-choice:focus-visible {
  outline: 2px solid #4b6b88;
  outline-offset: 2px;
}

/* Pro 版缩略图由 Swiper 生成，需要单独控制尺寸与激活态 */
.gallery-thumbs--pro .swiper-wrapper {
  align-items: flex-start;
}

.gallery-thumbs--pro .swiper-slide {
  width: var(--thumb-size);
  height: var(--thumb-size);
  flex: 0 0 var(--thumb-size);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f4f4f4;
  opacity: 0.58;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.gallery-thumbs--pro .swiper-slide-thumb-active {
  border-color: #6b7f97;
  opacity: 1;
  transform: translateY(-2px);
}

.helper-note:empty,
.gallery-hint:empty,
.breadcrumb-nav:empty,
.badge-chip:empty {
  display: none;
}

.zoom-chip {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-text);
}

/* 缩略图区域：增加顶部留白，避免激活态上移时被裁切 */
.gallery-thumbs {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  overflow: visible;
}

.thumb-item {
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f4f4f4;
  opacity: 0.6;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  padding: 0;
}

.thumb-item.is-active {
  border-color: #6b7f97;
  opacity: 1;
  transform: translateY(-2px);
}

.gallery-hint {
  color: var(--brand-muted);
  font-size: 0.9rem;
  margin-top: 10px;
}

.attribute-block {
  margin-bottom: 24px;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
}

.section-label strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.swatch-list,
.button-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 色卡按钮 */
.swatch-item {
  width: var(--swatch-size);
  height: var(--swatch-size);
  border-radius: 4px;
  border: 2px solid transparent;
  background: transparent;
  padding: 0;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.swatch-item:hover:not(:disabled),
.button-choice:hover:not(:disabled) {
  transform: translateY(-1px);
}

.swatch-item.is-active {
  border-color: #222;
  box-shadow: 0 0 0 1px #222 inset;
}

.swatch-item.is-disabled {
  opacity: 0.38;
}

.swatch-item.is-disabled::after {
  content: "";
  position: absolute;
  inset: 50% 8px auto 8px;
  height: 1px;
  background: rgba(0, 0, 0, 0.6);
  transform: rotate(-18deg);
  transform-origin: center;
}

.form-select.attribute-select {
  min-height: 48px;
  border-radius: 0;
  border-color: var(--brand-border);
  box-shadow: none;
  font-size: 1.05rem;
}

.button-choice {
  min-width: 172px;
  min-height: 48px;
  border: 1px solid var(--brand-border);
  background: #fff;
  border-radius: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #43485a;
  padding: 12px 16px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.button-choice.is-active {
  background: #fff;
  border-color: #1d2430;
  box-shadow: 0 0 0 1px #1d2430 inset;
  color: #384053;
}

.button-choice.is-disabled {
  color: #9aa1ad;
  text-decoration: line-through;
  background: #fafafb;
}

/* 商品补充信息区，如 SKU、Variation、Pattern */
.meta-grid {
  display: grid;
  gap: 10px;
  margin-block: 24px;
  padding-top: 20px;
  border-top: 1px solid #eceff3;
}

.meta-row {
  display: flex;
  gap: 8px;
  align-items: start;
  font-size: 0.96rem;
}

.meta-row .meta-name {
  min-width: 88px;
  color: var(--brand-muted);
}

.stock-state {
  margin-top: 14px;
  color: var(--brand-danger);
  font-weight: 700;
  min-height: 24px;
}

.selection-summary {
  border-top: 1px solid #eceff3;
  margin-top: 18px;
  padding-top: 18px;
  color: var(--brand-muted);
  font-size: 0.95rem;
}

/* 数量与购买操作区 */
.cart-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.qty-input {
  width: 96px;
  min-height: 48px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  padding-inline: 12px;
  box-shadow: none;
}

.add-cart-btn {
  flex: 1 1 220px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #202734;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.add-cart-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.helper-note {
  font-size: 0.9rem;
  color: var(--brand-muted);
  margin-top: 10px;
}

.simple-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  align-items: center;
  background: rgba(15, 23, 33, 0.9);
  padding: 24px;
}

.simple-lightbox[hidden] {
  display: none;
}

.lightbox-open {
  overflow: hidden;
}

.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.lightbox-stage img {
  max-width: min(92vw, 1200px);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  background: #fff;
}

.lightbox-caption {
  color: #f8fafc;
  text-align: center;
  font-size: 0.95rem;
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  font-size: 34px;
  line-height: 1;
}

.lightbox-nav {
  width: 54px;
  height: 54px;
  font-size: 34px;
  line-height: 1;
  justify-self: center;
}

/* 响应式：移动端收紧左右内边距并让按钮更易点击 */
@media (max-width: 991.98px) {
  .product-gallery,
  .product-summary {
    padding: 20px;
  }

  .button-choice {
    min-width: 0;
    flex: 1 1 100%;
  }

  .gallery-nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .zoom-chip {
    padding: 7px 11px;
    font-size: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .gallery-nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .simple-lightbox {
    grid-template-columns: 60px minmax(0, 1fr) 60px;
    padding: 16px;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 28px;
  }
}


.gallery-stage--pro {
  padding: 0;
}

.productMainSwiper {
  border-radius: 18px;
  overflow: hidden;
}

.productMainSwiper .swiper-slide {
  aspect-ratio: 1 / 1;
  background: #f3f4f4;
}

.productMainSwiper .swiper-slide a,
.productMainSwiper .swiper-slide img {
  width: 100%;
  height: 100%;
  display: block;
}

.productMainSwiper .swiper-slide img {
  object-fit: cover;
}

.gallery-thumbs--pro {
  margin-top: 18px;
}

.gallery-thumbs--pro .swiper-slide {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f4f4f4;
  opacity: 0.55;
  cursor: pointer;
}

.gallery-thumbs--pro .swiper-slide-thumb-active {
  border-color: #6b7f97;
  opacity: 1;
}

.gallery-thumbs--pro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-stage--pro {
  padding: 0;
}

.productMainSwiper {
  border-radius: 18px;
  overflow: hidden;
}

.productMainSwiper .swiper-slide {
  aspect-ratio: 1 / 1;
  background: #f3f4f4;
}

.productMainSwiper .swiper-slide a,
.productMainSwiper .swiper-slide img {
  width: 100%;
  height: 100%;
  display: block;
}

.productMainSwiper .swiper-slide img {
  object-fit: cover;
}

.gallery-thumbs--pro {
  margin-top: 18px;
}

.gallery-thumbs--pro .swiper-slide {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f4f4f4;
  opacity: 0.55;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.gallery-thumbs--pro .swiper-slide-thumb-active {
  border-color: #6b7f97;
  opacity: 1;
  transform: translateY(-2px);
}

.gallery-thumbs--pro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-stage--pro {
  padding: 0;
}

.productMainSwiper {
  border-radius: 18px;
  overflow: hidden;
}

.productMainSwiper .swiper-slide {
  aspect-ratio: 1 / 1;
  background: #f3f4f4;
}

.productMainSwiper .swiper-slide a,
.productMainSwiper .swiper-slide img {
  width: 100%;
  height: 100%;
  display: block;
}

.productMainSwiper .swiper-slide img {
  object-fit: cover;
}

.gallery-thumbs--pro {
  margin-top: 18px;
}

.gallery-thumbs--pro .swiper-slide {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f4f4f4;
  opacity: 0.55;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.gallery-thumbs--pro .swiper-slide-thumb-active {
  border-color: #6b7f97;
  opacity: 1;
  transform: translateY(-2px);
}

.gallery-thumbs--pro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.gallery-hint:empty,
.helper-note:empty {
  display: none;
}
