/* 产品详情弹窗优化样式 */

/* 弹窗整体优化 */
.product-detail-content {
  max-width: 850px; /* 限制最大宽度 */
  width: 90%;
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
}

.product-detail-header {
  padding: 15px 20px;
}

.product-detail-body {
  padding: 0 20px 20px;
}

/* 主图尺寸优化 */
.product-detail-main-image {
  max-width: 100%;
  max-height: 380px; /* 限制最大高度 */
  object-fit: contain; /* 保持图片比例 */
  margin: 0 auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 缩略图容器包装器 */
.product-detail-thumbnails-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin: 10px 0;
}

/* 缩略图横向滚动容器 */
.product-detail-thumbnails {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  -webkit-overflow-scrolling: touch; /* 平滑滚动在iOS设备 */
  scroll-behavior: smooth; /* 平滑滚动效果 */
  flex-wrap: nowrap; /* 防止换行 */
  margin: 0 -5px; /* 负边距创造更多空间 */
  padding: 8px 5px; /* 补偿负边距 */
  flex: 1; /* 占据剩余空间 */
}

/* 隐藏滚动条 */
.product-detail-thumbnails::-webkit-scrollbar {
  display: none;
}

/* 缩略图滚动指示器 */
.thumbnail-scroll-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s ease;
  color: #666;
  font-size: 12px;
}

.thumbnail-scroll-indicator:hover {
  background-color: rgba(255, 255, 255, 1);
  color: #333;
  transform: scale(1.1);
}

.thumbnail-scroll-indicator.left {
  margin-right: 8px;
}

.thumbnail-scroll-indicator.right {
  margin-left: 8px;
}

/* 缩略图项目样式优化 */
.product-detail-thumbnail {
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  max-width: 80px;
  min-width: 60px;
}

.product-detail-thumbnail:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-detail-thumbnail.active {
  border-color: #ff6347;
}

/* 商品标题样式优化 */
.product-detail-info h3 {
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #333;
}

/* 价格样式优化 */
.product-detail-price {
  font-size: 24px;
  font-weight: bold;
  color: #e63946;
  margin-bottom: 15px;
}

/* 价格单位样式 */
.price-currency {
  font-size: 12px;
  font-weight: normal;
  margin-left: 2px;
}

/* 访问CNFANS文本样式 */
.product-detail-visit-text {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: 10px 0 15px;
  padding: 8px 0;
  border-top: 1px dashed #eee;
  border-bottom: 1px dashed #eee;
}

/* 按钮容器样式 */
.product-detail-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

/* 按钮统一样式 */
.product-detail-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2476db, #1e5bb8);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  margin-right: 10px;
  margin-bottom: 10px;
  width: 130px;
  height: 45px;
  font-size: 14px;
  box-sizing: border-box;
}

.product-detail-buy-btn:hover {
  background: linear-gradient(135deg, #1e5bb8, #1a4d9e);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(36, 118, 219, 0.4);
}

/* 按钮图标样式 */
.btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 3px;
}

/* 商品详情布局优化 */
.product-detail-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.product-detail-images {
  flex: 0 0 45%; /* 调整图片区域宽度 */
  max-width: 450px; /* 限制最大宽度 */
}

.product-detail-info {
  flex: 1; /* 信息区域占据剩余空间 */
  min-width: 250px; /* 确保在小屏幕上有足够宽度 */
}

/* 响应式样式 */
@media (max-width: 768px) {
  /* 在移动设备上优化缩略图滑动 */
  .product-detail-thumbnails {
    gap: 4px;
    padding: 5px 3px;
  }
  
  .product-detail-thumbnail {
    max-width: 60px;
    min-width: 50px;
  }
  
  .thumbnail-scroll-indicator {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  
  /* 调整商品标题和价格在移动设备上的大小 */
  .product-detail-info h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .product-detail-price {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  /* 移动设备上调整访问文本 */
  .product-detail-visit-text {
    font-size: 12px;
    margin: 8px 0 12px;
    padding: 6px 0;
  }
  
  /* 移动设备上调整按钮 */
  .product-detail-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .product-detail-buy-btn {
    padding: 10px 16px;
    font-size: 12px;
    margin-right: 0;
    margin-bottom: 0;
    width: 110px;
    height: 40px;
    gap: 6px;
  }
  
  .btn-icon {
    width: 16px;
    height: 16px;
  }
  
  /* 移动设备上调整布局 */
  .product-detail-body {
    flex-direction: column;
    padding: 0 15px 15px;
  }
  
  .product-detail-content {
    width: 95%;
    margin: 10px auto;
  }
  
  .product-detail-images,
  .product-detail-info {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* 移动设备上调整主图尺寸 */
  .product-detail-main-image {
    max-height: 280px;
    margin-bottom: 10px;
  }
  
  /* 移动设备上调整弹窗内边距 */
  .product-detail-header {
    padding: 12px 15px;
  }
}