/* ========================================================
   產品總覽首頁專用樣式 (Style B Product Hub + Modern Card Grid)
   ======================================================== */
.hub-hero {
  background: linear-gradient(135deg, #18181b 0%, #1e293b 65%, #78350f 100%);
  border: 1px solid #b45309;
  border-radius: var(--radius-xl);
  padding: 1.8rem 2rem;
  margin-bottom: 2.4rem;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1.5rem 2rem;
  align-items: center;
}
.hub-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.45rem);
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1.15;
  margin-bottom: 0.7rem;
  text-wrap: balance;
}
.hub-hero-lead {
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 58ch;
  margin-bottom: 1.25rem;
}
.hub-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.hub-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.68rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  background: var(--primary);
  color: #111827;
  border: 1px solid var(--primary);
  transition: filter 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.hub-jump-btn:hover { filter: brightness(1.08); border-color: var(--accent); }
.hub-jump-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero 右側：純淨無字 SVG 雙迴路液壓打孔連動動畫 */
.hub-motion-stage {
  background: radial-gradient(circle at 32% 48%, rgba(30, 41, 59, 0.92), rgba(9, 13, 22, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px -8px rgba(0, 0, 0, 0.45);
}
.hub-motion-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 預設靜態完孔構圖（prefers-reduced-motion 友善）；僅於 no-preference 啟動循環動畫 */
.hm-ram-group {
  transform: translateY(14px);
}
.hm-chamber-top {
  opacity: 0.85;
}
.hm-chamber-bot {
  opacity: 0.14;
}
.hm-slug {
  opacity: 0.92;
  transform: translateY(18px);
}
.hm-hole-cut {
  opacity: 1;
}
.hm-hose-a-adv {
  opacity: 0.92;
  stroke-dasharray: 12 12;
}
.hm-hose-b-ret {
  opacity: 0.55;
  stroke-dasharray: 8 14;
}
.hm-hose-a-ret,
.hm-hose-b-adv {
  opacity: 0;
  stroke-dasharray: 12 12;
}
.hm-gauge-needle {
  transform: rotate(42deg);
  transform-origin: 406px 66px;
}

@media (prefers-reduced-motion: no-preference) {
  .hub-motion-stage .hm-ram-group {
    animation: hm-punch-stroke 4.4s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  }
  .hub-motion-stage .hm-chamber-top {
    animation: hm-chamber-top-fill 4.4s ease-in-out infinite;
  }
  .hub-motion-stage .hm-chamber-bot {
    animation: hm-chamber-bot-fill 4.4s ease-in-out infinite;
  }
  .hub-motion-stage .hm-slug {
    animation: hm-slug-drop 4.4s cubic-bezier(0.3, 0, 0.2, 1) infinite;
  }
  .hub-motion-stage .hm-hole-cut {
    animation: hm-hole-reveal 4.4s linear infinite;
  }
  .hub-motion-stage .hm-hose-a-adv {
    animation: hm-flow-fwd 0.85s linear infinite, hm-phase-adv 4.4s ease-in-out infinite;
  }
  .hub-motion-stage .hm-hose-b-ret {
    animation: hm-flow-rev 0.85s linear infinite, hm-phase-adv-ret 4.4s ease-in-out infinite;
  }
  .hub-motion-stage .hm-hose-b-adv {
    animation: hm-flow-fwd 0.85s linear infinite, hm-phase-ret 4.4s ease-in-out infinite;
  }
  .hub-motion-stage .hm-hose-a-ret {
    animation: hm-flow-rev 0.85s linear infinite, hm-phase-ret-rev 4.4s ease-in-out infinite;
  }
  .hub-motion-stage .hm-gauge-needle {
    animation: hm-gauge-sweep 4.4s ease-in-out infinite;
  }
}

@keyframes hm-punch-stroke {
  0%, 10% { transform: translateY(0px); }
  22%, 27% { transform: translateY(8px); }
  40%, 54% { transform: translateY(23px); }
  78%, 100% { transform: translateY(0px); }
}

@keyframes hm-chamber-top-fill {
  0%, 10% { opacity: 0.12; }
  22%, 52% { opacity: 0.92; }
  76%, 100% { opacity: 0.12; }
}

@keyframes hm-chamber-bot-fill {
  0%, 50% { opacity: 0.1; }
  58%, 80% { opacity: 0.9; }
  90%, 100% { opacity: 0.1; }
}

@keyframes hm-slug-drop {
  0%, 34% { opacity: 0; transform: translateY(0px); }
  41% { opacity: 1; transform: translateY(6px); }
  62% { opacity: 0.95; transform: translateY(29px); }
  72%, 100% { opacity: 0; transform: translateY(32px); }
}

@keyframes hm-hole-reveal {
  0%, 36% { opacity: 0; }
  44%, 84% { opacity: 1; }
  94%, 100% { opacity: 0; }
}

@keyframes hm-flow-fwd {
  from { stroke-dashoffset: 48; }
  to { stroke-dashoffset: 0; }
}

@keyframes hm-flow-rev {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 48; }
}

@keyframes hm-phase-adv {
  0%, 8% { opacity: 0.15; }
  16%, 50% { opacity: 0.98; }
  56%, 100% { opacity: 0; }
}

@keyframes hm-phase-adv-ret {
  0%, 8% { opacity: 0.1; }
  16%, 50% { opacity: 0.58; }
  56%, 100% { opacity: 0; }
}

@keyframes hm-phase-ret {
  0%, 52% { opacity: 0; }
  58%, 82% { opacity: 0.98; }
  90%, 100% { opacity: 0; }
}

@keyframes hm-phase-ret-rev {
  0%, 52% { opacity: 0; }
  58%, 82% { opacity: 0.58; }
  90%, 100% { opacity: 0; }
}

@keyframes hm-gauge-sweep {
  0%, 12% { transform: rotate(-48deg); }
  36%, 52% { transform: rotate(48deg); }
  58%, 76% { transform: rotate(10deg); }
  88%, 100% { transform: rotate(-48deg); }
}

.hub-section {
  margin-bottom: 2.8rem;
  scroll-margin-top: 5.5rem;
}
.hub-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--border-color);
}
.hub-section-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ========================================================
   產品卡片網格 (modern-web-guidance: card + subgrid + stretched link)
   ======================================================== */
.product-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1.25rem;
}

.product-card {
  container-type: inline-size;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1rem 1.05rem 1.1rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  row-gap: 0.7rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-card:has(a.card-link) {
  position: relative;
}
.product-card a.card-link {
  color: inherit;
  text-decoration: none;
}
.product-card a.card-link:focus-visible {
  outline: none;
}
.product-card a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
}
.product-card:has(a.card-link:hover) {
  border-color: var(--primary);
  box-shadow: 0 10px 24px -6px rgb(0 0 0 / 0.55);
  transform: translateY(-2px);
}
.product-card:has(a.card-link:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.product-card:has(a.card-link) :is(a:not(.card-link), button) {
  position: relative;
  z-index: 1;
}

/* Card Region 1: Media (<picture> as direct child) */
.product-card > picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 0.65rem;
  aspect-ratio: 4 / 3;
}
.product-card > picture img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Card Region 2: Header (<header>) */
.product-card > header {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.card-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent);
}
.card-tag-muted {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.product-card > header h3 {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card-sub {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.4;
}

/* Card Region 3: Content (<dl> key metrics) */
.card-specs {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.32rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-color);
  align-content: start;
}
.card-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.82rem;
}
.card-spec-row dt {
  color: var(--text-muted);
  flex-shrink: 0;
}
.card-spec-row dd {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

/* Card Region 4: Footer (non-duplicate visual indicator) */
.product-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(51, 65, 85, 0.65);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent);
}
.product-card:has(a.card-link:hover) > footer {
  color: #fde68a;
}

/* Bottom Compliance & Messaging Panel */
.hub-info-band {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.8rem;
  align-items: start;
  scroll-margin-top: 5.5rem;
}
.hub-info-band h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.hub-info-band h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.15rem;
  background: var(--primary);
  border-radius: 2px;
}
.hub-info-band p {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}
.hub-info-band p:last-child { margin-bottom: 0; }

@container (width < 230px) {
  .card-spec-row { flex-direction: column; gap: 0.1rem; }
  .card-spec-row dd { text-align: left; }
}

@media (max-width: 900px) {
  .hub-hero { grid-template-columns: 1fr; padding: 1.65rem 1.5rem; }
  .hub-info-band { grid-template-columns: 1fr; padding: 1.45rem 1.35rem; }
}
