/* ============================================================
   Bowei Safety · Site 2 (bw.stevenstudio.top) — 产品详情页样式
   WordPress 版: 全部类名带 bw2- 前缀, 变量/重置作用域限定在 .bw2-pdp,
   不影响 Elementor / 主题样式。页头页脚由站点现有主题输出。
   设计系统与站点 Elementor kit ("Firetroops") 一致:
   headings Alumni Sans · body Roboto · brick red / navy / amber
   ============================================================ */

.bw2-pdp {
  /* palette (matches Elementor global colours of bw.stevenstudio.top) */
  --red:      #AE2F26;
  --red-dark: #8C231B;
  --navy:     #08162B;
  --navy-2:   #0D2345;
  --amber:    #E09429;
  --text:     #666666;
  --line:     #D1D1D1;
  --surface:  #F0F0F0;
  --white:    #FFFFFF;

  --font-display: "Alumni Sans", "Arial Narrow", sans-serif;
  --font-body:    "Roboto", Arial, sans-serif;

  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(8, 22, 43, .06);
  --shadow-md: 0 10px 28px rgba(8, 22, 43, .14);

  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* scoped reset */
.bw2-pdp *, .bw2-pdp *::before, .bw2-pdp *::after { box-sizing: border-box; }
.bw2-pdp img { max-width: 100%; height: auto; display: block; }
.bw2-pdp h1, .bw2-pdp h2, .bw2-pdp h3, .bw2-pdp h4 {
  font-family: var(--font-display); color: var(--navy); margin: 0; line-height: 1.2;
}
.bw2-pdp ul { margin: 0; padding: 0; list-style: none; }
.bw2-pdp button { font: inherit; cursor: pointer; }
.bw2-pdp :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.bw2-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.bw2-pdp { padding: 26px 0 70px; }

/* ============================================================
   Buttons
   ============================================================ */
.bw2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 28px; border-radius: var(--radius); border: 2px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease,
              transform .18s ease, box-shadow .18s ease;
  line-height: 1.1; text-decoration: none;
}
.bw2-btn-red { background: var(--red); color: var(--white); }
.bw2-btn-red:hover { background: var(--red-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bw2-btn-amber { background: var(--amber); color: var(--navy); }
.bw2-btn-amber:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bw2-btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.bw2-btn-ghost:hover { background: var(--navy); color: var(--white); }
.bw2-btn-block { width: 100%; }

/* ============================================================
   Breadcrumb (单行 + 产品名截断, 手机端横向滑动)
   ============================================================ */
.bw2-crumbs {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 10px;
  overflow: hidden;
  font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase;
  padding: 14px 18px; margin-bottom: 28px;
  background: var(--surface); border-radius: var(--radius);
  border-left: 3px solid var(--red);
}
.bw2-crumbs a { color: var(--text); text-decoration: none; }
.bw2-crumbs a:hover { color: var(--red); }
.bw2-crumbs a, .bw2-crumbs .bw2-sep { flex: none; }
.bw2-crumbs .bw2-sep { color: var(--line); }
.bw2-crumbs .bw2-sep::before { content: "/"; }
.bw2-crumbs .bw2-current {
  color: var(--navy); font-weight: 500;
  min-width: 0; flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* two-column layout */
.bw2-pdp-layout { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 34px; align-items: start; }

/* ============================================================
   Sidebar — catalog accordion + CTA
   ============================================================ */
.bw2-sidebar { position: sticky; top: 110px; display: grid; gap: 24px; }

.bw2-side-title {
  font-size: 21px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding-bottom: 10px; border-bottom: 2px solid var(--navy); margin-bottom: 14px;
}

.bw2-catalog { display: grid; gap: 8px; }

.bw2-acc-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.bw2-acc-item.is-open { border-color: var(--navy); box-shadow: var(--shadow-sm); }

.bw2-acc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: 0; text-align: left;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--navy);
  padding: 13px 14px;
}
.bw2-acc-head:hover { color: var(--red); }
.bw2-acc-ico { position: relative; width: 12px; height: 12px; flex: none; }
.bw2-acc-ico::before, .bw2-acc-ico::after {
  content: ""; position: absolute; background: var(--red); transition: transform .2s ease, opacity .2s ease;
}
.bw2-acc-ico::before { left: 0; right: 0; top: 5px; height: 2px; }
.bw2-acc-ico::after  { top: 0; bottom: 0; left: 5px; width: 2px; }
.bw2-acc-item.is-open .bw2-acc-ico::after { transform: scaleY(0); opacity: 0; }

.bw2-acc-body { display: none; border-top: 1px solid var(--line); }
.bw2-acc-item.is-open .bw2-acc-body { display: block; }
.bw2-acc-body ul { display: grid; }
.bw2-acc-link {
  display: block; position: relative;
  font-size: 14px; color: var(--text); text-decoration: none;
  padding: 9px 14px 9px 24px;
  border-left: 3px solid transparent;
}
.bw2-acc-link::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 5px; height: 5px;
  margin-top: -2.5px; border-radius: 50%; background: var(--line);
}
.bw2-acc-link:hover { color: var(--navy); background: var(--surface); }
.bw2-acc-link.is-current {
  color: var(--red); font-weight: 500;
  background: rgba(174, 47, 38, .07);
  border-left-color: var(--red);
}
.bw2-acc-link.is-current::before { background: var(--red); }

/* sidebar CTA */
.bw2-side-cta {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--radius); padding: 24px 22px; text-align: center;
  position: relative; overflow: hidden;
}
.bw2-side-cta::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--amber);
}
.bw2-side-cta-kicker {
  margin: 0 0 6px; color: var(--amber);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
}
.bw2-side-cta-title { color: var(--white); font-size: 25px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.bw2-side-cta-text { color: rgba(255, 255, 255, .72); font-size: 13.5px; margin: 0 0 18px; }
.bw2-side-cta .bw2-btn { margin-bottom: 14px; }
.bw2-side-cta-tel {
  display: block; color: var(--white); font-family: var(--font-display);
  font-size: 21px; font-weight: 600; letter-spacing: .06em; text-decoration: none;
}
.bw2-side-cta-tel:hover { color: var(--amber); }

/* ============================================================
   Main — hero 50/50
   ============================================================ */
.bw2-hero-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 38px;
  padding-bottom: 42px; margin-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

/* gallery / carousel */
.bw2-gallery { position: relative; }
.bw2-gal-main {
  aspect-ratio: 1 / 1; width: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); padding: 20px;
  font-family: var(--font-display); font-size: 26px; font-weight: 600;
  letter-spacing: .08em; color: rgba(8, 22, 43, .38);
  overflow: hidden;
}
.bw2-gal-img { width: 100%; height: 100%; object-fit: contain; }

.bw2-gal-nav {
  position: absolute; top: calc(50% - 34px); transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line); color: var(--navy);
  font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: all .18s ease; z-index: 2;
}
.bw2-gal-nav:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.bw2-gal-prev { left: -12px; }
.bw2-gal-next { right: -12px; }

.bw2-gal-dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0 12px; }
.bw2-gal-dot {
  width: 9px; height: 9px; border-radius: 50%; padding: 0;
  border: 1px solid var(--navy); background: transparent; transition: all .18s ease;
}
.bw2-gal-dot.is-active { background: var(--red); border-color: var(--red); transform: scale(1.15); }

.bw2-gal-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bw2-thumb {
  aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: var(--radius);
  background: none; padding: 0; overflow: hidden;
  transition: border-color .18s ease;
}
.bw2-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bw2-thumb:hover { border-color: var(--navy); }
.bw2-thumb.is-active { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }

/* info column */
.bw2-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 4px 0 10px;
  color: var(--amber); font-family: var(--font-display);
  font-size: 15px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.bw2-kicker::before { content: ""; width: 26px; height: 2px; background: var(--amber); }

.bw2-pdp-title {
  font-size: clamp(34px, 3.6vw, 48px); font-weight: 700;
  letter-spacing: .01em; line-height: 1.04; text-transform: uppercase;
  margin-bottom: 16px;
}
.bw2-pdp-intro { font-size: 15.5px; margin: 0 0 22px; max-width: 56ch; }

.bw2-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }
.bw2-chips li {
  font-size: 12.5px; font-weight: 500; letter-spacing: .03em;
  color: var(--navy); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px;
}
.bw2-chips li::before { content: "\2713"; color: var(--red); margin-right: 7px; font-weight: 700; }

.bw2-cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.bw2-cta-note { margin: 12px 0 0; font-size: 12.5px; letter-spacing: .03em; color: var(--text); }

/* ============================================================
   Section titles
   ============================================================ */
.bw2-block-title {
  font-size: clamp(26px, 2.6vw, 34px); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; line-height: 1.1;
  margin-bottom: 26px;
}
.bw2-block-title span { color: var(--red); }

/* ============================================================
   Product description blocks (ACF Repeater 输出)
   ============================================================ */
.bw2-description { margin-bottom: 52px; display: grid; gap: 18px; }

.bw2-desc-block {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px 22px; position: relative;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.bw2-desc-block::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px;
  background: linear-gradient(180deg, var(--red), var(--amber)); border-radius: 2px;
}
.bw2-desc-block:hover { border-color: var(--navy); box-shadow: var(--shadow-sm); }
.bw2-desc-block h3 {
  font-size: 21px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px;
}
.bw2-desc-block h3::after {
  content: ""; flex: 1; height: 1px; background: var(--surface); align-self: center;
}
.bw2-desc-block > .bw2-wysiwyg { margin: 0; }
.bw2-desc-block .bw2-wysiwyg > :last-child { margin-bottom: 0; }

/* 富文本内容（含编辑器插入的表格） */
.bw2-wysiwyg p { margin: 0 0 1em; }
.bw2-wysiwyg img { border-radius: var(--radius); }
.bw2-wysiwyg table {
  width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 6px 0 10px;
}
.bw2-wysiwyg table td, .bw2-wysiwyg table th {
  padding: 10px 14px; border: 1px solid var(--line); vertical-align: top; text-align: left;
}
.bw2-wysiwyg table td:first-child {
  width: 220px; color: var(--navy); font-weight: 500; background: var(--surface);
  font-family: var(--font-display); font-size: 16px; letter-spacing: .04em; text-transform: uppercase;
}
.bw2-wysiwyg table tr:nth-child(even) td:last-child { background: #FAFAF8; }

/* ============================================================
   Request a quote
   ============================================================ */
.bw2-quote {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 38px 38px; margin-bottom: 52px;
  scroll-margin-top: 120px;
}
.bw2-quote-head { max-width: 72ch; margin-bottom: 26px; }
.bw2-quote-desc { margin: -12px 0 0; font-size: 15px; }

/* 短代码未填时的占位提示 */
.bw2-form-slot {
  background: var(--white); border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 54px 24px; text-align: center;
}
.bw2-form-slot-note { font-size: 18px; font-weight: 500; color: var(--navy); letter-spacing: .06em; }
.bw2-form-slot-sub { margin: 8px 0 0; font-size: 13px; color: var(--text); }

/* 短代码渲染后的表单区 */
.bw2-form-live { background: var(--white); border-radius: var(--radius); padding: 26px 26px 8px; }
.bw2-form-live .wpforms-container, .bw2-form-live .metform-form-wrapper,
.bw2-form-live form { margin: 0 !important; max-width: 100%; }
.bw2-form-live > .elementor {
  display: block !important;
  position: static !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}
.bw2-form-live .elementor-2934 .elementor-element.elementor-element-da86703 {
  --display: block !important;
  --overflow: visible !important;
  display: block !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.bw2-form-live .elementor-2934 .elementor-element.elementor-element-5c3e6a7 {
  display: none !important;
}
.bw2-form-live .elementor-2934 .elementor-element.elementor-element-fd58be3 {
  padding: 0 !important;
}
.bw2-form-live .elementor-form-fields-wrapper {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  margin-left: -8px !important;
  margin-right: -8px !important;
}
.bw2-form-live .elementor-field-group {
  display: flex !important;
  flex-direction: column !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  margin-bottom: 16px !important;
}
.bw2-form-live .elementor-col-50 { width: 50% !important; }
.bw2-form-live .elementor-col-100 { width: 100% !important; }
.bw2-form-live .elementor-field-label {
  display: block !important;
  margin: 0 0 8px !important;
  color: var(--navy) !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}
.bw2-form-live input.elementor-field,
.bw2-form-live textarea.elementor-field {
  display: block !important;
  width: 100% !important;
  min-height: 44px !important;
  padding: 11px 14px !important;
  border: 1px solid #d8dde6 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--navy) !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
}
.bw2-form-live textarea.elementor-field {
  min-height: 120px !important;
  resize: vertical;
}
.bw2-form-live input.elementor-field:focus,
.bw2-form-live textarea.elementor-field:focus {
  border-color: var(--red) !important;
  outline: 2px solid rgba(226, 35, 26, .15) !important;
  outline-offset: 1px !important;
}
.bw2-form-live .elementor-button[type="submit"] {
  min-height: 46px !important;
  padding: 13px 28px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: var(--red) !important;
  color: #fff !important;
  cursor: pointer !important;
}
.bw2-form-live .elementor-button[type="submit"]:hover {
  background: var(--red-dark) !important;
}

/* ============================================================
   Related products — 卡片
   ============================================================ */
.bw2-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--navy); text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.bw2-card:hover { border-color: var(--red); box-shadow: var(--shadow-md); transform: translateY(-4px); color: var(--navy); }
.bw2-card-img { display: block; aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.bw2-card-img img { width: 100%; height: 100%; object-fit: cover; }
.bw2-card-body { display: grid; gap: 3px; padding: 14px 16px 16px; }
.bw2-card-cat {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber);
  font-weight: 500;
}
.bw2-card-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
}
.bw2-card:hover .bw2-card-name { color: var(--red); }

/* 占位图（无图时） */
.bw2-ph {
  background: repeating-linear-gradient(45deg,
    rgba(8, 22, 43, .045) 0 12px, rgba(8, 22, 43, .085) 12px 24px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-display); letter-spacing: .08em; color: rgba(8, 22, 43, .38);
  font-size: 18px; font-weight: 600;
}
.bw2-ph-card { aspect-ratio: 4 / 3; padding: 12px; }

/* ============================================================
   Related products — carousel
   4 per view (desktop) / 2 (tablet) / 1 + peek (mobile)
   native scroll + snap: touch swipe for free, arrows for desktop
   ============================================================ */
.bw2-rel-carousel { position: relative; }

.bw2-rel-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.bw2-rel-viewport::-webkit-scrollbar { display: none; }

.bw2-rel-track { display: flex; gap: 20px; }
.bw2-rel-slide {
  flex: 0 0 calc((100% - 60px) / 4);
  scroll-snap-align: start;
  display: flex;
}

/* 服务端判断 ≤4 个时输出的静态网格 */
.bw2-rel-static { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* JS 兜底: 极端视口下无可滚动距离时隐藏控制件 */
.bw2-rel-carousel.is-static .bw2-rel-nav,
.bw2-rel-carousel.is-static .bw2-rel-dots { display: none; }

.bw2-rel-nav {
  position: absolute; top: 96px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line); color: var(--navy);
  font-size: 25px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: all .18s ease;
}
.bw2-rel-nav:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.bw2-rel-prev { left: -12px; }
.bw2-rel-next { right: -12px; }

.bw2-rel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.bw2-rel-dot {
  width: 9px; height: 9px; border-radius: 50%; padding: 0;
  border: 1px solid var(--navy); background: transparent; transition: all .18s ease;
}
.bw2-rel-dot.is-active { background: var(--red); border-color: var(--red); transform: scale(1.15); }

/* ============================================================
   Responsive — 手机端阅读顺序:
   面包屑 → 轮播图 → 标题/简介/CTA → 描述 → Quote → 相关产品 → 目录+CTA
   ============================================================ */
@media (max-width: 1180px) {
  .bw2-rel-slide { flex-basis: calc((100% - 20px) / 2); }
  .bw2-rel-static { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1020px) {
  .bw2-pdp-layout { grid-template-columns: minmax(0, 1fr); }
  .bw2-pdp-main { order: 1; }
  .bw2-sidebar { order: 2; position: static; }
  .bw2-catalog { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
  .bw2-side-cta { max-width: 460px; }
}

@media (max-width: 880px) {
  .bw2-hero-split { grid-template-columns: 1fr; gap: 30px; }
  .bw2-gal-prev { left: 8px; }
  .bw2-gal-next { right: 8px; }
  .bw2-quote { padding: 30px 22px; }
}

@media (max-width: 640px) {
  /* breadcrumb: swipe horizontally instead of truncating */
  .bw2-crumbs { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .bw2-crumbs::-webkit-scrollbar { display: none; }
  .bw2-crumbs .bw2-current { flex: none; overflow: visible; text-overflow: clip; }

  .bw2-pdp { padding: 16px 0 50px; }
  .bw2-wrap { padding: 0 16px; }

  .bw2-hero-split { gap: 24px; padding-bottom: 32px; margin-bottom: 32px; }
  .bw2-gal-main { font-size: 20px; }
  .bw2-gal-nav { width: 38px; height: 38px; font-size: 21px; }
  .bw2-gal-thumbs { gap: 7px; }

  .bw2-cta-row { flex-direction: column; align-items: stretch; }
  .bw2-cta-note { text-align: center; }

  .bw2-desc-block { padding: 18px 16px 16px; }
  .bw2-desc-block h3 { font-size: 19px; }
  .bw2-quote { padding: 26px 16px; }
  .bw2-form-slot { padding: 40px 14px; }
  .bw2-form-live { padding: 18px 14px 4px; }
  .bw2-form-live .elementor-col-50 { width: 100% !important; }
  .bw2-side-cta { max-width: none; }
  .bw2-wysiwyg table td:first-child { width: 42%; }

  .bw2-rel-slide { flex-basis: 82%; }
  .bw2-rel-nav { top: 76px; width: 38px; height: 38px; font-size: 21px; }
  .bw2-rel-prev { left: 6px; }
  .bw2-rel-next { right: 6px; }
  .bw2-rel-static { grid-template-columns: 1fr; }
}
