/* =========================================================
   DHgate-style product detail page (single product)
   Prefix: dg-
   ========================================================= */

.dg-product { max-width: 1200px; margin: 0 auto; padding: 24px 16px 40px; }

/* ---- 左图右信息（阿里巴巴式均衡两栏） ---- */
.dg-product-main {
  display: grid; grid-template-columns: 50% 1fr; gap: 32px;
  align-items: start;
}
.dg-gallery { position: sticky; top: 20px; }
.dg-gallery .woocommerce-product-gallery {
  margin: 0; background: #fff; border: 1px solid var(--line, #E5EAF1);
  border-radius: 12px; overflow: hidden;
}
.dg-gallery .woocommerce-product-gallery__wrapper { margin: 0; }
.dg-gallery .woocommerce-product-gallery__wrapper img {
  width: 100%; height: auto; display: block; aspect-ratio: 1 / 1; object-fit: cover;
}
.dg-gallery .flex-control-thumbs {
  display: flex; gap: 8px; list-style: none; margin: 0; padding: 12px;
}
.dg-gallery .flex-control-thumbs li { flex: 1; }
.dg-gallery .flex-control-thumbs img {
  aspect-ratio: 1 / 1; object-fit: cover; width: 100%; border-radius: 6px;
  border: 2px solid transparent; cursor: pointer;
}
.dg-gallery .flex-control-thumbs img.flex-active { border-color: var(--accent, #1B6FD8); }

/* ---- 右侧信息（紧凑，与左图高度均衡） ---- */
.dg-summary { display: flex; flex-direction: column; gap: 12px; }
.dg-title {
  margin: 0; font-size: 26px; font-weight: 800; line-height: 1.3;
  color: var(--ink, #0B2545);
}
.dg-sku { font-size: 13px; color: var(--ink-3, #7A8699); }

.dg-price-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--accent-soft, #E8F1FD); border: 1px solid #C9E0FB;
  border-radius: 10px; padding: 14px 18px;
}
.dg-price-row .price { margin: 0; }
.dg-price-row .price .amount {
  font-size: 30px; font-weight: 800; color: var(--accent, #1B6FD8);
}
.dg-price-row .price del .amount {
  font-size: 17px; font-weight: 400; color: var(--ink-3, #7A8699);
  text-decoration: line-through;
}
.dg-price-row .price ins { text-decoration: none; }
.dg-save {
  background: #E23744; color: #fff; font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
}

.dg-service-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.dg-service-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2, #4A5568);
}
.dg-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #10B981; color: #fff; font-size: 11px; flex: none;
}

/* ---- 购买区 ---- */
.dg-buy { margin-top: 4px; }
.dg-buy form.cart {
  display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap;
}
.dg-buy .quantity {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line, #E5EAF1); border-radius: 10px; overflow: hidden;
}
.dg-buy .quantity .qty {
  width: 64px; height: 52px; text-align: center; border: none; font-size: 16px;
  color: var(--ink, #0B2545); outline: none;
}
.dg-buy .single_add_to_cart_button {
  flex: 1; min-width: 200px; height: 52px; border: none; border-radius: 10px;
  background: var(--accent, #1B6FD8); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .2s, transform .15s;
}
.dg-buy .single_add_to_cart_button:hover { background: #155cb5; transform: translateY(-1px); }
.dg-buy .single_add_to_cart_button.disabled { opacity: .5; cursor: not-allowed; }
.dg-buy .added_to_cart {
  display: inline-block; margin-top: 8px; font-weight: 700; color: var(--accent, #1B6FD8);
}

.dg-pay {
  font-size: 13px; color: var(--ink-2, #4A5568);
  padding: 10px 14px; border: 1px dashed var(--line, #E5EAF1); border-radius: 8px;
}
.dg-pay span { font-weight: 600; color: var(--ink, #0B2545); }

.dg-desc {
  font-size: 14px; line-height: 1.7; color: var(--ink-2, #4A5568);
  border-top: 1px solid var(--line, #E5EAF1); padding-top: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- 详情 Tabs ---- */
.dg-tabs { margin-top: 44px; }
.dg-tabs .woocommerce-tabs { border: 1px solid var(--line, #E5EAF1); border-radius: 12px; overflow: hidden; }
.dg-tabs .tabs {
  display: flex; list-style: none; margin: 0; padding: 0;
  background: var(--bg-soft, #F5F8FC); border-bottom: 1px solid var(--line, #E5EAF1);
}
.dg-tabs .tabs li { margin: 0; }
.dg-tabs .tabs li a {
  display: block; padding: 14px 24px; font-size: 14px; font-weight: 600;
  color: var(--ink-2, #4A5568); text-decoration: none; border-bottom: 3px solid transparent;
}
.dg-tabs .tabs li.active a { color: var(--accent, #1B6FD8); border-bottom-color: var(--accent, #1B6FD8); }
.dg-tabs .woocommerce-Tabs-panel { padding: 22px 24px; font-size: 14px; line-height: 1.75; color: var(--ink-2, #4A5568); }

/* ---- 相关产品（阿里 Frequently bought together 式横排） ---- */
.dg-product .related { margin-top: 48px; }
.dg-product .related > h2 {
  font-size: 22px; font-weight: 800; color: var(--ink, #0B2545); margin: 0 0 20px;
}
.dg-product .related ul.products {
  list-style: none; margin: 0; padding: 0 0 4px;
  display: flex; flex-wrap: wrap; gap: 16px;
}
.dg-product .related ul.products::before,
.dg-product .related ul.products::after { content: none !important; display: none !important; }
.dg-product .related ul.products::-webkit-scrollbar { height: 5px; }
.dg-product .related ul.products::-webkit-scrollbar-thumb { background: #D7DFEA; border-radius: 4px; }
.dg-product .related ul.products li.product {
  flex: 0 0 calc(25% - 12px); min-width: 0;
  width: auto !important; float: none !important;
  margin: 0; background: #fff; border: 1px solid var(--line, #E5EAF1);
  border-radius: 10px; overflow: hidden; transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.dg-product .related ul.products li.product:hover { box-shadow: 0 10px 26px rgba(11,37,69,.10); transform: translateY(-2px); }
.dg-product .related ul.products .woocommerce-LoopProduct-link { display: block; text-decoration: none; }
.dg-product .related ul.products a img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; margin: 0;
}
.dg-product .related ul.products .woocommerce-loop-product__title {
  font-size: 12.5px; font-weight: 600; color: var(--ink, #0B2545);
  padding: 5px 12px 0; margin: 0; line-height: 1.3; min-height: 22px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dg-product .related ul.products .price {
  display: block; padding: 1px 12px 1px; color: var(--accent, #1B6FD8);
  font-size: 13.5px; font-weight: 700; min-height: 22px; box-sizing: border-box;
}
.dg-product .related ul.products .price del { color: var(--ink-3, #7A8699); font-weight: 400; opacity: 1; }
.dg-product .related ul.products .button {
  margin-top: auto; margin-left: 12px; margin-right: 12px; margin-bottom: 5px;
  display: block; text-align: center; padding: 5px 0; border-radius: 8px;
  background: var(--accent, #1B6FD8); color: #fff;
  font-size: 12.5px; font-weight: 700; text-decoration: none;
}
.dg-product .related ul.products .button:hover { background: #155cb5; }
.dg-product .related ul.products .added_to_cart {
  margin-top: auto; margin-left: 12px; margin-right: 12px; margin-bottom: 5px;
  display: block; text-align: center; padding: 5px 0; border-radius: 8px;
  background: var(--accent, #1B6FD8); color: #fff;
  font-size: 12.5px; font-weight: 700; text-decoration: none;
}

/* ---- 阿里巴巴式：按类目寻源（圆图标分类导航） ---- */
.dg-cat-nav { margin-top: 48px; }
.dg-cat-nav > h2 {
  font-size: 22px; font-weight: 800; color: var(--ink, #0B2545); margin: 0 0 20px;
}
.dg-cat-nav-inner {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: thin;
}
.dg-cat-nav-inner::-webkit-scrollbar { height: 5px; }
.dg-cat-nav-inner::-webkit-scrollbar-thumb { background: #D7DFEA; border-radius: 4px; }
.dg-cat-item {
  flex: 0 0 auto; width: 104px; text-align: center; text-decoration: none;
  transition: transform .18s;
}
.dg-cat-ico {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; line-height: 1; color: #fff;
  box-shadow: 0 4px 10px rgba(11,37,69,.10);
  transition: box-shadow .18s, transform .18s;
}
.dg-cat-item:hover .dg-cat-ico { transform: scale(1.07); box-shadow: 0 10px 20px rgba(11,37,69,.18); }
.dg-cat-item:hover .dg-cat-name { color: var(--accent, #1B6FD8); }
.dg-cat-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2, #4A5568); line-height: 1.3; transition: color .15s; }
.dg-cat-more-ico { font-size: 34px; font-weight: 700; background: linear-gradient(135deg, #E2E8F0, #CBD5E1); }

/* ---- 阿里巴巴式：相关产品卡片（MOQ + 评分行） ---- */
.dg-card-moq {
  padding: 0 12px 0; font-size: 11.5px; color: var(--ink-3, #7A8699);
}
.dg-card-meta {
  padding: 0 12px 2px; font-size: 11.5px; color: #F59E0B;
}
.dg-card-meta b { color: var(--ink-2, #4A5568); font-weight: 600; margin-left: 2px; }

/* 阿里式：店铺行（品牌 + Verified 蓝标） */
.dg-card-store {
  padding: 0 12px 2px; display: flex; align-items: center; gap: 6px;
}
.dg-card-brand { font-size: 11.5px; font-weight: 700; color: var(--ink, #0B2545); }
.dg-card-verified {
  font-size: 10.5px; font-weight: 600; color: var(--accent, #1B6FD8);
  background: #EAF2FD; border: 1px solid #D4E4FB; border-radius: 4px; padding: 0 5px;
}

/* 阿里式：售后保障标签 */
.dg-card-return {
  padding: 0 12px 2px; font-size: 11.5px; font-weight: 600; color: #059669;
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .dg-product-main { grid-template-columns: 1fr; gap: 20px; }
  .dg-gallery { position: static; }
  .dg-service-list { grid-template-columns: 1fr; }
  .dg-title { font-size: 22px; }
  .dg-buy .single_add_to_cart_button { min-width: 160px; }
}

/* 相关产品固定两排（桌面/平板 4 列 → 8 个 = 4+4；仅手机窄屏 2 列） */
@media (max-width: 560px) {
  .dg-product .related ul.products li.product { flex-basis: calc(50% - 8px); }
}

/* ---- 阿里巴巴式：面包屑 / 发货信息 / Specifications 规格表 ---- */
/* 详情页头部导航随页面上下滚动（不固定） */
body.single-product header.site-header {
  position: static !important;
}
.dg-product .woocommerce-breadcrumb {
  font-size: 12px; color: var(--ink-3, #7A8699); margin: 0 0 14px; padding: 0;
}
.dg-product .woocommerce-breadcrumb a { color: var(--accent, #1B6FD8); text-decoration: none; }

.dg-ship {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #F5F8FC; border: 1px dashed var(--line, #D7DFEA);
  border-radius: 8px; padding: 9px 14px; margin: 2px 0 12px;
}
.dg-ship-tag {
  background: #16A34A; color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 4px; white-space: nowrap;
}
.dg-ship-txt { font-size: 13px; color: var(--ink-2, #4A5568); }

/* Specifications 规格表（阿里巴巴 Key Specifications 风格） */
.dg-specs {
  width: 100%; max-width: 720px; border-collapse: collapse; margin: 4px 0 8px;
}
.dg-specs th, .dg-specs td {
  border: 1px solid var(--line, #E5EAF1); padding: 10px 14px; font-size: 13px;
  text-align: left;
}
.dg-specs th { background: #F5F8FC; color: var(--ink, #0B2545); font-weight: 700; width: 200px; }
.dg-specs td { color: var(--ink-2, #4A5568); }
.dg-specs tr:nth-child(even) td { background: #FAFBFC; }

/* ---- 阿里巴巴式：阶梯价格 + MOQ 起订量 ---- */
.dg-tier {
  background: #fff; border: 1px solid var(--line, #E5EAF1);
  border-radius: 8px; padding: 12px 14px; margin: 14px 0 4px;
}
.dg-tier-h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--ink, #0B2545); margin-bottom: 8px;
}
.dg-moq { font-weight: 400; color: var(--ink-3, #7A8699); font-size: 12px; }
.dg-moq b { color: var(--accent, #1B6FD8); font-weight: 700; }
.dg-tier-t { width: 100%; border-collapse: collapse; }
.dg-tier-t th, .dg-tier-t td {
  border: 1px solid var(--line, #E5EAF1); padding: 7px 10px; font-size: 13px; text-align: left;
}
.dg-tier-t th { background: #F5F8FC; color: var(--ink, #0B2545); font-weight: 700; }
.dg-tier-t td { color: var(--ink-2, #4A5568); }
.dg-tier-t td:last-child { color: var(--accent, #1B6FD8); font-weight: 700; }

/* ---- 阿里巴巴式：SKU 规格选择 ---- */
.dg-sku-select { margin: 12px 0 4px; }
.dg-sku-label { font-size: 13px; color: var(--ink-2, #4A5568); margin-bottom: 8px; }
.dg-sku-opt { color: var(--ink, #0B2545); font-weight: 700; }
.dg-sku-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-sku-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line, #D7DFEA); border-radius: 6px;
  background: #fff; padding: 6px 10px; font-size: 13px; color: var(--ink-2, #4A5568);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.dg-sku-btn:hover { border-color: var(--accent, #1B6FD8); }
.dg-sku-btn.is-active { border-color: var(--accent, #1B6FD8); color: var(--accent, #1B6FD8); font-weight: 700; }
.dg-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-block; }

/* ---- 阿里巴巴式：店铺卡片 ---- */
.dg-store {
  background: #F5F8FC; border: 1px solid var(--line, #E5EAF1);
  border-radius: 8px; padding: 14px; margin: 16px 0 4px;
}
.dg-store-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dg-store-logo {
  width: 42px; height: 42px; border-radius: 8px; background: linear-gradient(135deg, #1B6FD8, #0B2545);
  color: #fff; font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none;
}
.dg-store-name { font-size: 14px; font-weight: 800; color: var(--ink, #0B2545); }
.dg-store-stars { font-size: 12px; color: #F59E0B; }
.dg-store-stars span { color: var(--ink, #0B2545); font-weight: 700; margin-left: 4px; }
.dg-store-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0;
  text-align: center;
}
.dg-store-stats b { display: block; font-size: 15px; color: var(--ink, #0B2545); }
.dg-store-stats span { font-size: 11px; color: var(--ink-3, #7A8699); }
.dg-store-follow {
  width: 100%; border: 1px solid var(--accent, #1B6FD8); background: #fff;
  color: var(--accent, #1B6FD8); border-radius: 6px; padding: 8px 0;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s;
}
.dg-store-follow:hover { background: var(--accent, #1B6FD8); color: #fff; }
.dg-store-follow.is-following { background: var(--accent, #1B6FD8); color: #fff; }
