/* PDP FOUC：图库/比例先于主题 CSS，避免首屏错闪；含 zoom 层样式 */
.mobile-main-gallery { display: none; }
.desktop-gallery { display: block; }
.swiper-main-mobile:not(.swiper-initialized) { overflow: hidden; }
.swiper-main-mobile:not(.swiper-initialized) .swiper-slide:not(:first-child) { display: none; }
.image-ratio1 { width: 100%; aspect-ratio: 1 / 1; }
.image-ratio34 { width: 100%; aspect-ratio: 3 / 4; }
.image-ratio23 { width: 100%; aspect-ratio: 2 / 3; }
.image-ratio12 { width: 100%; aspect-ratio: 1 / 2; }
@media (max-width: 767.98px) {
  .mobile-main-gallery { display: block; }
  .desktop-gallery { display: none; }
  .product-tabs-view { display: none !important; }
}
@media (min-width: 768px) {
  .product-accordion-view.desktop-hide { display: none !important; }
}

img.sd-pdp-zoomable {
  cursor: zoom-in;
}

.sd-pdp-zoom {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 88px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.2s ease;
}
.sd-pdp-zoom.is-open {
  opacity: 1;
  pointer-events: auto;
}
.sd-pdp-zoom[hidden] {
  display: none !important;
}
body.sd-pdp-zoom-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.sd-pdp-zoom__stage {
  position: relative;
  line-height: 0;
  flex-shrink: 0;
}

.sd-pdp-zoom__img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  flex-shrink: 0;
  object-fit: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto;
  transform-origin: center center;
  transition: transform 0.2s ease;
  cursor: grab;
  touch-action: none;
}
.sd-pdp-zoom__img.is-dragging {
  transition: none;
  cursor: grabbing;
}

.sd-pdp-zoom__actions {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: calc(100% - 24px);
  z-index: 2;
}

.sd-pdp-zoom__close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  z-index: 3;
}

.sd-pdp-zoom__btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #1d1f21;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.sd-pdp-zoom__btn[hidden] {
  display: none !important;
}
.sd-pdp-zoom__btn:hover {
  background: #f4f4f4;
}
.sd-pdp-zoom__btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.sd-pdp-zoom__btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 767.98px) {
  .sd-pdp-zoom {
    padding: 56px 8px 96px;
  }
  .sd-pdp-zoom__btn {
    width: 40px;
    height: 40px;
  }
  .sd-pdp-zoom__actions {
    gap: 8px;
  }
}

/* Softwared：左右短边吸顶；列 stretch 后滚到末尾底边可平齐 */
@media (min-width: 768px) {
  .sd-row.pdp-sticky-row,
  .product-warp.product-grid {
    align-items: stretch;
  }

  .sd-row.pdp-sticky-row > [class*='sd-col-'],
  .product-warp.product-grid > .product-left,
  .product-warp.product-grid > .product-right {
    align-self: stretch;
  }

  .product-right-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 15px;
    z-index: 1;
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .product-right-sticky {
    position: static;
  }
}
