/* ===== 产品相册 Elementor Widget ===== */

.product-gallery-widget {
  width: 100%;
  max-width: 100%;
}

/* ---------- 大图 ---------- */
.pg-main {
  width: 100%;
  overflow: hidden;
}

.pg-main-swiper {
  width: 100%;
}

.pg-main-ratio {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.pg-main-ratio img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 自适应高度：按图片原始比例展示，不裁剪 */
.pg-main-ratio--auto {
  padding-top: 0 !important;
  height: auto;
}

.pg-main-ratio--auto img {
  position: static;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: initial;
}

/* Swiper autoHeight 模式下，让 wrapper 平滑过渡到当前 slide 的高度 */
.product-gallery-widget[data-auto-height="1"] .pg-main-swiper {
  height: auto;
}

.product-gallery-widget[data-auto-height="1"] .pg-main-swiper .swiper-wrapper {
  align-items: flex-start;
}

/* ---------- 缩略图 ---------- */
.pg-thumbs {
  width: 100%;
  overflow: hidden;
}

.pg-thumbs-swiper {
  width: 100%;
}

.pg-thumbs .swiper-slide {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.pg-thumbs .swiper-slide-thumb-active {
  opacity: 1;
}

.pg-thumb-ratio {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 */
  overflow: hidden;
}

.pg-thumb-ratio img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 2px solid transparent;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.pg-thumbs .swiper-slide-thumb-active img {
  border-color: #0073aa;
}

/* ---------- 手机端适配 ---------- */
@media (max-width: 767px) {
  .pg-main-ratio {
    border-radius: 0 !important;
  }

  .pg-thumb-ratio img {
    border-width: 2px;
  }
}
