/* Interactive exploded parts diagrams (/assets/parts_diagram.php + parts_diagram.js).
   Dark by default like the rest of the storefront; .is-light follows the site's light
   mode (localStorage.lightMode). Any new colour needs a light-mode value too. */

.pd, .pd-jump {
  --pd-accent: #00cc4e;
  --pd-accent-ink: #04150b;
  --pd-accent-soft: rgba(0, 204, 78, 0.14);
  --pd-text: #f2f5f3;
  --pd-muted: #a3aca7;
  --pd-line: rgba(255, 255, 255, 0.12);
  --pd-panel: rgba(14, 17, 15, 0.78);
  --pd-panel-2: rgba(255, 255, 255, 0.05);
  --pd-solid: #121614;
  --pd-input: rgba(0, 0, 0, 0.45);
  --pd-call: #8f9893;
  --pd-gold: #d8b23a;
  --pd-kit: #6fc3ff;
  --pd-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-family: Verdana, Arial, Helvetica, sans-serif;
}
.pd.is-light, .pd-jump.is-light {
  --pd-accent: #00a63f;
  --pd-accent-ink: #ffffff;
  --pd-accent-soft: rgba(0, 166, 63, 0.1);
  --pd-text: #141816;
  --pd-muted: #59615c;
  --pd-line: rgba(0, 0, 0, 0.12);
  --pd-panel: rgba(255, 255, 255, 0.92);
  --pd-panel-2: rgba(0, 0, 0, 0.035);
  --pd-solid: #ffffff;
  --pd-input: #ffffff;
  --pd-call: #7d8580;
  --pd-gold: #9a7a12;
  --pd-kit: #0d6fb0;
  --pd-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}
.pd *, .pd-jump * { box-sizing: border-box; }
.pd .pd-ico, .pd-jump .pd-ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- jump button (top of page) ---------- */
.pd-jump {
  display: flex; align-items: center; gap: 14px;
  margin: 6px 0 22px; padding: 14px 18px;
  border: 1px solid rgba(0, 204, 78, 0.55); border-radius: 14px;
  background: linear-gradient(100deg, rgba(0, 204, 78, 0.22), rgba(0, 0, 0, 0.55) 70%);
  color: var(--pd-text) !important; text-decoration: none !important;
  box-shadow: var(--pd-shadow); clear: both;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.pd-jump.is-light { background: linear-gradient(100deg, rgba(0, 166, 63, 0.16), rgba(255, 255, 255, 0.92) 70%); border-color: rgba(0, 166, 63, 0.5); }
.pd-jump:hover, .pd-jump:focus-visible { transform: translateY(-1px); border-color: var(--pd-accent); }
.pd-jump:focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 3px; }
.pd-jump__icon {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--pd-accent); color: var(--pd-accent-ink); font-size: 24px;
}
.pd-jump__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.35; }
.pd-jump__text strong { font-size: 16px; font-weight: 700; }
.pd-jump__text span { font-size: 12.5px; color: var(--pd-muted); }
.pd-jump__arrow { margin-left: auto; flex: none; font-size: 22px; color: var(--pd-accent); animation: pd-bob 1.8s ease-in-out infinite; }
@keyframes pd-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }

/* ---------- section ---------- */
.pd { clear: both; margin: 40px 0 30px; color: var(--pd-text); scroll-margin-top: 16px; }
.pd .pd-head { margin-bottom: 14px; }
.pd .pd-h2 { margin-top: 0; }
.pd .pd-lede, .pd .pd-intro { margin: 6px 2px; padding: 0; font-size: 13.5px; line-height: 1.55; color: var(--pd-text); }
.pd .pd-intro { color: var(--pd-muted); }
.pd a { color: var(--pd-accent); }
.pd .pd-lede a { white-space: nowrap; font-weight: 700; }

.pd-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 980px) {
  .pd-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
  .pd-figure { align-self: stretch; } /* full row height, so the drawing can stay in view beside a long list */
  .pd-figure__sticky { position: sticky; top: 14px; }
  /* wide drawings: full width so the callout numbers stay readable, list underneath in two columns */
  .pd--wide .pd-layout { grid-template-columns: minmax(0, 1fr); }
  .pd--wide .pd-figure__sticky { position: static; }
  .pd--wide .pd-rows { column-count: 2; column-gap: 26px; }
  .pd--wide .pd-row { break-inside: avoid; }
  /* the picked-part card floats over the drawing, on the side away from the clicked number */
  .pd--wide .pd-figure__sticky { position: relative; }
  .pd--wide .pd-pick { position: absolute; z-index: 4; left: 12px; bottom: 86px; width: min(430px, calc(100% - 24px)); max-height: calc(100% - 90px); margin: 0; }
  .pd--wide .pd-pick.pd-pick--right { left: auto; right: 12px; }
}

/* ---------- viewer ---------- */
.pd-viewer {
  position: relative; overflow: hidden; margin: 0 auto;
  width: min(100%, calc((100vh - 230px) * var(--pd-arn, 1.4)));
  min-width: min(100%, 300px);
  background: #fff; border-radius: 12px; box-shadow: var(--pd-shadow);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none;
}
.pd-viewer.is-zoomed { touch-action: none; cursor: grab; }
.pd-viewer.is-dragging { cursor: grabbing; }
.pd-stage { position: relative; width: 100%; aspect-ratio: var(--pd-ar, 4 / 3); transform-origin: 0 0; will-change: transform; }
.pd .pd-img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; background: #fff; pointer-events: none; }

.pd-hot {
  position: absolute; z-index: 1; padding: 0; margin: 0; cursor: pointer;
  width: max(var(--pd-hs, 3%), calc(24px / var(--pd-z, 1)));
  aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: transparent; border: 2px solid rgba(0, 170, 64, 0.5);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.pd-hot--call, .pd-hot--none { border-color: rgba(110, 118, 114, 0.45); }
.pd-hot:hover, .pd-hot:focus-visible, .pd-hot.is-hover { background: rgba(0, 204, 78, 0.22); border-color: #00a63f; outline: none; }
.pd-hot--call:hover, .pd-hot--none:hover, .pd-hot--call.is-hover, .pd-hot--none.is-hover { background: rgba(110, 118, 114, 0.2); border-color: #5d6561; }
.pd-hot.is-active { background: rgba(0, 204, 78, 0.3); border-color: #00a63f; box-shadow: 0 0 0 3px rgba(0, 204, 78, 0.35); animation: pd-pulse 1.4s ease-out 2; z-index: 2; }
.pd-hot--call.is-active, .pd-hot--none.is-active { background: rgba(255, 170, 0, 0.25); border-color: #c98a00; box-shadow: 0 0 0 3px rgba(255, 170, 0, 0.3); }
.pd-hot.is-dim { opacity: 0.18; }
@keyframes pd-pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 204, 78, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(0, 204, 78, 0); } }

.pd-zoom { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; gap: 4px; }
.pd-zoom button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; margin: 0;
  border: 0; border-radius: 9px; cursor: pointer; font-size: 17px;
  background: rgba(20, 24, 22, 0.82); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.pd-zoom button:hover, .pd-zoom button:focus-visible { background: #00a63f; outline: none; }
.pd-zoom button:disabled { opacity: 0.4; cursor: default; background: rgba(20, 24, 22, 0.82); }
.pd-hint {
  position: absolute; left: 8px; top: 8px; z-index: 3; padding: 4px 9px; border-radius: 8px;
  font-size: 11px; color: #fff; background: rgba(20, 24, 22, 0.7); pointer-events: none; transition: opacity 0.4s;
}
.pd-viewer.is-touched .pd-hint { opacity: 0; }

/* full screen */
.pd.is-full .pd-viewer {
  position: fixed; inset: 0; z-index: 2147483600; width: 100vw; height: 100vh; max-width: none; border-radius: 0;
  display: flex; align-items: center; justify-content: center; background: #fff;
}
.pd.is-full .pd-stage { width: min(100vw, calc(100vh * var(--pd-arn, 1.4))); flex: none; }
.pd.is-full .pd-hint { display: none; }
.pd.is-full .pd-zoom { position: fixed; z-index: 2147483601; top: 12px; right: 12px; bottom: auto; }
.pd.is-full .pd-pick { position: fixed; z-index: 2147483601; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 45vh; overflow: auto; }
html.pd-noscroll, html.pd-noscroll body { overflow: hidden; }

/* selected-part card */
.pd-pick {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--pd-solid); border: 1px solid var(--pd-accent); box-shadow: var(--pd-shadow);
  max-height: 42vh; overflow: auto;
}
.pd-pick[hidden] { display: none; }
.pd-pick__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pd-pick__head strong { font-size: 15px; line-height: 1.3; }
.pd-pick__x { margin-left: auto; flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: var(--pd-panel-2); color: var(--pd-text); cursor: pointer; font-size: 16px; }
.pd-pick__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--pd-line); }
.pd-pick__item:first-of-type { border-top: 0; }
.pd-pick__name { font-size: 13px; line-height: 1.35; }
.pd-pick__name small { display: block; color: var(--pd-muted); font-size: 11.5px; }
.pd-pick__foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.pd-linkbtn { padding: 4px 0; border: 0; background: none; color: var(--pd-accent); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }

.pd-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 10px 0 0; font-size: 11.5px; color: var(--pd-muted); }
.pd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pd-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #00a63f; }
.pd-dot--call { border-color: var(--pd-call); }

/* ---------- list ---------- */
.pd-list { container-type: inline-size; min-width: 0; background: var(--pd-panel); border: 1px solid var(--pd-line); border-radius: 14px; padding: 12px 12px 6px; }
.pd-tools { display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--pd-line); }
.pd-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--pd-input); border: 1px solid var(--pd-line); color: var(--pd-muted); font-size: 16px; }
.pd-search:focus-within { border-color: var(--pd-accent); }
.pd-search input { flex: 1; min-width: 0; height: 42px; padding: 0; margin: 0; border: 0; outline: 0; background: transparent; color: var(--pd-text); font: inherit; font-size: 14px; }
.pd-search input::placeholder { color: var(--pd-muted); }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chip {
  padding: 6px 11px; margin: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--pd-line); background: var(--pd-panel-2); color: var(--pd-text);
  font: inherit; font-size: 12px; line-height: 1.2;
}
.pd-chip b { margin-left: 3px; font-weight: 700; color: var(--pd-muted); }
.pd-chip:hover { border-color: var(--pd-accent); }
.pd-chip.is-on { background: var(--pd-accent); border-color: var(--pd-accent); color: var(--pd-accent-ink); }
.pd-chip.is-on b { color: inherit; }

.pd-nudge {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; align-items: center;
  margin: 10px 0 2px; padding: 12px; border-radius: 12px;
  background: var(--pd-accent-soft); border: 1px solid var(--pd-accent);
}
.pd-nudge[hidden] { display: none; }
.pd-nudge__icon { font-size: 26px; color: var(--pd-accent); }
.pd-nudge__text { font-size: 13px; line-height: 1.45; }
.pd-nudge__text strong { display: block; font-size: 14px; }
.pd-nudge__btns { display: flex; align-items: center; gap: 6px; }
.pd-nudge__go { padding: 8px 12px; border-radius: 9px; background: var(--pd-accent); color: var(--pd-accent-ink) !important; font-size: 13px; font-weight: 700; text-decoration: none !important; white-space: nowrap; }
.pd-nudge__x { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--pd-muted); cursor: pointer; font-size: 16px; }

.pd .pd-empty { margin: 14px 4px; padding: 0; font-size: 13px; color: var(--pd-muted); }
.pd .pd-empty[hidden] { display: none; }
.pd .pd-h3 { margin: 18px 4px 4px; font-size: 14px; color: var(--pd-text); }
.pd .pd-h3[hidden] { display: none; }

.pd .pd-rows { list-style: none; margin: 0; padding: 0; }
.pd .pd-row {
  display: grid; grid-template-columns: 34px 44px minmax(0, 1fr) auto; gap: 4px 11px; align-items: center;
  margin: 0; padding: 10px 6px; border-top: 1px solid var(--pd-line);
  font-size: 13px; line-height: 1.4; color: var(--pd-text); list-style: none;
  scroll-margin-top: 90px; transition: background 0.2s;
}
.pd .pd-rows > .pd-row:first-child { border-top: 0; }
.pd .pd-row.is-variant { border-top-style: dashed; }
.pd .pd-row[hidden] { display: none; }
.pd .pd-row.is-active { background: var(--pd-accent-soft); box-shadow: inset 3px 0 0 var(--pd-accent); border-radius: 6px; }
.pd .pd-row.is-flash { animation: pd-flash 1.2s ease-out; }
@keyframes pd-flash { 0% { background: rgba(0, 204, 78, 0.35); } 100% { background: var(--pd-accent-soft); } }

.pd .pd-ref {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; margin: 0;
  border-radius: 50%; border: 2px solid var(--pd-accent); background: transparent; color: var(--pd-text);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1;
}
.pd .pd-row:not(.is-buy) .pd-ref { border-color: var(--pd-call); }
.pd .pd-ref:hover:not(:disabled), .pd .pd-ref:focus-visible { background: var(--pd-accent); color: var(--pd-accent-ink); outline: none; }
.pd .pd-ref:disabled { cursor: default; border-style: dashed; opacity: 0.75; }
.pd .pd-row.is-variant .pd-ref { opacity: 0.5; transform: scale(0.85); }
.pd .pd-ref--none { border: 0; color: var(--pd-muted); cursor: default; }

.pd .pd-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: transparent; display: grid; place-items: center; }
.pd .pd-thumb img { width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 8px; object-fit: contain; background: #fff; }
.pd .pd-thumb:empty { background: var(--pd-panel-2); }

.pd .pd-info { min-width: 0; }
.pd .pd-desc { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.pd .pd-sub { margin-top: 2px; font-size: 12px; color: var(--pd-muted); overflow-wrap: anywhere; }
.pd .pd-sub a { color: var(--pd-muted); text-decoration: underline; text-decoration-color: rgba(127, 127, 127, 0.5); }
.pd .pd-sub a:hover { color: var(--pd-accent); }
.pd .pd-pn { font-family: Consolas, "Courier New", monospace; color: var(--pd-text); margin-right: 4px; }
.pd .pd-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.pd .pd-tag { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.2px; border: 1px solid currentColor; }
.pd .pd-tag--kit { color: var(--pd-kit); }
.pd .pd-tag--up { color: var(--pd-gold); }
.pd .pd-tag--bo { color: #ff9f43; }
.pd .pd-tag--cart { color: var(--pd-accent); }
.pd .pd-note { margin-top: 4px; font-size: 11.5px; color: var(--pd-muted); font-style: italic; }

.pd .pd-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
.pd .pd-price { font-size: 15px; font-weight: 700; white-space: nowrap; }
.pd .pd-price s { margin-right: 4px; font-size: 12px; font-weight: 400; color: var(--pd-muted); }
.pd .pd-act { display: flex; align-items: center; gap: 6px; }
.pd .pd-qty { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--pd-line); border-radius: 9px; background: var(--pd-input); overflow: hidden; }
.pd .pd-qty__btn { display: grid; place-items: center; width: 26px; height: 100%; padding: 0; margin: 0; border: 0; background: transparent; color: var(--pd-text); cursor: pointer; font-size: 12px; }
.pd .pd-qty__btn:hover { color: var(--pd-accent); }
.pd .pd-qty input { width: 28px; height: 100%; padding: 0; margin: 0; border: 0; outline: 0; background: transparent; color: var(--pd-text); text-align: center; font: inherit; font-size: 13px; }
.pd .pd-add, .pd .pd-call {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; margin: 0;
  border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; text-decoration: none;
}
.pd .pd-add { border: 0; background: var(--pd-accent); color: var(--pd-accent-ink); }
.pd .pd-add:hover { filter: brightness(1.08); }
.pd .pd-add.is-added { background: transparent; color: var(--pd-accent); box-shadow: inset 0 0 0 2px var(--pd-accent); }
.pd .pd-call { border: 1px solid var(--pd-line); background: var(--pd-panel-2); color: var(--pd-text) !important; }
.pd .pd-call:hover { border-color: var(--pd-accent); }
.pd .pd-buy--none span { font-size: 11.5px; color: var(--pd-muted); text-align: right; max-width: 120px; line-height: 1.3; }

@container (max-width: 470px) {
  .pd .pd-row { grid-template-columns: 32px 40px minmax(0, 1fr); }
  .pd .pd-buy { grid-column: 3 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .pd .pd-buy--call, .pd .pd-buy--none { justify-content: flex-start; }
  .pd .pd-buy--none span { text-align: left; max-width: none; }
  .pd .pd-thumb { width: 40px; height: 40px; }
}

.pd .pd-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) {
  .pd-hot { width: max(var(--pd-hs, 3%), calc(20px / var(--pd-z, 1))); border-width: 1.5px; }
  .pd-jump { padding: 12px; gap: 11px; }
  .pd-jump__icon { width: 40px; height: 40px; font-size: 21px; }
  .pd-jump__text strong { font-size: 14.5px; }
  .pd-list { padding: 10px 8px 4px; }
  .pd-viewer { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-jump__arrow, .pd-hot.is-active, .pd .pd-row.is-flash { animation: none; }
}
