/* DingZ BIO 产品页 v2 —— 只在启用 v2 的商品页加载；所有规则都挂在 html.dzb-v2 下（由脚本加上），
   脚本没运行或进入编辑模式时页面保持原样。主色沿用全站 --dzb-primary。 */
#dzb2_body, .dzb2-sticky, .dzb2-top, .dzb2-tagline, .dzb2-chips, .dzb2-trust, .dzb2-ghost { display: none; }

html.dzb-v2 {
  --dzb2-r: 16px;
  --dzb2-line: #e5e7eb;
  --dzb2-ink: #111827;
  --dzb2-g1: #374151;
  --dzb2-g2: #6b7280;
}

/* ── 顶部：去掉图片上方的搜索框（页头已有），面包屑占满一行 ── */
html.dzb-v2 #product_detail > .row:first-child > div:first-child { display: none !important; }
html.dzb-v2 #product_detail > .row:first-child > div:last-child { flex: 0 0 100%; max-width: 100%; }
html.dzb-v2 #product_detail .breadcrumb { font-size: 13px; }

/* ── 图片：浅色渐变圆角卡片 + 现货角标 ── */
html.dzb-v2 .o_wsale_product_images { position: relative; }
/* 商品照片本身带灰底：让照片铺满方形圆角卡片，不再「框里套框」 */
html.dzb-v2 #o-carousel-product .o_carousel_product_outer {
  height: auto !important; aspect-ratio: 1 / 1; max-height: 560px; padding: 0;
  background: #eef0f3 !important; border-radius: 24px; box-shadow: 0 18px 40px -24px rgba(79, 70, 229, .35);
}
html.dzb-v2 #o-carousel-product .carousel-inner, html.dzb-v2 #o-carousel-product .carousel-item,
html.dzb-v2 #o-carousel-product .carousel-item > div { height: 100% !important; }
html.dzb-v2 #o-carousel-product .product_detail_img {
  width: 100%; height: 100%; max-height: none !important; object-fit: cover; border-radius: 24px;
}
html.dzb-v2 #o-carousel-product .carousel-control-prev,
html.dzb-v2 #o-carousel-product .carousel-control-next { opacity: .35; }
html.dzb-v2 .o_carousel_product_indicators .carousel-indicators li { border-radius: 14px; overflow: hidden; border: 2px solid transparent !important; }
html.dzb-v2 .o_carousel_product_indicators .carousel-indicators li.active { border-color: var(--dzb-primary) !important; }
html.dzb-v2 .o_carousel_product_indicators img { border-radius: 12px; }
html.dzb-v2 .dzb2-stock {
  position: absolute; top: 18px; left: 30px; z-index: 5; background: #fff; color: #059669;
  font-size: 12.5px; font-weight: 700; padding: 5px 12px 5px 22px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
}
html.dzb-v2 .dzb2-stock:before { content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #10b981; }

/* ── 标题区 ── */
html.dzb-v2 .dzb2-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
html.dzb-v2 .dzb2-cat { font-size: 12.5px; color: var(--dzb-primary); background: var(--dzb-primary-soft); padding: 4px 11px; border-radius: 999px; font-weight: 600; }
html.dzb-v2 .dzb2-code { font-size: 12.5px; color: var(--dzb2-g2); letter-spacing: .3px; }
html.dzb-v2 #product_details h1 { font-size: 30px; font-weight: 700; line-height: 1.3; letter-spacing: .2px; margin: 0 0 8px; }
html.dzb-v2 .dzb2-tagline { display: block; font-size: 16px; color: var(--dzb2-g1); line-height: 1.7; margin: 0 0 14px; }
html.dzb-v2 #product_details > p.text-muted { display: none !important; }            /* 原来的灰色参数行 → 标签 */
html.dzb-v2.dzb2-tag #product_details > div.oe_structure { display: none !important; }  /* 有一句话卖点时隐藏套话 */
html.dzb-v2 .dzb2-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
html.dzb-v2 .dzb2-chip { font-size: 13px; padding: 6px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--dzb2-line); color: var(--dzb2-g1); line-height: 1.4; }
html.dzb-v2 .dzb2-chip em { font-style: normal; color: var(--dzb2-g2); margin-right: 5px; }
html.dzb-v2 .dzb2-chip b { color: var(--dzb2-ink); font-weight: 600; }
html.dzb-v2 .dzb2-chip.is-ok { background: #ecfdf5; border-color: #a7f3d0; }
html.dzb-v2 .dzb2-chip.is-ok em { color: #059669; }
html.dzb-v2 .dzb2-chip.is-ok b { color: #065f46; }

/* ── 价格与规格卡片 ── */
html.dzb-v2 #product_details .product_price h3 { font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
html.dzb-v2.dzb2-cards #product_details .product_price { display: none !important; }  /* 每张规格卡片已显示价格 */
html.dzb-v2 .js_add_cart_variants .attribute_name { font-size: 13px; color: var(--dzb2-g2); font-weight: 600; }
html.dzb-v2.dzb2-cards .o_wsale_product_attribute {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 18px !important; padding: 0;
}
html.dzb-v2.dzb2-cards .o_wsale_product_attribute .o_variant_pills {
  display: block !important; margin: 0 !important; padding: 14px 16px !important; text-align: left;
  border-radius: var(--dzb2-r) !important; border: 1.5px solid var(--dzb2-line) !important;
  background: #fff !important; color: var(--dzb2-ink) !important; font-weight: 400; box-shadow: none !important;
}
html.dzb-v2.dzb2-cards .o_wsale_product_attribute .o_variant_pills:hover { border-color: #c7d2fe !important; }
html.dzb-v2.dzb2-cards .o_wsale_product_attribute .o_variant_pills.active {
  border-color: var(--dzb-primary) !important; box-shadow: 0 0 0 3px var(--dzb-primary-soft) !important; background: #fff !important;
}
html.dzb-v2.dzb2-cards .o_variant_pills label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; width: 100%; cursor: pointer; }
html.dzb-v2.dzb2-cards .o_variant_pills label > span:first-child { font-size: 14px; color: var(--dzb2-g2); }
html.dzb-v2 .dzb2-sp { font-size: 22px; font-weight: 800; color: var(--dzb2-ink); letter-spacing: -.2px; }
html.dzb-v2 .o_variant_pills .badge { display: none !important; }

/* ── 数量 + 加入购物车 + 改参数定制 ── */
html.dzb-v2 #o_wsale_cta_wrapper { gap: 10px; flex-wrap: nowrap !important; }
html.dzb-v2 #o_wsale_cta_wrapper > * { margin: 0 !important; }
html.dzb-v2 #o_wsale_cta_wrapper #product_option_block { display: none !important; }
html.dzb-v2 .css_quantity { height: 48px; border: 1px solid var(--dzb2-line); border-radius: 12px; background: #fff; flex: 0 0 auto; width: auto !important; }
html.dzb-v2 .css_quantity .btn {
  border: 0 !important; box-shadow: none !important; background: transparent !important; color: var(--dzb2-g1) !important;
  border-radius: 12px !important; display: flex; align-items: center; padding: 0 14px;
}
html.dzb-v2 .css_quantity .btn:hover { color: var(--dzb-primary) !important; }
html.dzb-v2 .css_quantity input { max-width: 52px; border: 0 !important; box-shadow: none !important; }
html.dzb-v2 #add_to_cart_wrap { flex: 1 1 auto; }
html.dzb-v2 #add_to_cart { height: 48px; border-radius: 12px !important; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
html.dzb-v2 .dzb2-ghost {
  display: flex; align-items: center; justify-content: center; height: 48px; padding: 0 20px; white-space: nowrap;
  border-radius: 12px !important; border: 1.5px solid var(--dzb-primary); color: var(--dzb-primary) !important; background: #fff; font-weight: 700; font-size: 15px;
}
html.dzb-v2 .dzb2-ghost:hover { background: var(--dzb-primary-soft); }
html.dzb-v2 .dzb-customize-box, html.dzb-v2 #o_product_terms_and_share { display: none !important; }

/* ── 四个小格 ── */
html.dzb-v2 .dzb2-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 8px; }
html.dzb-v2 .dzb2-tile {
  display: block; background: #fff; border: 1px solid var(--dzb2-line); border-radius: 12px; padding: 10px 8px; text-align: center;
  font-size: 12.5px; color: var(--dzb2-g2); text-decoration: none !important; line-height: 1.45;
}
html.dzb-v2 .dzb2-tile b { display: block; font-size: 14px; color: var(--dzb2-ink); font-weight: 700; }
html.dzb-v2 a.dzb2-tile:hover { border-color: #c7d2fe; background: #f8f9ff; }
html.dzb-v2 a.dzb2-tile.is-doc b { color: var(--dzb-primary); }
html.dzb-v2 a.dzb2-tile.is-doc b:after { content: " ↓"; }
html.dzb-v2.dzb2-docs #product_documents { display: none !important; }
html.dzb-v2 #product_documents h5 { font-size: 14px; margin-top: 10px; }

/* ── 详情区 ── */
html.dzb-v2 #dzb2_body { display: block; padding-top: 12px; padding-bottom: 8px; }
html.dzb-v2.dzb2-parsed #product_full_description { display: none !important; }
html.dzb-v2 #oe_structure_website_sale_recommended_products { display: none !important; }
html.dzb-v2 .dzb2-nav {
  display: flex; gap: 4px; position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--dzb2-line); margin: 18px 0 22px; overflow-x: auto;
}
html.dzb-v2 .dzb2-nav a { padding: 12px 16px; font-size: 14.5px; color: var(--dzb2-g2); text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
html.dzb-v2 .dzb2-nav a:hover { color: var(--dzb2-ink); }
html.dzb-v2 .dzb2-nav a.on { color: var(--dzb-primary); border-color: var(--dzb-primary); font-weight: 700; }
html.dzb-v2 .dzb2-sec { margin: 0 0 30px; scroll-margin-top: 70px; }
html.dzb-v2 .dzb2-h { font-size: 19px; font-weight: 700; margin: 0 0 14px; }
html.dzb-v2 .dzb2-p { font-size: 15px; color: var(--dzb2-g1); line-height: 1.85; margin: 0 0 12px; max-width: 860px; }
html.dzb-v2 .dzb2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 6px; }
html.dzb-v2 .dzb2-card { background: #fff; border: 1px solid var(--dzb2-line); border-radius: 18px; padding: 18px 18px 16px; }
html.dzb-v2 .dzb2-card h4 { font-size: 15.5px; font-weight: 700; margin: 0 0 6px; }
html.dzb-v2 .dzb2-card p { font-size: 14px; color: var(--dzb2-g1); line-height: 1.75; margin: 0; }
html.dzb-v2 .dzb2-ico {
  width: 36px; height: 36px; border-radius: 11px; background: var(--dzb-primary-soft); color: var(--dzb-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; margin-bottom: 10px;
}
html.dzb-v2 .dzb2-n {
  display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--dzb-primary); color: #fff;
  text-align: center; line-height: 26px; font-weight: 700; font-size: 13px; margin-bottom: 8px;
}
html.dzb-v2 .dzb2-notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
html.dzb-v2 .dzb2-notes li { background: #fff; border: 1px solid var(--dzb2-line); border-left: 3px solid #f59e0b; border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--dzb2-g1); line-height: 1.75; }
html.dzb-v2 .dzb2-notes li b { color: var(--dzb2-ink); margin-right: 6px; }
html.dzb-v2 .dzb2-prose p { font-size: 15px; color: var(--dzb2-g1); line-height: 1.85; }

/* 配方组成 + 用量速算 */
html.dzb-v2 .dzb2-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
html.dzb-v2 .dzb2-row.is-two { grid-template-columns: 1fr 1.1fr; }
html.dzb-v2 .dzb2-row:not(.is-two) > .dzb2-card { max-width: 620px; }
html.dzb-v2 .dzb2-fcard #dzb_formula { border: 0 !important; padding: 0 !important; margin: 0 !important; }
html.dzb-v2 .dzb2-fcard #dzb_formula .container { padding: 0 !important; max-width: none !important; }
html.dzb-v2 .dzb2-fcard #dzb_formula .dzb-narrow { max-width: none !important; }
html.dzb-v2 .dzb2-fcard #dzb_formula h5 { font-size: 15.5px; font-weight: 700; margin: 0 0 8px; }
html.dzb-v2 .dzb2-fcard #dzb_formula .dzb-f-tip { display: none; }
html.dzb-v2 .dzb2-calc { background: linear-gradient(135deg, #4f46e5, #7c3aed); border: 0; color: #fff; }
html.dzb-v2 .dzb2-calc h4 { color: #fff; }
html.dzb-v2 .dzb2-calc > p { color: #e0e7ff; font-size: 13.5px; }
html.dzb-v2 .dzb2-cf { display: flex; gap: 10px; margin: 14px 0 12px; }
html.dzb-v2 .dzb2-in { flex: 1; min-width: 0; background: rgba(255, 255, 255, .14); border-radius: 12px; padding: 8px 10px; margin: 0; }
html.dzb-v2 .dzb2-in > span { display: block; font-size: 12px; color: #e0e7ff; margin-bottom: 2px; }
html.dzb-v2 .dzb2-in > div { display: flex; gap: 6px; align-items: center; }
html.dzb-v2 .dzb2-in input { width: 100%; min-width: 0; background: transparent; border: 0; color: #fff; font-size: 19px; font-weight: 700; outline: none; padding: 0; }
html.dzb-v2 .dzb2-in select { background: rgba(255, 255, 255, .2); color: #fff; border: 0; border-radius: 8px; font-size: 13px; padding: 3px 4px; outline: none; }
html.dzb-v2 .dzb2-in select option { color: #111827; }
html.dzb-v2 .dzb2-cr { background: #fff; color: var(--dzb2-ink); border-radius: 12px; padding: 11px 13px; font-size: 14px; line-height: 1.6; }
html.dzb-v2 .dzb2-cr b { color: var(--dzb-primary); font-size: 18px; }

/* 相关产品 */
html.dzb-v2 .dzb2-related { margin: 8px 0 26px; }
html.dzb-v2 .dzb2-rgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
html.dzb-v2 .dzb2-ritem { display: block; background: #fff; border: 1px solid var(--dzb2-line); border-radius: 16px; padding: 10px; text-decoration: none !important; color: var(--dzb2-g1); transition: border-color .2s, box-shadow .2s; }
html.dzb-v2 .dzb2-ritem:hover { border-color: #c7d2fe; box-shadow: 0 6px 18px rgba(79, 70, 229, .08); }
html.dzb-v2 .dzb2-ritem .dzb2-rimg { aspect-ratio: 1 / 1; border-radius: 12px; background: #eef0f3; overflow: hidden; margin-bottom: 8px; }
html.dzb-v2 .dzb2-ritem img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.dzb-v2 .dzb2-ritem .dzb2-rname { font-size: 13.5px; line-height: 1.5; height: 3em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html.dzb-v2 .dzb2-ritem .dzb2-rprice { font-size: 15px; font-weight: 700; color: var(--dzb2-ink); margin-top: 4px; }

/* 底部定制横幅 */
html.dzb-v2 .dzb2-cta { margin: 10px 0 44px; background: #111827; color: #fff; border-radius: 22px; padding: 22px 26px; display: flex; align-items: center; gap: 20px; }
html.dzb-v2 .dzb2-cta > div { flex: 1; }
html.dzb-v2 .dzb2-cta h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #fff; }
html.dzb-v2 .dzb2-cta p { margin: 0; color: #9ca3af; font-size: 13.5px; }
html.dzb-v2 .dzb2-cta a { background: #fff; color: #111827 !important; border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 14px; text-decoration: none !important; white-space: nowrap; }

/* ── 手机 ── */
@media (max-width: 991.98px) {
  html.dzb-v2 .dzb2-sticky {
    display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: #fff; border-top: 1px solid var(--dzb2-line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  html.dzb-v2 body { padding-bottom: 72px; }
  html.dzb-v2 #dzb-mobile-nav { display: none !important; }     /* 全站的「商城 / 报价 / 购物车」底栏：产品页换成购买栏 */
  html.dzb-v2 .dzb2-sticky .dzb2-sticky-cart { width: 44px; padding: 0; color: var(--dzb2-g1) !important; border: 1px solid var(--dzb2-line); font-size: 17px; }
  html.dzb-v2 .dzb2-sticky-price { flex: 1; font-size: 19px; font-weight: 800; color: var(--dzb2-ink); white-space: nowrap; }
  html.dzb-v2 .dzb2-sticky a { height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-weight: 700; font-size: 14.5px; padding: 0 16px; text-decoration: none !important; }
  html.dzb-v2 .dzb2-sticky-buy { background: var(--dzb-primary); color: #fff !important; }
  html.dzb-v2 .dzb2-sticky .dzb-customize { border: 1.5px solid var(--dzb-primary); color: var(--dzb-primary) !important; }
  html.dzb-v2 .dzb2-row.is-two { grid-template-columns: 1fr; }
  html.dzb-v2 .dzb2-rgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  html.dzb-v2 #product_details h1 { font-size: 24px; }
  html.dzb-v2 .dzb2-trust { grid-template-columns: repeat(2, 1fr); }
  html.dzb-v2 #o-carousel-product .o_carousel_product_outer, html.dzb-v2 #o-carousel-product .product_detail_img { border-radius: 20px; }
  html.dzb-v2 .dzb2-ghost { padding: 0 14px; font-size: 14px; }
  html.dzb-v2 .dzb2-cta { flex-direction: column; align-items: flex-start; }
  html.dzb-v2 .dzb2-cf { flex-direction: column; }
}
