/* =============================================
   产品中心样式
   ============================================= */

/* Products page layout */
.products-layout {
  padding: 40px 0;
  background: var(--bg-light);
  min-height: 400px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  text-align: center;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-card .img-wrap {
  width: 100%;
  padding-top: 100%;
  position: relative;
  background: #fff;
  overflow: hidden;
}

.product-card .img-wrap img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 75%;
  max-height: 75%;
  object-fit: contain;
  transition: transform 0.4s ease, opacity 0.45s ease;
}

/* hover 时切换到第二张图（laban 风格） */
.product-card .img-wrap img.img-alt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.product-card:hover .img-wrap img.img-main {
  opacity: 0;
}

.product-card:hover .img-wrap img.img-alt {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.03);
}

/* ===== 品牌筛选下拉框（位于分类列表前，与分类筛选共存） ===== */
.brand-filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
}

.brand-filter-bar .container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand-filter-label {
  font-size: 13px;
  color: var(--text-light);
  flex-shrink: 0;
}

.brand-select {
  min-width: 200px;
  max-width: 320px;
  padding: 8px 36px 8px 14px;
  font-size: 14px;
  color: var(--text-dark);
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.brand-select:hover {
  border-color: var(--primary);
}

.brand-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 100, 190, 0.12);
}

.brand-select option {
  color: var(--text-dark);
  background: #fff;
}

@media (max-width: 768px) {
  .brand-filter-bar .container {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .brand-select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
}

.product-card:hover .img-wrap img {
  transform: translate(-50%, -50%) scale(1.07);
}

.product-card .card-body {
  padding: 14px 12px;
}

.product-card .brand-name {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.product-card .product-name {
  font-size: 12px;
  color: var(--text-gray);
  line-height: 1.5;
  margin-bottom: 14px;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ==================== Product Detail ==================== */
.product-detail-layout {
  padding: 40px 0;
}

.product-detail-box {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
}

/* Detail container: vertical stack */
.product-detail-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Top subtitle line */
.product-detail-subtitle {
  font-size: 15px;
  color: var(--text-gray);
  font-weight: 400;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Section divider */
.detail-section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0 0 32px 0;
}

/* === Top: Gallery Section === */
.product-gallery {
  position: relative;
  max-width: 480px;
  margin: 0 auto 40px;
  width: 100%;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

.gallery-main img {
  max-width: 75%;
  max-height: 90%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.gallery-main img.fade-out {
  opacity: 0;
}

.gallery-prev, .gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 60px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 28px;
  color: #999;
  transition: color var(--transition);
  z-index: 5;
  font-family: serif;
  line-height: 1;
  padding: 0;
}

.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }

.gallery-prev:hover, .gallery-next:hover {
  color: var(--primary);
  background: transparent;
}

/* Thumbnail strip */
.gallery-thumbs {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
}

.gallery-thumb img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.gallery-thumb:hover {
  opacity: 0.85;
  border-color: var(--accent);
}

.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
}

/* === Bottom: Info Section === */
.product-info {
  width: 100%;
}

.detail-section-title {
  font-size: 14px;
  color: var(--text-gray);
  font-weight: 400;
  margin-bottom: 12px;
}

.product-info-header {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
  line-height: 1.4;
}

.product-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 60px;
}

.spec-item {
  display: flex;
  gap: 8px;
  font-size: 14px;
  line-height: 1.8;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.spec-label {
  color: var(--text-light);
  white-space: nowrap;
  min-width: 70px;
  flex-shrink: 0;
}

.spec-value {
  color: var(--text-dark);
  flex: 1;
}

/* ==================== Responsive ==================== */
@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-gallery {
    max-width: 100%;
  }
  .product-specs {
    gap: 0 32px;
  }
}

@media (max-width: 600px) {
  .product-specs {
    grid-template-columns: 1fr;
  }
  .product-detail-box {
    padding: 20px;
  }
  .product-info-header {
    font-size: 22px;
  }
  .gallery-thumb {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product-card .card-body {
    padding: 10px 8px;
  }
  .product-card .brand-name {
    font-size: 12px;
  }
  .product-card .product-name {
    font-size: 11px;
    height: 32px;
  }
  .product-detail-box {
    padding: 14px;
  }
  .product-info-header {
    font-size: 18px;
  }
  .gallery-thumb {
    width: 52px;
    height: 52px;
  }
  .spec-item {
    font-size: 13px;
  }
  .spec-label {
    min-width: 60px;
  }
}
