/* ============================================================
   product-detail.css — 产品详情页专属样式 v4.0
   设计方向：运动奢华 · 深色基调 · 金色点缀
   依赖: base.css (--sg-* 变量) + components.css (共享组件)
   ============================================================ */

/* ========== 产品整体布局 (双栏) ========== */
.sg-product-page {
  max-width: var(--sg-max-width, 1200px);
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  position: relative;
}

/* ========== 左栏：产品图片 ========== */
.sg-product-images {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 88px;
  align-self: start;
}

.sg-product-main-image {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border: 1px solid rgba(245,197,24,0.1);
}

.sg-product-main-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(245,197,24,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.sg-product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 0;
}

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

.sg-product-main-image .sg-img-loading {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(245,197,24,0.15);
  border-top-color: var(--sg-accent, #f5c518);
  border-radius: 50%;
  animation: sg-spin 0.7s linear infinite;
  z-index: 2;
}

/* 缩略图区域 */
.sg-product-thumbnails {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sg-product-thumbnails .thumb {
  width: 76px;
  height: 76px;
  background: #1a1a2e;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.sg-product-thumbnails .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.sg-product-thumbnails .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.sg-product-thumbnails .thumb.active {
  border-color: var(--sg-accent, #f5c518);
  box-shadow: 0 0 20px rgba(245,197,24,0.2);
}

.sg-product-thumbnails .thumb.active::after {
  opacity: 0;
}

.sg-product-thumbnails .thumb:hover {
  border-color: rgba(245,197,24,0.4);
  transform: translateY(-2px);
}

.sg-product-thumbnails .thumb:hover::after {
  opacity: 1;
}

/* ========== 右栏：产品信息 ========== */
.sg-product-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 分类标签 */
.sg-product-category {
  font-size: 11px;
  color: var(--sg-accent, #f5c518);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(245,197,24,0.08);
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  align-self: flex-start;
  border: 1px solid rgba(245,197,24,0.15);
}

/* 标题 */
.sg-product-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--sg-text, #1a1a2e);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.3px;
}

/* Meta (SKU + 库存) */
.sg-product-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--sg-text-muted, #64748b);
  padding: 12px 0;
  border-top: 1px solid var(--sg-border-subtle, #e2e8f0);
  border-bottom: 1px solid var(--sg-border-subtle, #e2e8f0);
}

.sg-product-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========== 参考价 ========== */
.sg-reference-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(245,197,24,0.06) 0%, rgba(245,197,24,0.02) 100%);
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(245,197,24,0.1);
}

.sg-reference-price .sg-price-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--sg-accent, #f5c518);
  line-height: 1;
  letter-spacing: -1px;
}

.sg-reference-price .sg-price-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-text, #1a1a2e);
}

.sg-reference-price .sg-price-hint {
  font-size: 11px;
  color: var(--sg-text-dim, #94a3b8);
  width: 100%;
  margin-top: 2px;
}

/* ========== 信任背书 ========== */
.sg-trust-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(245,197,24,0.12);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  gap: 0;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.sg-trust-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245,197,24,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.sg-trust-stat {
  text-align: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.sg-trust-stat .number {
  font-size: 24px;
  font-weight: 900;
  color: var(--sg-accent, #f5c518);
  letter-spacing: -0.5px;
}

.sg-trust-stat .label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
  font-weight: 500;
}

.sg-trust-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ========== 尺码选择 ========== */
.sg-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--sg-text, #1a1a2e);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-section-label .badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(245,197,24,0.12);
  color: var(--sg-accent, #f5c518);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sg-size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sg-size-btn {
  min-width: 54px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--sg-border-light, #cbd5e1);
  background: var(--sg-bg-card, #f8fafc);
  color: var(--sg-text, #1a1a2e);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  line-height: 1;
  position: relative;
}

.sg-size-btn:hover {
  border-color: var(--sg-accent, #f5c518);
  background: rgba(245,197,24,0.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,197,24,0.1);
}

.sg-size-btn.selected {
  border-color: var(--sg-accent, #f5c518);
  background: linear-gradient(135deg, rgba(245,197,24,0.12) 0%, rgba(245,197,24,0.06) 100%);
  color: var(--sg-accent, #f5c518);
  box-shadow: 0 4px 16px rgba(245,197,24,0.15);
}

/* ========== 多尺码数量选择器 ========== */
.sg-size-qty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.sg-size-qty-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sg-size-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-text-muted, #64748b);
}

.sg-size-qty-input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--sg-border-light, #cbd5e1);
  background: var(--sg-bg-card, #f8fafc);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--sg-text, #1a1a2e);
  transition: all 0.2s ease;
  -moz-appearance: textfield;
}

.sg-size-qty-input::-webkit-outer-spin-button,
.sg-size-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sg-size-qty-input:focus {
  outline: none;
  border-color: var(--sg-accent, #f5c518);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}

.sg-size-qty-input:not(:placeholder-shown) {
  border-color: var(--sg-accent, #f5c518);
  background: rgba(245,197,24,0.04);
}

.sg-size-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--sg-text-muted, #64748b);
}

.sg-total-qty {
  font-weight: 700;
  color: var(--sg-accent, #f5c518);
}

/* ========== 定制区域 ========== */
.sg-custom-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  border: 1px solid var(--sg-border-subtle, #e2e8f0);
  padding: 24px;
}

.sg-custom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.sg-custom-row:last-child {
  margin-bottom: 0;
}

.sg-custom-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sg-custom-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--sg-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sg-custom-field input,
.sg-custom-field select {
  width: 100%;
  padding: 11px 14px;
  background: var(--sg-bg-page, #ffffff);
  border: 1.5px solid var(--sg-border-light, #cbd5e1);
  border-radius: 10px;
  color: var(--sg-text, #1a1a2e);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
}

.sg-custom-field input:focus,
.sg-custom-field select:focus {
  border-color: var(--sg-accent, #f5c518);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.1);
}

.sg-custom-field input::placeholder {
  color: var(--sg-text-dim, #94a3b8);
  font-weight: 400;
}

.sg-custom-field .hint {
  font-size: 11px;
  color: var(--sg-text-dim, #94a3b8);
  font-weight: 400;
}

/* Custom Logo 区域（旧版占位） */
.sg-custom-logo-box {
  display: none;
}

/* ========== Logo 上传区域 ========== */
.sg-custom-field-full {
  grid-column: 1 / -1;
}

.sg-logo-upload-area {
  position: relative;
  width: 100%;
  min-height: 80px;
  border: 2px dashed rgba(245,197,24,0.3);
  border-radius: 12px;
  background: rgba(245,197,24,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.sg-logo-upload-area:hover {
  border-color: var(--sg-accent, #f5c518);
  background: rgba(245,197,24,0.06);
}

.sg-logo-upload-area .sg-custom-logo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.sg-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  color: var(--sg-text-dim, #94a3b8);
  font-size: 13px;
  font-weight: 500;
}

.sg-logo-placeholder span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-logo-preview {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  position: relative;
  z-index: 1;
  width: 100%;
}

.sg-logo-preview img {
  max-height: 60px;
  max-width: 120px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--sg-border-subtle, #e2e8f0);
  background: #fff;
}

.sg-logo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
}

.sg-logo-remove:hover {
  background: rgba(220,38,38,0.8);
}

/* ========== 数量 & 按钮组 ========== */
.sg-add-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sg-add-section .sg-qty-control {
  display: flex;
  align-items: center;
  background: var(--sg-bg-card, #f8fafc);
  border: 1.5px solid var(--sg-border-light, #cbd5e1);
  border-radius: 12px;
  overflow: hidden;
  width: fit-content;
}

.sg-add-section .sg-qty-btn {
  width: 44px;
  height: 50px;
  border: none;
  background: transparent;
  color: var(--sg-text, #1a1a2e);
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sg-add-section .sg-qty-btn:hover {
  background: rgba(245,197,24,0.08);
}

.sg-add-section .sg-qty-input {
  width: 58px;
  height: 50px;
  border: none;
  border-left: 1px solid var(--sg-border-subtle, #e2e8f0);
  border-right: 1px solid var(--sg-border-subtle, #e2e8f0);
  background: transparent;
  color: var(--sg-text, #1a1a2e);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

/* 按钮组：Add to Cart + Get Quote */
.sg-btn-group {
  display: flex;
  gap: 12px;
  width: 100%;
}

.sg-btn-primary,
.sg-btn-secondary {
  flex: 1;
  height: 50px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  letter-spacing: 0.3px;
}

.sg-btn-primary {
  border: none;
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  color: #fff;
}

.sg-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,115,232,0.3);
}

.sg-btn-secondary {
  background: #fff;
  color: #1a73e8;
  border: 2px solid #1a73e8;
}

.sg-btn-secondary:hover {
  background: #e8f0fe;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26,115,232,0.15);
}

.sg-btn-primary.sg-processing,
.sg-btn-secondary.sg-processing {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========== 业务流程引导 ========== */
.sg-flow-hint {
  background: linear-gradient(135deg, rgba(37,211,102,0.06) 0%, rgba(37,211,102,0.02) 100%);
  border: 1px solid rgba(37,211,102,0.12);
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 13px;
  color: var(--sg-text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sg-flow-hint .flow-steps {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.sg-flow-step {
  background: rgba(37,211,102,0.08);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
  border: 1px solid rgba(37,211,102,0.1);
}

.sg-flow-arrow {
  color: var(--sg-text-dim, #94a3b8);
  font-size: 13px;
  font-weight: 300;
}

/* ========== 尺码表区域 (全宽) ========== */
.sg-size-chart-section {
  max-width: var(--sg-max-width, 1200px);
  margin: 0 auto;
  padding: 0 20px 80px;
}

.sg-size-chart-card {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 20px;
  border: 1px solid var(--sg-border-subtle, #e2e8f0);
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.sg-size-chart-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(245,197,24,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.sg-size-chart-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--sg-text, #1a1a2e);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.sg-size-chart-subtitle {
  font-size: 13px;
  color: var(--sg-text-muted, #64748b);
  margin-bottom: 28px;
}

.sg-chart-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--sg-bg-card2, #f1f5f9);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}

.sg-chart-tab {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-text-dim, #94a3b8);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  background: none;
  border: none;
  white-space: nowrap;
}

.sg-chart-tab:hover {
  color: var(--sg-text-muted, #64748b);
}

.sg-chart-tab.active {
  color: var(--sg-text, #1a1a2e);
  background: var(--sg-bg-page, #ffffff);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sg-chart-table-wrapper {
  overflow-x: auto;
}

.sg-chart-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.sg-chart-table thead th {
  background: #1a1a2e;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  text-align: center;
  white-space: nowrap;
}

.sg-chart-table thead th:first-child {
  text-align: left;
  border-radius: 10px 0 0 0;
}

.sg-chart-table thead th:last-child {
  border-radius: 0 10px 0 0;
}

.sg-chart-table tbody td {
  padding: 13px 16px;
  text-align: center;
  border-bottom: 1px solid var(--sg-border-subtle, #e2e8f0);
  color: var(--sg-text, #1a1a2e);
  font-weight: 500;
}

.sg-chart-table tbody td:first-child {
  font-weight: 800;
  color: var(--sg-accent, #f5c518);
  text-align: left;
}

.sg-chart-table tbody tr:hover td {
  background: rgba(245,197,24,0.03);
}

.sg-chart-table tbody tr:last-child td {
  border-bottom: none;
}

.sg-chart-note {
  font-size: 12px;
  color: var(--sg-text-dim, #94a3b8);
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(245,197,24,0.04);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(245,197,24,0.08);
}

/* ========== 面包屑 ========== */
.sg-breadcrumb {
  max-width: var(--sg-max-width, 1200px);
  margin: 0 auto;
  padding: 16px 20px 0;
  font-size: 12px;
  color: var(--sg-text-dim, #94a3b8);
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.sg-breadcrumb a {
  color: var(--sg-text-muted, #64748b);
  text-decoration: none;
  transition: color 0.2s;
}

.sg-breadcrumb a:hover {
  color: var(--sg-accent, #f5c518);
}

.sg-breadcrumb span {
  color: var(--sg-text, #1a1a2e);
  font-weight: 600;
}

/* ========== 隐藏 WooCommerce 默认区域 ========== */
.woocommerce-tabs,
.wc-tabs-wrapper,
div.woocommerce-Tabs-panel,
ul.tabs {
  display: none !important;
}
.sg-product-source {
  display: none !important;
}
.product_meta .posted_in,
.product_meta .tagged_as {
  display: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .sg-product-page {
    gap: 36px;
  }
  .sg-product-title {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .sg-product-page {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 20px 16px 60px;
  }

  .sg-product-images {
    position: static;
  }

  .sg-product-main-image {
    border-radius: 16px;
  }

  .sg-product-thumbnails .thumb {
    width: 64px;
    height: 64px;
  }

  .sg-product-title {
    font-size: 22px;
  }

  .sg-trust-banner {
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
  }

  .sg-trust-divider {
    width: 100%;
    height: 1px;
  }

  .sg-custom-row {
    grid-template-columns: 1fr;
  }

  .sg-add-section {
    flex-direction: column;
  }

  .sg-btn-group {
    flex-direction: column;
  }

  .sg-flow-hint {
    flex-direction: column;
    text-align: center;
  }

  .sg-flow-hint .flow-steps {
    justify-content: center;
  }

  .sg-size-chart-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .sg-chart-tabs {
    overflow-x: auto;
    width: 100%;
  }

  .sg-chart-tab {
    white-space: nowrap;
  }

  .sg-reference-price {
    padding: 14px 16px;
  }

  .sg-reference-price .sg-price-value {
    font-size: 28px;
  }

  .sg-custom-section {
    padding: 20px;
  }

  .sg-breadcrumb {
    padding: 12px 16px 0;
  }
}

@media (max-width: 375px) {
  .sg-product-page {
    padding: 16px 12px 48px;
    gap: 24px;
  }

  .sg-product-title {
    font-size: 20px;
  }

  .sg-product-thumbnails .thumb {
    width: 56px;
    height: 56px;
  }

  .sg-size-btn {
    min-width: 48px;
    height: 40px;
    font-size: 13px;
    padding: 0 12px;
  }

  .sg-add-section .sg-qty-btn {
    width: 40px;
    height: 46px;
  }

  .sg-add-section .sg-qty-input {
    width: 50px;
    height: 46px;
  }

  .sg-btn-primary,
  .sg-btn-secondary {
    height: 46px;
    font-size: 14px;
  }

  .sg-size-chart-card {
    padding: 20px 16px;
  }

  .sg-chart-table thead th,
  .sg-chart-table tbody td {
    padding: 10px 12px;
    font-size: 12px;
  }
}
