/* ============================================================
   商品详情页样式（依赖 style.css 的基础变量与组件）
   ============================================================ */

/* 简易头部 */
.detail-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 60; }
.dh-inner { display: flex; align-items: center; gap: 28px; height: 76px; }
.dh-search { flex: 1; max-width: 520px; display: flex; }
.dh-search input {
  flex: 1; height: 40px; border: 2px solid var(--primary); border-right: none;
  border-radius: 20px 0 0 20px; padding: 0 18px; outline: none; font-size: 14px;
}
.dh-search button {
  width: 70px; height: 40px; background: var(--primary); color: #fff; border-radius: 0 20px 20px 0; font-size: 15px;
}
.dh-search button:hover { background: var(--primary-d); }
.dh-cart {
  margin-left: auto; display: flex; align-items: center; gap: 7px; padding: 9px 20px;
  border-radius: 20px; border: 1px solid var(--border); font-size: 14px; color: var(--text-2);
}
.dh-cart:hover { border-color: var(--primary); color: var(--primary); }
.dh-cart em {
  min-width: 20px; height: 20px; padding: 0 6px; background: var(--accent); color: #fff;
  border-radius: 10px; font-style: normal; font-size: 12px; display: grid; place-items: center;
}

/* 面包屑 */
.crumb { padding: 16px 0; font-size: 13px; color: var(--text-3); }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--primary); }

/* 主区 */
.pd-main {
  display: grid; grid-template-columns: 440px 1fr; gap: 32px;
  background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.pd-loading { padding: 90px 0; text-align: center; color: var(--text-3); grid-column: 1 / -1; }

.pd-gallery { }
.pd-big {
  width: 100%; aspect-ratio: 1/0.8; background: #f8fafc; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.pd-big img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s; }
.pd-big:hover img { transform: scale(1.05); }
.pd-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: linear-gradient(135deg, #f43f5e, #f97316); color: #fff;
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
}
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pd-thumb {
  width: 74px; height: 74px; border: 2px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #f8fafc; cursor: pointer; padding: 4px; transition: .2s;
}
.pd-thumb:hover, .pd-thumb.active { border-color: var(--primary); }
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-share { display: flex; gap: 16px; margin-top: 16px; font-size: 13px; color: var(--text-3); }
.pd-share span { cursor: pointer; }
.pd-share span:hover { color: var(--primary); }

/* 信息区 */
.pd-info h1 { font-size: 23px; line-height: 1.45; margin-bottom: 8px; }
.pd-sub { font-size: 13px; color: var(--accent); margin-bottom: 14px; }
.pd-meta-row {
  display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--text-3);
  padding-bottom: 14px; border-bottom: 1px dashed var(--border); margin-bottom: 16px;
}
.pd-meta-row b { color: var(--orange); }

.pd-price-box {
  background: linear-gradient(100deg, #fff1f2, #fef2f2 60%, #fff7ed);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 16px;
}
.pd-price-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pd-price-line .label { font-size: 13px; color: var(--text-2); width: 52px; }
.pd-price-line .cur { color: var(--accent); font-size: 34px; font-weight: 800; line-height: 1; }
.pd-price-line .cur small { font-size: 17px; }
.pd-price-line .ori { font-size: 14px; color: var(--text-3); text-decoration: line-through; }
.pd-price-line .off {
  background: var(--accent); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 12px; font-weight: 600;
}
.pd-price-extra { display: flex; gap: 18px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.pd-price-extra b { color: var(--accent); }

.pd-coupons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-coupon {
  font-size: 12px; color: var(--accent); border: 1px dashed var(--accent);
  padding: 4px 12px; border-radius: 4px; background: #fff;
}

.pd-row { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.pd-row > .k { width: 52px; flex-shrink: 0; font-size: 13px; color: var(--text-3); line-height: 32px; }
.pd-row > .v { flex: 1; }
.pd-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-opt {
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  color: var(--text-2); background: #fff; transition: .18s; cursor: pointer;
}
.pd-opt:hover { border-color: var(--primary); color: var(--primary); }
.pd-opt.active { border-color: var(--primary); background: var(--primary-l); color: var(--primary); font-weight: 600; }

.pd-ship { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.pd-ship b { color: var(--text); }
.pd-ship .free { color: var(--green); font-weight: 600; }

.pd-qty { display: flex; align-items: center; gap: 0; }
.pd-qty button {
  width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; font-size: 17px; color: var(--text-2);
}
.pd-qty button:first-child { border-radius: 8px 0 0 8px; }
.pd-qty button:last-child { border-radius: 0 8px 8px 0; }
.pd-qty button:hover { color: var(--primary); border-color: var(--primary); }
.pd-qty input {
  width: 56px; height: 34px; text-align: center; border: 1px solid var(--border);
  border-left: none; border-right: none; border-radius: 0; font-size: 14px;
}
.pd-stock { font-size: 12.5px; color: var(--text-3); margin-left: 12px; }

.pd-actions { display: flex; gap: 14px; margin: 22px 0 16px; }
.pd-btn-cart, .pd-btn-buy { height: 50px; border-radius: 25px; font-size: 16px; font-weight: 600; padding: 0 40px; }
.pd-btn-cart { background: var(--primary-l); color: var(--primary); border: 1px solid #bfdbfe; }
.pd-btn-cart:hover { background: #dbeafe; }
.pd-btn-buy { background: linear-gradient(135deg, #f43f5e, #f97316); color: #fff; }
.pd-btn-buy:hover { box-shadow: 0 10px 24px rgba(244,63,94,.32); }

.pd-promise { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.pd-promise span::before { content: "✓ "; color: var(--green); font-weight: 700; }

/* 下半区 */
.pd-lower { display: grid; grid-template-columns: 1fr 300px; gap: 18px; margin-top: 20px; align-items: start; }
.pd-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.pd-card-head { display: flex; align-items: center; gap: 6px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.pd-card-head h3 { font-size: 16px; padding: 15px 0; }
.pd-card-head h3 span { font-size: 12.5px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.pd-tab {
  padding: 15px 18px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.pd-tab:hover { color: var(--primary); }
.pd-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.pd-card-body { padding: 20px; }

.spec-table { width: 100%; }
.spec-table td { padding: 10px 12px; font-size: 13.5px; border-bottom: 1px solid #f1f5f9; }
.spec-table td:first-child { width: 130px; color: var(--text-3); background: #fafbfd; }
.spec-table tr:last-child td { border-bottom: none; }

.desc-block { font-size: 14px; line-height: 2; color: var(--text-2); }
.desc-block h4 { font-size: 15px; color: var(--text); margin: 18px 0 8px; }
.desc-block h4:first-child { margin-top: 0; }
.desc-block ul { padding-left: 20px; list-style: disc; }
.pack-list { font-size: 14px; line-height: 2.1; color: var(--text-2); }
.pack-list li::before { content: "· "; color: var(--primary); font-weight: 700; }

/* 评价 */
.review-item { padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.review-item:last-child { border-bottom: none; }
.rv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rv-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-l); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.rv-name { font-size: 13.5px; font-weight: 600; }
.rv-stars { color: var(--orange); font-size: 13px; }
.rv-date { margin-left: auto; font-size: 12px; color: var(--text-3); }
.rv-text { font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.rv-spec { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* 推荐 */
.rec-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.rec-item:last-child { border-bottom: none; }
.rec-item:hover .rec-name { color: var(--primary); }
.rec-item img { width: 68px; height: 68px; object-fit: contain; background: #f8fafc; border-radius: 8px; flex-shrink: 0; }
.rec-name { font-size: 13px; line-height: 1.5; height: 39px; overflow: hidden; }
.rec-price { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.rec-sales { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

@media (max-width: 1000px) {
  .pd-main { grid-template-columns: 1fr; }
  .pd-lower { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dh-search, .dh-inner .logo-text { display: none; }
  .pd-actions { flex-direction: column; }
  .pd-btn-cart, .pd-btn-buy { width: 100%; padding: 0; }
}
