/* ============ 产品中心专用样式补充 ============ */

/* 产品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* 产品卡片 */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-lg, 24px);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

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

.product-card-image {
  aspect-ratio: 4 / 3;
  background: var(--color-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.03);
}

.product-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-code {
  font-size: 12px;
  color: var(--color-text-light);
  margin-bottom: var(--space-1);
}

.product-card-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.product-card-spec {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: var(--space-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.product-card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
}

.product-card-price .unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-light);
  margin-left: 2px;
}

.product-card-btn {
  padding: 8px 16px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.product-card-btn:hover {
  background: var(--color-accent-dark, #2E8B2B);
}

/* 详情页布局 */
.product-detail {
  padding: var(--space-7) 0;
  background: var(--color-bg-soft);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 900px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
}

.product-detail-gallery {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-detail-main-image {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
}

.product-detail-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail-thumbs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  overflow-x: auto;
}

.product-detail-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--color-bg-soft);
}

.product-detail-thumb.active {
  border-color: var(--color-accent);
}

.product-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail-info {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

.product-detail-code {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: var(--space-2);
}

.product-detail-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.product-detail-spec {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.product-detail-price-box {
  background: var(--color-bg-soft);
  border-radius: 16px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.product-detail-price-main {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.price-tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.price-tier-table th,
.price-tier-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.price-tier-table th {
  color: var(--color-text-light);
  font-weight: 600;
  background: rgba(34, 197, 94, 0.05);
}

.price-tier-table tr:last-child td {
  border-bottom: none;
}

.product-detail-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.product-detail-desc {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.product-detail-desc h3 {
  font-size: 18px;
  margin-bottom: var(--space-3);
}

.product-detail-desc p {
  color: var(--color-text-light);
  line-height: 1.8;
}

/* 详情页长图区（淘宝风格：图片垂直堆叠） */
.product-detail-images {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.product-detail-images h3 {
  font-size: 20px;
  margin-bottom: var(--space-4);
  font-weight: 700;
  color: var(--color-text);
}

.product-detail-images-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 800px;
  margin: 0 auto;
}

.product-detail-images-list img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  background: var(--color-bg-soft);
}

/* 弹窗 */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.product-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.product-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform 0.2s ease;
}

.product-modal-overlay.active .product-modal {
  transform: translateY(0);
}

.product-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.product-modal-title {
  font-size: 18px;
  font-weight: 700;
}

.product-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-light);
}

.product-modal-body {
  padding: var(--space-5);
}

.product-modal-product {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg-soft);
  border-radius: 16px;
}

.product-modal-product img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.product-modal-product-info {
  flex: 1;
}

.product-modal-product-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.product-modal-product-price {
  color: var(--color-accent);
  font-weight: 700;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.qty-control button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 18px;
}

.qty-control input {
  width: 70px;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.btn-primary:hover {
  background: var(--color-accent-dark, #2E8B2B);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--color-surface);
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: var(--color-bg-soft);
}

.modal-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.modal-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-light);
}

.modal-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.contact-info {
  background: var(--color-accent-soft);
  border-radius: 16px;
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.contact-info h4 {
  margin-bottom: var(--space-2);
}

.contact-info p {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 6px;
}

.success-message {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.success-message h3 {
  color: var(--color-accent);
  font-size: 20px;
  margin-bottom: var(--space-3);
}

/* 相关产品推荐 */
.related-products {
  padding: var(--space-7) 0;
  background: var(--color-surface);
}
