/* 容器 */
.goods-preview {
  position: relative;
  width: 420px;
  margin: 0px;
}

/* 主图区域 */
.main-img {
  position: relative;
  width: 420px;
  height: 420px;
  border: 1px solid #eee;
  overflow: hidden;
}
.main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 放大镜遮罩层 */
.magnifier-mask {
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.3);
  border: 1px solid #ccc;
  display: none;
  pointer-events: none;
}

/* 放大显示区域 */
.magnifier-view {
  position: absolute;
  left: 420px;
  top: 0;
  width: 500px;
  height: 420px;
  border: 1px solid #eee;
  overflow: hidden;
  display: none;
}
.magnifier-view img {
  position: absolute;
  width: 800px;
  height: 800px;
}

/* 缩略图轮播容器 - 核心修改：滚动区域100%宽度，按钮悬浮覆盖 */
.thumb-container {
  position: relative;
  width: 100%;
  margin-top: 5px;
  height: 60px; /* 固定高度，匹配缩略图尺寸 */
}
/* 左右切换按钮 - 悬浮在滚动区域上 */
.thumb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 30px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.thumb-btn:hover {
  opacity: 1;
}
.thumb-btn.left {
  left: 0; /* 左按钮贴左 */
}
.thumb-btn.right {
  right: 0; /* 右按钮贴右 */
}
/* 缩略图滚动区域 - 100%宽度，超出隐藏 */
.thumb-wrap {
  width: 100%; /* 关键：滚动区域占满100% */
  height: 100%;
  overflow: hidden; /* 超出宽度的缩略图隐藏 */
  padding: 0; /* 移除所有内边距 */
}
.thumb-list {
  display: flex;
  gap: 8px;
  transition: transform 0.3s ease; /* 滚动动画 */
  height: 100%;
}
.thumb-item {
  width: 60px;
  height: 100%; /* 继承容器高度，保证对齐 */
  border: 1px solid #ccc; /* 未选中/选中后 均为灰色边框 */
  cursor: pointer;
  box-sizing: border-box; /* 保证内边距不影响尺寸 */
  transition: all 0.2s ease; /* 动画过渡 */
  padding: 0; /* 未选中时无内边距 */
  flex-shrink: 0; /* 禁止收缩，保证尺寸 */
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 点击选中瞬间的红色边框 */
.thumb-item:active {
  border-color: #ff0036;
}
/* 选中状态：灰色边框 + 内边距区分 */
.thumb-item.active {
  border-color: #ccc;
  padding: 2px;
  background-color: #f5f5f5;
}
/* 鼠标悬停效果 */
.thumb-item:hover:not(.active) {
  border-color: #999;
}