/*!
 * gg-pdp.css —— 商品页（PDP）专属样式
 *
 * 来源口径：全部数值取自源站商品页 getComputedStyle（1440 / 390 各量一份），
 * 只补「我们这 4 份镜像 CSS 里没有的」规则（源站由 Theme/App 的另外几份 CSS 提供）：
 *   · .atc-button / .main-product-atc（加购按钮）
 *   · .quantity-breaks / .quantity-break（数量档三卡）
 *   · 图库：主图切换（.is-active）、缩略图条带（一行 5 个）
 *     —— 源站的放大按钮带 product__media-zoom-none（base.css 里 display:none），
 *        即源站没启用 zoom/lightbox，按「源站有才做」本站不做。
 *   · 加购状态行 .gg-atc-status、Buy it now 次级按钮
 * 不改 gg-root / gg-shell / gg-fonts / gg-home 里已有的任何规则。
 */

/* ---------- 1. 加购按钮（源站：h49 / r8 / 19px 700 / ls1px / 大写 / 黑字 / 粉底） ---------- */
.product__info-wrapper .main-product-atc.atc-button,
.product__info-wrapper .atc-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.9rem;
  height: 4.9rem;
  padding: 0 3rem;
  border: 0;
  border-radius: 0.8rem;
  background-color: rgb(var(--color-button));
  color: rgb(var(--color-button-text));
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  cursor: pointer;
}
.product__info-wrapper .main-product-atc.atc-button:hover {
  opacity: 0.9;
}
.product__info-wrapper .main-product-atc .button__label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.product__info-wrapper .main-product-atc .spinner {
  display: none;
}
.product__info-wrapper .main-product-atc.is-loading .spinner {
  display: block;
  width: 1.8rem;
  height: 1.8rem;
  margin-left: 0.8rem;
}

/* 数量 + 加购同一行：按钮吃掉剩余宽度 */
.product-form__quantity-and-btn {
  display: flex;
  align-items: center;
  column-gap: 1rem;
}
.product-form__quantity-and-btn > .product-form__quantity {
  flex: 0 0 11rem;
  width: 11rem;
}
.product-form__quantity-and-btn > .product-form__submit {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.product-form__quantity-and-btn .quantity {
  min-height: 4.9rem;
  width: 11rem;
}
.product-form__quantity-and-btn .quantity__input {
  font-size: 1.6rem;
  font-weight: 500;
}

/* ---------- 2. Buy it now（真跳转：/checkout/?add-to-cart=ID） ---------- */
.gg-buy-now {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 4.9rem;
  height: 4.9rem;
  margin-top: 1rem;
  border: 0.2rem solid rgb(var(--color-button));
  border-radius: 0.8rem;
  background-color: rgb(var(--color-background));
  color: rgb(var(--color-foreground));
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  text-decoration: none;
  box-sizing: border-box;
}
.gg-buy-now:hover {
  background-color: rgba(var(--color-button), 0.15);
  color: rgb(var(--color-foreground));
}

/* ---------- 3. 加购状态行 ---------- */
.gg-atc-status {
  margin-top: 1.2rem;
  font-size: 1.4rem;
  line-height: 2rem;
  color: rgba(var(--color-foreground), 0.9);
}
.gg-atc-status:empty {
  display: none;
}
.gg-atc-status a {
  color: rgb(var(--color-foreground));
  text-decoration: underline;
}
.gg-atc-status--error {
  color: #b00020;
}

/* ---------- 4. 数量档（源站 quantity-breaks 三卡；已去掉折扣/划线/You save） ---------- */
#quantity-breaks-template--24875155390534__main {
  margin: 1.5rem 0;
}
#quantity-breaks-template--24875155390534__main .quantity-breaks__title {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 1.2rem;
  margin: 0 0 1.3rem;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.4rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: rgba(var(--color-foreground), 0.9);
}
#quantity-breaks-template--24875155390534__main .quantity-breaks__title > span:first-child,
#quantity-breaks-template--24875155390534__main .quantity-breaks__title > span:last-child {
  flex: 1 1 0;
  height: 1px;
  background-color: rgba(var(--color-foreground), 0.2);
}
.quantity-breaks-container {
  display: block;
}
.quantity-breaks-container > input.gg-qty-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.quantity-break {
  position: relative;
  display: block;
  margin-bottom: 0.8rem;
  padding: 1.75rem 1.75rem 1.75rem 4rem;
  border: 0.2rem solid rgba(var(--color-button), 0.6);
  border-radius: 1rem;
  background-color: rgba(var(--color-button), 0.1);
  color: rgba(var(--color-foreground), 0.9);
  font-size: 1.6rem;
  cursor: pointer;
}
.quantity-break:last-of-type {
  margin-bottom: 0;
}
.quantity-break:before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  box-sizing: border-box;
  border: 0.2rem solid rgba(var(--color-button), 0.9);
  border-radius: 50%;
  background-color: rgb(var(--color-background));
}
.quantity-breaks-container > input.gg-qty-radio:checked + label {
  border-color: rgb(var(--color-button));
}
.quantity-breaks-container > input.gg-qty-radio:checked + label:before {
  border-color: rgb(var(--color-button));
  box-shadow: inset 0 0 0 0.3rem rgb(var(--color-background));
  background-color: rgb(var(--color-button));
}
.quantity-breaks-container > input.gg-qty-radio:focus-visible + label {
  outline: 0.2rem solid rgba(var(--color-foreground), 0.5);
  outline-offset: 0.2rem;
}
.quantity-break__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 1rem;
}
.quantity-break__left {
  display: block;
}
.quantity-break__label {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.6rem;
}
.quantity-break__caption {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.4rem;
  line-height: 1.4rem;
  color: rgba(var(--color-foreground), 0.7);
}
.quantity-break__right {
  display: block;
  text-align: right;
}
.quantity-break__price {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.6rem;
  color: rgb(var(--color-button));
}

/* ---------- 5. 图库：主图切换 / 缩略图当前态 ---------- */
.product--thumbnail_slider .product__media-item:not(.is-active) {
  display: none;
}
.product--thumbnail_slider .product__media-item.is-active {
  display: block;
}
.product__media-wrapper .thumbnail-list__item.is-active .thumbnail {
  box-shadow: 0 0 0 0.1rem rgb(var(--color-foreground));
}
media-gallery {
  position: relative;
}
media-gallery slider-component.product-media-slider {
  display: block;
}
media-gallery .thumbnail-slider {
  display: flex;
  align-items: center;
}
media-gallery .thumbnail-slider .thumbnail-list {
  flex: 1 1 auto;
  min-width: 0;
}
media-gallery .slider-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 1rem;
}
media-gallery .slider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 50%;
  background-color: rgba(var(--color-background), 0.8);
  color: rgb(var(--color-foreground));
  cursor: pointer;
  padding: 0;
}
media-gallery .slider-button .icon {
  width: 1rem;
  height: 1.6rem;
}
media-gallery .slider-button--prev .icon {
  transform: rotate(90deg);
}
media-gallery .slider-button--next .icon {
  transform: rotate(-90deg);
}
@media screen and (min-width: 750px) {
  media-gallery .desktop-hidden {
    display: none;
  }
}
@media screen and (max-width: 749px) {
  /* 源站：移动端左右箭头是覆盖在图上的浮层（不占高度），横向内缩 1.2rem，
     宽度必须显式 auto —— base.css 的 .slider-buttons{width:100%} + left/right 会撑出视口 */
  media-gallery .product-media-slider > .slider-buttons {
    position: absolute;
    left: 0;
    right: 0;
    width: auto;
    top: 50%;
    bottom: auto;
    padding: 0 1.2rem;
    transform: translateY(-50%);
    justify-content: space-between;
    z-index: 2;
  }
  /* 源站移动端图库有 28px 的 peek（--mobile-scroll-padding: 14px），图不顶满屏宽。
     用容器右侧内缩实现（不跟 base.css 的 .grid__item 宽度选择器打特异性官司），
     这样 7 张 slide 宽度一致 = 362，与源站 mediaImg 的 362×362 对齐。 */
  media-gallery .product__media-list {
    padding-right: 2.8rem;
  }
}

/* 缩略图：源站是一行 5 个、可横向滚动的条带（--desktop-thumbnails: 5），不是 4 列网格换行 */
media-gallery .thumbnail-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  column-gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
media-gallery .thumbnail-list::-webkit-scrollbar {
  display: none;
}
media-gallery .thumbnail-list > .thumbnail-list__item.slider__slide {
  flex: 0 0 auto;
  width: calc((100% - 4rem) / 5);
  margin: 0;
}
media-gallery .thumbnail-slider .slider-button {
  align-self: center;
  flex: 0 0 auto;
}

/* ---------- 6. 去掉源站隐藏节点带来的空隙（View full details 保持隐藏，与源站一致） ---------- */
.product__info-container .product__view-details.quick-add-hidden {
  display: none;
}
