/* 商品详情页样式 */

/* 页面容器 */
.page-container {
  min-height: 100vh;
  margin-top: 45px;
  background-color: var(--light-color);
  position: relative;
}

/* 返回按钮 */
.back-button-container {
  position: fixed;
  top: 55px;
  left: 10px;
  z-index: 1000;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
  background-color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-icon {
  font-size: 16px;
}

/* 花色图片区 */
.image-section {
  margin-bottom: 10px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
}

.image-carousel-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.image-carousel {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
  width: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  background-color: #f8f8f8;
  transition: opacity 0.5s ease;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-control:hover {
  background-color: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-control.prev {
  left: 15px;
}

.carousel-control.next {
  right: 15px;
}

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  border: 2px solid white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator-dot.active {
  background-color: var(--accent-color);
  transform: scale(1.2);
}

/* 商品标题区 */
.title-section {
  padding: 20px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1%;
  flex-wrap: wrap;
}

.product-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.3;
  width: 66%;
  margin-bottom: 0;
  word-wrap: break-word;
  word-break: break-word;
}

.product-code {
  font-size: 14px;
  color: var(--secondary-color);
  margin-bottom: 5px;
}

.product-category {
  font-size: 14px;
  color: var(--secondary-color);
}

/* 商品详情文本区 */
.description-section,
.download-section,
.detail-section,
.recommendation-section {
  padding: 20px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

/* 移除描述区底部边距 */
.description-section {
  margin-bottom: 0;
}

.section-header {
  margin-bottom: 15px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 8px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

.description-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary-color);
  white-space: pre-line;
}

/* 高清原始图下载区 */
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  padding: 6px 12px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 15px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(146, 5, 8, 0.3);
  width: 20%;
  min-width: 90px;
  max-width: none;
  margin: 0;
  white-space: nowrap;
}

.download-icon {
  font-size: 9px;
}

.download-button:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(146, 5, 8, 0.4);
}

.download-icon {
  font-size: 9px;
}

/* 商品详情描述区 */
.detail-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary-color);
}

.detail-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px 0;
  border-radius: 4px;
}

.detail-content p {
  margin-bottom: 10px;
}

.detail-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 20px 0 10px;
}

.detail-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 15px 0 8px;
}

/* 同分类下其他花色推荐区 */
.recommendation-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.recommendation-item {
  background-color: var(--light-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  animation: fadeInUp 0.6s ease;
}

.recommendation-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.recommendation-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.recommendation-item:hover .recommendation-image {
  transform: scale(1.1);
}

.recommendation-title {
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--primary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 下载原图弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  z-index: 2001;
  animation: modalFadeIn 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--secondary-color);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--accent-color);
}

.modal-body {
  text-align: center;
}

.modal-image-container {
  margin-bottom: 10px;
}

.modal-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.modal-instruction {
  font-size: 14px;
  color: var(--secondary-color);
}

.instruction-text {
  margin: 0;
}

/* CSS3动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 为推荐商品设置不同的动画延迟 */
.recommendation-item:nth-child(1) { animation-delay: 0.1s; }
.recommendation-item:nth-child(2) { animation-delay: 0.2s; }
.recommendation-item:nth-child(3) { animation-delay: 0.3s; }
.recommendation-item:nth-child(4) { animation-delay: 0.4s; }
.recommendation-item:nth-child(5) { animation-delay: 0.5s; }
.recommendation-item:nth-child(6) { animation-delay: 0.6s; }

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .image-carousel-container {
    max-height: 400px;
    width: 100%;
  }
  
  .product-title {
    font-size: 20px;
  }
  
  .section-title {
    font-size: 16px;
  }
  
  .recommendation-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }
  
  .recommendation-image {
    height: 100px;
  }
}

@media (max-width: 480px) {
  .back-text {
    display: none;
  }
  
  .back-button {
    padding: 8px;
  }
  
  .image-carousel-container {
    max-height: 300px;
    width: 100%;
  }
  
  .title-section,
  .description-section,
  .download-section,
  .detail-section,
  .recommendation-section {
    padding: 15px;
  }
  
  .product-title {
    font-size: 18px;
  }
  
  .carousel-control {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .carousel-control.prev {
    left: 10px;
  }
  
  .carousel-control.next {
    right: 10px;
  }
  
  .download-button {
    padding: 6px 12px;
    font-size: 10px;
  }
  
  .recommendation-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .recommendation-image {
    height: 80px;
  }
  
  .recommendation-title {
    font-size: 11px;
    padding: 8px;
  }
}

/* 认证图片区 */
.cert-section {
  font-size: initial; /* 重置继承的字体大小 */
}

.cert-button {
  border: none; /* 移除边框 */
  background: none; /* 移除默认背景 */
  padding: 0; /* 移除默认内边距 */
  cursor: pointer; /* 保持指针样式 */
}

/* 辅助类 */
.hidden {
  display: none !important;
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--light-color);
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}