/**
 * 级伴益生菌 AI 官网 - 产品页专属样式
 */

.qb-product-page {
  background: var(--qianban-color-bg);
}

/* ==================== 产品概览 ==================== */
.qb-product-overview {
  padding: var(--qianban-space-xl) 0;
  background: #fff;
}

.qb-product-overview__inner {
  display: flex;
  flex-direction: column;
  gap: var(--qianban-space-xl);
}

@media (min-width: 768px) {
  .qb-product-overview__inner {
    flex-direction: row;
    align-items: flex-start;
  }

  .qb-gallery { flex: 0 0 45%; }
  .qb-product-info { flex: 1; }
}

/* ==================== 图片轮播 ==================== */
.qb-gallery {
  position: sticky;
  top: 80px;
}

.qb-gallery__main {
  position: relative;
  border-radius: var(--qianban-radius-lg);
  overflow: hidden;
  box-shadow: var(--qianban-shadow-md);
  background: #fff;
  aspect-ratio: 1;
}

.qb-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.qb-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--qianban-color-text);
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: var(--qianban-transition-fast);
  box-shadow: var(--qianban-shadow-sm);
  z-index: 1;
}

.qb-gallery__nav:hover {
  background: var(--qianban-color-primary);
  color: #fff;
}

.qb-gallery__nav--prev { left: var(--qianban-space-sm); }
.qb-gallery__nav--next { right: var(--qianban-space-sm); }

.qb-gallery__thumbs {
  display: flex;
  gap: var(--qianban-space-sm);
  margin-top: var(--qianban-space-sm);
  overflow-x: auto;
  padding: var(--qianban-space-xs);
}

.qb-gallery__thumb {
  flex: 0 0 60px;
  height: 60px;
  border-radius: var(--qianban-radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--qianban-transition-fast);
  background: #fff;
}

.qb-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qb-gallery__thumb:hover {
  border-color: var(--qianban-color-primary-light);
}

.qb-gallery__thumb.qb-active {
  border-color: var(--qianban-color-primary);
}

/* ==================== 产品信息 ==================== */
.qb-product-info__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--qianban-space-sm);
  margin-bottom: var(--qianban-space-md);
}

.qb-product-info__title {
  font-size: var(--qianban-font-h2);
  color: var(--qianban-color-text);
  margin-bottom: var(--qianban-space-sm);
  line-height: 1.3;
}

.qb-product-info__subtitle {
  font-size: var(--qianban-font-small);
  color: var(--qianban-color-text-secondary);
  margin-bottom: var(--qianban-space-md);
}

.qb-product-info__price-box {
  display: flex;
  align-items: center;
  gap: var(--qianban-space-md);
  flex-wrap: wrap;
  padding: var(--qianban-space-md);
  background: var(--qianban-color-bg);
  border-radius: var(--qianban-radius-md);
  margin-bottom: var(--qianban-space-md);
}

.qb-product-info__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--qianban-space-sm);
  margin-bottom: var(--qianban-space-md);
}

@media (min-width: 480px) {
  .qb-product-info__specs {
    grid-template-columns: repeat(4, 1fr);
  }
}

.qb-spec-item {
  text-align: center;
  padding: var(--qianban-space-sm);
  background: var(--qianban-color-bg);
  border-radius: var(--qianban-radius-sm);
}

.qb-spec-item__label {
  display: block;
  font-size: var(--qianban-font-tiny);
  color: var(--qianban-color-text-secondary);
  margin-bottom: 4px;
}

.qb-spec-item__value {
  display: block;
  font-size: var(--qianban-font-small);
  font-weight: 600;
  color: var(--qianban-color-text);
}

/* ==================== 套餐选择 ==================== */
.qb-package-select {
  margin-bottom: var(--qianban-space-md);
}

.qb-package-select__label {
  font-size: var(--qianban-font-small);
  font-weight: 600;
  color: var(--qianban-color-text);
  margin-bottom: var(--qianban-space-sm);
}

.qb-package-select__options {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--qianban-space-sm);
}

@media (min-width: 480px) {
  .qb-package-select__options {
    grid-template-columns: repeat(3, 1fr);
  }
}

.qb-package-option {
  padding: var(--qianban-space-md);
  border: 2px solid #E8E8E8;
  border-radius: var(--qianban-radius-md);
  cursor: pointer;
  transition: var(--qianban-transition-fast);
  text-align: center;
  position: relative;
}

.qb-package-option:hover {
  border-color: var(--qianban-color-primary-light);
}

.qb-package-option.qb-selected {
  border-color: var(--qianban-color-primary);
  background: rgba(232,76,136,0.05);
}

.qb-package-option__name {
  font-size: var(--qianban-font-small);
  font-weight: 600;
  color: var(--qianban-color-text);
  margin-bottom: 4px;
}

.qb-package-option__price {
  font-size: var(--qianban-font-h3);
  font-weight: 700;
  color: var(--qianban-color-primary);
}

.qb-package-option__price::before {
  content: '¥';
  font-size: 14px;
}

.qb-package-option__badge {
  position: absolute;
  top: -8px;
  right: var(--qianban-space-sm);
  font-size: var(--qianban-font-tiny);
  padding: 2px 8px;
  border-radius: var(--qianban-radius-full);
  background: var(--qianban-gradient-gold);
  color: #fff;
  font-weight: 600;
}

/* ==================== 优惠券输入 ==================== */
.qb-coupon-input {
  display: flex;
  gap: var(--qianban-space-sm);
  margin-bottom: var(--qianban-space-md);
}

.qb-coupon-input .qianban-form-input {
  flex: 1;
}

/* ==================== 购买按钮 ==================== */
.qb-buy-actions {
  display: flex;
  flex-direction: column;
  gap: var(--qianban-space-sm);
  margin-bottom: var(--qianban-space-md);
}

/* ==================== 保障 ==================== */
.qb-guarantees {
  display: flex;
  justify-content: space-around;
  gap: var(--qianban-space-sm);
  padding: var(--qianban-space-md);
  background: var(--qianban-color-bg);
  border-radius: var(--qianban-radius-md);
}

.qb-guarantee {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: var(--qianban-font-tiny);
  color: var(--qianban-color-text-secondary);
}

.qb-guarantee i {
  font-size: 20px;
  color: var(--qianban-color-success);
}

/* ==================== 套餐对比卡片 ==================== */
.qb-packages-section {
  background: #fff;
}

.qb-package-card {
  position: relative;
  padding: var(--qianban-space-xl);
  text-align: center;
  transition: var(--qianban-transition);
}

.qb-package-card--highlight {
  border: 2px solid var(--qianban-color-primary);
  transform: scale(1.02);
  box-shadow: var(--qianban-shadow-lg);
}

.qb-package-card__ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--qianban-gradient-primary);
  color: #fff;
  font-size: var(--qianban-font-tiny);
  font-weight: 600;
  padding: 4px 16px;
  border-radius: var(--qianban-radius-full);
  white-space: nowrap;
  box-shadow: var(--qianban-shadow-sm);
}

.qb-package-card__name {
  font-size: var(--qianban-font-h3);
  font-weight: 700;
  color: var(--qianban-color-text);
  margin-bottom: var(--qianban-space-sm);
}

.qb-package-card__boxes {
  font-size: var(--qianban-font-small);
  color: var(--qianban-color-gold);
  font-weight: 600;
  margin-bottom: var(--qianban-space-md);
}

.qb-package-card__price {
  margin-bottom: var(--qianban-space-md);
}

.qb-package-card__price-current {
  font-size: 36px;
  font-weight: 800;
  color: var(--qianban-color-primary);
}

.qb-package-card__price-current::before {
  content: '¥';
  font-size: 18px;
}

.qb-package-card__price-original {
  display: block;
  font-size: var(--qianban-font-small);
  color: var(--qianban-color-text-light);
  text-decoration: line-through;
}

.qb-package-card__features {
  text-align: left;
  margin-bottom: var(--qianban-space-lg);
  padding: var(--qianban-space-md) 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.qb-package-card__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--qianban-space-sm);
  font-size: var(--qianban-font-small);
  color: var(--qianban-color-text);
  margin-bottom: var(--qianban-space-sm);
}

.qb-package-card__feature i {
  color: var(--qianban-color-success);
  margin-top: 3px;
  flex-shrink: 0;
}

.qb-package-card__feature--disabled {
  opacity: 0.4;
}

.qb-package-card__feature--disabled i {
  color: var(--qianban-color-text-light);
}

/* ==================== 资质认证 ==================== */
.qb-cert-section {
  background: var(--qianban-color-bg);
}

.qb-cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--qianban-space-md);
  margin-top: var(--qianban-space-lg);
}

@media (min-width: 768px) {
  .qb-cert-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.qb-cert-item {
  display: flex;
  align-items: center;
  gap: var(--qianban-space-sm);
  padding: var(--qianban-space-md);
  background: #fff;
  border-radius: var(--qianban-radius-md);
  box-shadow: var(--qianban-shadow-sm);
}

.qb-cert-item__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--qianban-radius-sm);
  background: var(--qianban-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.qb-cert-item__title {
  font-size: var(--qianban-font-small);
  font-weight: 600;
  color: var(--qianban-color-text);
}

.qb-cert-item__desc {
  font-size: var(--qianban-font-tiny);
  color: var(--qianban-color-text-secondary);
}

/* ==================== 详情长图 ==================== */
.qb-detail-section {
  padding: var(--qianban-space-2xl) 0;
  background: #fff;
}

.qb-detail-image-wrapper {
  border-radius: var(--qianban-radius-lg);
  overflow: hidden;
  box-shadow: var(--qianban-shadow-md);
}

.qb-detail-image {
  width: 100%;
  display: block;
}

/* ==================== 购买弹窗二维码占位 ==================== */
.qb-qr-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--qianban-space-md);
  border-radius: var(--qianban-radius-md);
  background: var(--qianban-color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--qianban-space-sm);
  color: var(--qianban-color-text-secondary);
}

.qb-qr-placeholder i {
  font-size: 64px;
  color: var(--qianban-color-success);
}

.qb-qr-placeholder p {
  font-size: var(--qianban-font-small);
}

/* ==================== 购买弹窗代言人 ==================== */
.qb-buy-popup__spokesperson {
  display: flex;
  align-items: center;
  gap: var(--qianban-space-md);
  margin-bottom: var(--qianban-space-md);
  padding: var(--qianban-space-md);
  background: linear-gradient(135deg, #FFF5F8 0%, #FFF9F0 100%);
  border-radius: var(--qianban-radius-md);
}

.qb-buy-popup__spokesperson-text {
  font-size: var(--qianban-font-small);
  color: var(--qianban-color-text-secondary);
  line-height: 1.6;
}

/* ==================== 套餐卡片 3D 倾斜 ==================== */
.qb-package-card.qianban-tilt {
  transform-style: preserve-3d;
}

.qb-package-card--highlight.qianban-tilt {
  /* 高亮卡片也支持倾斜但保持视觉突出 */
}

/* ==================== 移动端修复（10项） ==================== */

/* 1. aspect-ratio fallback - 为不支持aspect-ratio的浏览器提供padding-bottom方案 */
@supports not (aspect-ratio: 1) {
  .qb-gallery__main {
    position: relative;
    padding-bottom: 100%;
    height: 0;
    overflow: hidden;
  }
  .qb-gallery__main img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* 2. 惯性滚动 - 为缩略图和详情图添加平滑滚动 */
.qb-gallery__thumbs,
.qb-detail-image-wrapper {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 移动端专项修复 */
@media (max-width: 767px) {
  /* 1. 轮播图改为自然高度，避免海报文字被压缩/重叠 */
  .qb-gallery__main {
    aspect-ratio: auto;
    height: auto;
    padding: var(--qianban-space-sm);
    background: #fff;
  }

  .qb-gallery__main img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
    display: block;
  }

  /* 2. 轮播图左右箭头缩小，避免遮挡内容 */
  .qb-gallery__nav {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .qb-gallery__nav--prev { left: 6px; }
  .qb-gallery__nav--next { right: 6px; }

  /* 3. 缩略图间距 */
  .qb-gallery__thumbs {
    margin-top: var(--qianban-space-md);
    gap: var(--qianban-space-xs);
  }

  .qb-gallery__thumb {
    flex: 0 0 52px;
  }

  /* 4. 产品信息区域间距 */
  .qb-product-info {
    padding-top: var(--qianban-space-md);
  }

  .qb-product-info__title {
    font-size: var(--qianban-font-h1);
    line-height: 1.3;
  }

  .qb-product-info__subtitle {
    font-size: var(--qianban-font-small);
  }

  /* 5. 标签换行 */
  .qb-product-info__tags {
    flex-wrap: wrap;
    gap: var(--qianban-space-xs);
  }

  .qianban-tag {
    font-size: var(--qianban-font-tiny);
  }

  /* 6. 套餐选择增加间距，防止内容拥挤 */
  .qb-package-select {
    margin-top: var(--qianban-space-md);
  }

  .qb-package-select__label {
    font-size: var(--qianban-font-small);
  }

  /* 3. 套餐不挤压 - 设置最小宽度防止变形 */
  .qb-package-select__options {
    grid-template-columns: 1fr;
    gap: var(--qianban-space-sm);
  }

  .qb-package-option {
    min-width: 0;
    padding: var(--qianban-space-md);
  }

  .qb-package-option__name {
    font-size: var(--qianban-font-body);
  }

  .qb-package-option__price {
    font-size: var(--qianban-font-h3);
  }

  .qb-package-option__badge {
    font-size: 10px;
    position: static !important;
    display: inline-block;
    margin-bottom: 4px;
    top: auto !important;
    right: auto !important;
  }

  .qb-package-option {
    padding-top: var(--qianban-space-sm);
    overflow: visible !important;
  }

  /* 4. 价格换行 - 移动端价格区域允许换行 */
  .qb-product-info__price-box {
    flex-wrap: wrap;
    gap: var(--qianban-space-sm);
  }

  .qianban-price {
    flex-wrap: wrap;
  }

  .qianban-price__current {
    font-size: var(--qianban-font-h1);
  }

  .qianban-price__original {
    font-size: var(--qianban-font-small);
  }

  /* 5. 按钮高度 - 确保移动端按钮可触控 */
  .qb-buy-actions .qianban-btn {
    min-height: 48px;
  }

  .qb-coupon-input .qianban-btn {
    min-height: 48px;
    white-space: nowrap;
  }

  /* 6. 高亮卡片不缩放 - 移动端取消scale变换 */
  .qb-package-card--highlight {
    transform: none;
    border-width: 2px;
  }

  .qb-package-card--highlight:hover {
    transform: none;
  }

  /* 7. 懒加载 - 图片添加will-change提示 */
  .qb-gallery__main img,
  .qb-detail-image {
    will-change: opacity;
  }

  /* 8. 取消sticky - 移动端取消图片区域sticky定位 */
  .qb-gallery {
    position: static;
    top: auto;
  }

  /* 9. 无横向滚动 - 确保页面不出现横向滚动条 */
  .qb-product-page {
    overflow-x: hidden;
  }

  .qb-product-overview__inner {
    overflow-x: hidden;
  }

  .qb-gallery__thumbs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 10. H1字号 - 移动端产品标题字号调整 */
  .qb-product-info__title {
    font-size: var(--qianban-font-h1);
    line-height: 1.3;
  }

  /* 额外：规格区域移动端优化 */
  .qb-product-info__specs {
    grid-template-columns: 1fr 1fr;
    gap: var(--qianban-space-sm);
  }

  .qb-spec-item {
    padding: var(--qianban-space-sm);
  }

  .qb-spec-item__label,
  .qb-spec-item__value {
    font-size: var(--qianban-font-tiny);
  }

  /* 套餐对比卡片移动端优化 */
  .qb-package-card {
    padding: var(--qianban-space-lg);
  }

  .qb-package-card__name {
    font-size: var(--qianban-font-h3);
  }

  .qb-package-card__price-current {
    font-size: 28px;
  }

  .qb-package-card__feature {
    font-size: var(--qianban-font-small);
  }

  /* 保障区域移动端优化 */
  .qb-guarantees {
    gap: var(--qianban-space-sm);
  }

  .qb-guarantee {
    font-size: var(--qianban-font-tiny);
  }

  /* 优惠券输入框 */
  .qb-coupon-input {
    gap: var(--qianban-space-xs);
  }

  .qb-coupon-input .qianban-form-input {
    font-size: var(--qianban-font-small);
  }
}
/* 超窄屏专项调整 */
@media (max-width: 374px) {
  .qb-product-info__title {
    font-size: 22px;
  }

  .qb-product-info__specs {
    grid-template-columns: 1fr;
  }
}
