/*
 * Shared product-templates stylesheet.
 *
 * Used by BOTH templates (4.7.21+):
 *   - tpl-product-collection-v3.php  (v3 catalog hub)
 *   - tpl-product-detail.php          (pd single-series hub)
 *
 * Both templates intentionally share 100% of the visual language —
 * card style, FAQ, hero layout, why-card, support cards, etc. — so all
 * rules live in this single file. Keeps:
 *   ✓ One source of truth (fix once, both templates updated)
 *   ✓ Zero rule duplication
 *   ✓ One HTTP request per page (~5KB gzipped)
 *
 * Section layout in this file:
 *   1-13   v3 + pd shared components (cards, hero, FAQ, related, support…)
 *   720+   pd-only additions (.hs-pd-hero-gallery / .hs-pd-tabs /
 *          .hs-pd-byline). Even these load on v3 pages (~1KB extra) but
 *          are harmless — selectors don't match v3 markup.
 *
 * Site-wide primitives (.hs-container / .hs-section / .hs-section--alt /
 * .hs-btn / .hs-grid / .hs-eyebrow / .hs-section-head) come from site.css.
 *
 * File name kept as "product-collection-v3.css" for backward compat with
 * external SOPs / build scripts. If you ever decide to rename, also update
 * inc/theme-settings.php and inc/product-detail.php enqueue paths.
 */

/* Shared helpers */
.hs-pcv3-container--narrow {
  width: min(100% - 40px, 1100px);
  margin-left: auto;
  margin-right: auto;
}

/* Connected sections — used between Types Intro and first Category.
   Reduce padding so the visible gap is ~50px (25 + 25) instead of 140px. */
.hs-pcv3-section--connected-bottom { padding-bottom: 25px !important; }
.hs-pcv3-section--connected-top    { padding-top: 25px !important; }

.hs-pcv3-richtext { color: var(--hs-text); font-size: 16px; line-height: 1.8; }
.hs-pcv3-richtext p { margin: 0 0 14px; }
.hs-pcv3-richtext p:last-child { margin-bottom: 0; }
.hs-pcv3-richtext ul,
.hs-pcv3-richtext ol { margin: 0 0 14px; padding-left: 20px; line-height: 1.9; font-size: 15px; }
.hs-pcv3-richtext li { margin-bottom: 4px; }
.hs-pcv3-richtext strong { color: var(--hs-title); }
.hs-pcv3-richtext a { color: var(--hs-accent); }
.hs-pcv3-richtext a:hover { color: var(--hs-accent-dark); }
.hs-pcv3-richtext img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; display: block; }

/* =========================================================================
   1 · Hero (2-col, image right)
   ========================================================================= */

.hs-pcv3-hero { padding: 60px 0; background: #fff; }

.hs-pcv3-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hs-pcv3-hero__text {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hs-pcv3-hero__title {
  font-size: 38px;
  line-height: 1.25;
  color: var(--hs-title);
  margin: 0 0 16px;
}

.hs-pcv3-hero__desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--hs-text);
  margin: 0 0 22px;
  width: 100%;
}
.hs-pcv3-hero__desc p { margin: 0 0 12px; font-size: 17px; }
.hs-pcv3-hero__desc p:last-child { margin-bottom: 0; }

/* Force 600×450 box (4:3). Responsive: shrinks with column, keeps ratio + crops */
.hs-pcv3-hero__image {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 600 / 450;
  margin-left: auto;
  justify-self: end;
}
.hs-pcv3-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  display: block;
}

/* -------------------------------------------------------------------------
   1b · Hero — Banner variant (full-width bg image + overlay)
   Activated when ACF field `hero_layout` = "banner".
   ------------------------------------------------------------------------- */

.hs-pcv3-hero--banner {
  position: relative;
  padding: 0;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 480px;
  display: flex;
  align-items: center;
  background-color: var(--hs-title);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--hs-text-inverse) !important;
  overflow: hidden;
}

.hs-pcv3-hero--banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.hs-pcv3-hero__inner--banner {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100% - 40px, 1140px);
  margin: 0 auto;
  padding: 80px 0;
  text-align: left;
  grid-template-columns: none;
  gap: 0;
}

/* All text inside banner hero is WHITE. */
.hs-pcv3-hero--banner,
.hs-pcv3-hero--banner *,
.hs-pcv3-hero--banner .hs-eyebrow,
.hs-pcv3-hero--banner .hs-pcv3-richtext,
.hs-pcv3-hero--banner .hs-pcv3-richtext p,
.hs-pcv3-hero--banner .hs-pcv3-richtext strong,
.hs-pcv3-hero--banner .hs-pcv3-richtext em,
.hs-pcv3-hero--banner .hs-pcv3-richtext a,
.hs-pcv3-hero--banner .hs-pcv3-richtext li,
.hs-pcv3-hero--banner .hs-pcv3-richtext h2,
.hs-pcv3-hero--banner .hs-pcv3-richtext h3,
.hs-pcv3-hero--banner .hs-pcv3-richtext h4 {
  color: var(--hs-text-inverse) !important;
}

.hs-pcv3-hero--banner .hs-pcv3-hero__title {
  margin: 0 0 20px;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 900px;
  color: var(--hs-text-inverse) !important;
}

.hs-pcv3-hero--banner .hs-pcv3-hero__desc {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.65;
  max-width: 720px;
  width: auto;
}
.hs-pcv3-hero--banner .hs-pcv3-hero__desc p { font-size: 18px; }
.hs-pcv3-hero--banner .hs-pcv3-hero__desc a { text-decoration: underline; }

/* Ghost button on banner: transparent + white border + white text, hover fills white */
.hs-pcv3-hero--banner .hs-btn,
.hs-pcv3-hero--banner .hs-btn-inquiry {
  background: transparent !important;
  color: var(--hs-text-inverse) !important;
  border-color: #ffffff !important;
}
.hs-pcv3-hero--banner .hs-btn:hover,
.hs-pcv3-hero--banner .hs-btn:focus-visible,
.hs-pcv3-hero--banner .hs-btn-inquiry:hover,
.hs-pcv3-hero--banner .hs-btn-inquiry:focus-visible {
  background: #ffffff !important;
  color: var(--hs-accent) !important;
}

/* 4.5.9: Stats Strip now uses site-wide .hs-pg-stats + .hs-section--accent
   (see assets/css/site.css). Old .hs-pcv3-stats / __grid / __value classes
   removed — v3 template markup updated to emit the unified .hs-pg-stats. */

/* =========================================================================
   3 · Overview  / 4 · Types Intro — section-head centered, body left
   ========================================================================= */

.hs-pcv3-overview__body,
.hs-pcv3-types-intro__body {
  text-align: left;
}

/* =========================================================================
   5 · Categories
   ========================================================================= */

.hs-pcv3-categories__desc {
  text-align: left;
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--hs-text);
}

/* Card: image-on-top (used by Categories items) */
.hs-pcv3-card {
  background: #fff;
  border: 1px solid var(--hs-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  transition: transform var(--hs-transition), box-shadow var(--hs-transition);
}
.hs-pcv3-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hs-shadow-card-hover, 0 16px 36px rgba(0,0,0,.1));
}
.hs-pcv3-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--hs-accent-soft);
}
.hs-pcv3-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hs-pcv3-card__body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: center;
}
.hs-pcv3-card__title {
  margin: 0 0 10px;
  color: var(--hs-title);
  font-size: 18px;
  text-align: center;
}
.hs-pcv3-card__desc {
  margin: 0 0 14px;
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
}
.hs-pcv3-card__desc p { margin: 0 0 8px; font-size: 14px; }
.hs-pcv3-card__desc p:last-child { margin-bottom: 0; }

/* Card CTA centered inside card */
.hs-pcv3-card__cta {
  margin-top: auto;
  align-self: center;
}

/* =========================================================================
   6 · Why Choose (horizontal image + bullets)
   ========================================================================= */

.hs-pcv3-why__description {
  text-align: left;
  font-size: 16px;
  line-height: 1.8;
  color: var(--hs-text);
  margin: 0 0 30px;
}

.hs-pcv3-why-card {
  background: #fff;
  border: 1px solid var(--hs-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 4.5.11: 左右 1:1 平分 */
  align-items: stretch;             /* 两侧等高（默认 grid 行为，显式标注）*/
  column-gap: 22px;                 /* 4.5.26: 图片 ↔ 文字留白 22→44px (22 gap + 22 body padding) */
}
.hs-pcv3-why-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;             /* 4.5.10: 锁定 600×400 (3:2) 比例 */
  overflow: hidden;
  background-color: var(--hs-accent-soft);
}
.hs-pcv3-why-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hs-pcv3-why-card__image--video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: #000;
  overflow: hidden;
}
.hs-pcv3-why-card__image--video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* 4.5.11 / 4.7.19 merged: Why card body — padding + flex column + vertical
   center. `justify-content: center` 让文字 / bullets / CTA 整体在图片高度
   内上下居中（图片由 aspect-ratio: 3/2 决定卡片行高）。*/
.hs-pcv3-why-card__body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.hs-pcv3-why-card__title {
  margin: 0 0 8px;
  color: var(--hs-title);
  font-size: 17px;
}
.hs-pcv3-why-card__bullets ul {
  margin: 0;
  padding-left: 18px;
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.7;
}
.hs-pcv3-why-card__cta { margin-top: 16px; align-self: flex-start; }

/* =========================================================================
   7 · FAQ
   ========================================================================= */

.hs-pcv3-faq__list { display: flex; flex-direction: column; gap: 12px; }

.hs-pcv3-faq__item {
  background: #fff;
  border: 1px solid var(--hs-border);
  border-radius: 12px;
  padding: 18px 22px;
  transition: border-color var(--hs-transition);
}
.hs-pcv3-faq__item[open] { border-color: var(--hs-accent-border); }

.hs-pcv3-faq__item summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.hs-pcv3-faq__item summary::-webkit-details-marker { display: none; }
.hs-pcv3-faq__item summary .hs-pcv3-faq__q {
  display: inline;
  font-weight: 700;
  color: var(--hs-title);
  font-size: 17px;
  margin: 0;
}
.hs-pcv3-faq__item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 22px;
  color: var(--hs-accent);
  line-height: 1;
  font-weight: 400;
}
.hs-pcv3-faq__item[open] summary::after { content: "−"; }

.hs-pcv3-faq__answer { margin: 12px 0 0; color: var(--hs-text); font-size: 15px; line-height: 1.8; text-align: left; }

/* =========================================================================
   8 · Related Products
   ========================================================================= */

.hs-pcv3-related__description {
  text-align: left;
  font-size: 16px;
  line-height: 1.7;
  color: var(--hs-text);
  margin: 0 0 30px;
}

.hs-pcv3-related__card {
  background: #fff;
  border: 1px solid var(--hs-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform var(--hs-transition), box-shadow var(--hs-transition);
}
.hs-pcv3-related__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
}
.hs-pcv3-related__card-image {
  aspect-ratio: 4 / 3;
  background: var(--hs-accent-soft);
}
.hs-pcv3-related__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hs-pcv3-related__card-body { padding: 18px; text-align: center; }
.hs-pcv3-related__card-title {
  margin: 0 0 6px;
  color: var(--hs-title);
  font-size: 16px;
}
.hs-pcv3-related__card-cta {
  color: var(--hs-accent);
  font-weight: 600;
  font-size: 13px;
}

/* =========================================================================
   9 · Technical Support (blog grid)
   ========================================================================= */

.hs-pcv3-support__description {
  text-align: left;
  margin: 0 0 30px;
  color: var(--hs-text);
  font-size: 16px;
  line-height: 1.7;
}

.hs-pcv3-support__card {
  background: #fff;
  border: 1px solid var(--hs-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform var(--hs-transition), box-shadow var(--hs-transition);
}
.hs-pcv3-support__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hs-shadow-card-hover, 0 16px 36px rgba(0,0,0,.1));
}
.hs-pcv3-support__card-image {
  aspect-ratio: 16 / 10;
  background: var(--hs-accent-soft);
  overflow: hidden;
}
.hs-pcv3-support__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hs-pcv3-support__card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
/* 4.5.10: top meta row — category + modified date (E-E-A-T freshness). */
.hs-pcv3-support__card-meta-top {
  font-size: 12px;
  color: var(--hs-text-muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.hs-pcv3-support__card-cat {
  color: var(--hs-accent);
}
.hs-pcv3-support__card-sep {
  margin: 0 6px;
  opacity: 0.6;
}
.hs-pcv3-support__card-title {
  margin: 0 0 10px;
  color: var(--hs-title);
  font-size: 17px;
  line-height: 1.4;
}
/* 4.5.10: excerpt — 1-line preview, AI answer-engine citable hook. */
.hs-pcv3-support__card-excerpt {
  margin: 0 0 14px;
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}
/* 4.5.10: foot row — reading time + Read Article CTA. */
.hs-pcv3-support__card-foot {
  display: flex;
  align-items: center;
  font-size: 13px;
  margin-top: auto;
}
.hs-pcv3-support__card-time {
  color: var(--hs-text-muted);
}
.hs-pcv3-support__card-cta {
  color: var(--hs-accent);
  font-weight: 600;
  font-size: 13px;
}

/* =========================================================================
   10 · Contact card (left text + right image, centered on gray bg)
   ========================================================================= */

/* Contact section uses zebra bg (no forced color). Card stays white with
   shadow + subtle border so it reads as elevated on either white or alt bg. */
.hs-pcv3-contact__card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--hs-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  min-height: 520px;
}

.hs-pcv3-contact__body {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hs-pcv3-contact__eyebrow { margin-bottom: 16px; }

.hs-pcv3-contact__title {
  font-size: 36px;
  line-height: 1.2;
  color: var(--hs-title);
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.hs-pcv3-contact__desc {
  color: var(--hs-text);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 28px;
  width: 100%;
}
.hs-pcv3-contact__desc p { margin: 0 0 12px; }
.hs-pcv3-contact__desc p:last-child { margin-bottom: 0; }

/* Right column: inquiry form */
.hs-pcv3-contact__form {
  padding: 48px;
  background: var(--hs-bg-alt);
  display: flex;
  align-items: center;
}
.hs-pcv3-contact__form .hs-form {
  width: 100%;
  margin: 0;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 992px) {
  .hs-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .hs-pcv3-hero { padding: 40px 0; }
  .hs-pcv3-hero__inner { grid-template-columns: 1fr; gap: 28px; }
  .hs-pcv3-hero__title { font-size: 28px; }
  .hs-pcv3-hero__desc { font-size: 16px; }
  .hs-grid--2,
  .hs-grid--3,
  .hs-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .hs-pcv3-why-card { grid-template-columns: 1fr; }
  /* aspect-ratio: 3 / 2 inherited from main rule — image scales with card width */
  .hs-pcv3-contact { padding: 50px 0; }
  .hs-pcv3-contact__card { grid-template-columns: 1fr; min-height: 0; }
  .hs-pcv3-contact__body { padding: 36px 28px; }
  .hs-pcv3-contact__title { font-size: 26px; }
  .hs-pcv3-contact__form { padding: 28px; }
  .hs-pcv3-hero__image { max-width: 100%; justify-self: stretch; }
  .hs-pcv3-hero--banner { min-height: 360px; }
  .hs-pcv3-hero__inner--banner { padding: 56px 0; }
  .hs-pcv3-hero--banner .hs-pcv3-hero__title { font-size: 32px; }
  .hs-pcv3-hero--banner .hs-pcv3-hero__desc { font-size: 16px; }
  .hs-pcv3-hero--banner .hs-pcv3-hero__desc p { font-size: 16px; }
}

.hs-pd-byline__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 12px;
  display: inline-block;
}

/* =========================================================================
   4.7.13 — Hero gallery (CSS-only radio switcher) + CTA gap
   ========================================================================= */

/* Hero CTAs — gap between Primary and Secondary buttons */
.hs-pcv3-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

/* Gallery container — supersedes the simple stacked layout */
.hs-pd-hero-gallery {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  justify-self: end;
}

/* Radio inputs — visually hidden */
.hs-pd-hero-gallery__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Main media area — locked 3:2, only the :checked panel is visible */
.hs-pd-hero-gallery__main {
  width: 100%;
  aspect-ratio: 3 / 2;
  position: relative;
  border-radius: var(--hs-radius-card, 10px);
  overflow: hidden;
  background: #f2f4f7;
}
.hs-pd-hero-gallery__panel {
  display: none;
  position: absolute;
  inset: 0;
}
.hs-pd-hero-gallery__panel img,
.hs-pd-hero-gallery__panel lite-youtube {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* :checked → corresponding panel visible. Supports up to 6 media items. */
#hg-0:checked ~ .hs-pd-hero-gallery__main .hs-pd-hero-gallery__panel[data-idx="0"],
#hg-1:checked ~ .hs-pd-hero-gallery__main .hs-pd-hero-gallery__panel[data-idx="1"],
#hg-2:checked ~ .hs-pd-hero-gallery__main .hs-pd-hero-gallery__panel[data-idx="2"],
#hg-3:checked ~ .hs-pd-hero-gallery__main .hs-pd-hero-gallery__panel[data-idx="3"],
#hg-4:checked ~ .hs-pd-hero-gallery__main .hs-pd-hero-gallery__panel[data-idx="4"],
#hg-5:checked ~ .hs-pd-hero-gallery__main .hs-pd-hero-gallery__panel[data-idx="5"] {
  display: block;
}

/* Thumb row — 4 thumbs across, each ≈ 1/4 main width.
   Gap to main image is 12px (half of typical 24px section spacing). */
.hs-pd-hero-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.hs-pd-hero-gallery__thumb {
  position: relative;
  aspect-ratio: 3 / 2;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #f2f4f7;
  transition: border-color .15s;
  display: block;
}
.hs-pd-hero-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hs-pd-hero-gallery__thumb:hover {
  border-color: var(--hs-accent, #467c3d);
}
.hs-pd-hero-gallery__thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 18px;
  text-shadow: 0 0 6px rgba(0,0,0,.7);
  pointer-events: none;
}

/* Highlight currently selected thumb */
#hg-0:checked ~ .hs-pd-hero-gallery__thumbs label[for="hg-0"],
#hg-1:checked ~ .hs-pd-hero-gallery__thumbs label[for="hg-1"],
#hg-2:checked ~ .hs-pd-hero-gallery__thumbs label[for="hg-2"],
#hg-3:checked ~ .hs-pd-hero-gallery__thumbs label[for="hg-3"],
#hg-4:checked ~ .hs-pd-hero-gallery__thumbs label[for="hg-4"],
#hg-5:checked ~ .hs-pd-hero-gallery__thumbs label[for="hg-5"] {
  border-color: var(--hs-accent, #467c3d);
}

/* 4.7.19: 4.7.16's two patches above merged INTO the original rules
   (lines 364 + 383). This block intentionally left empty as a marker. */
