/* =====================================================================
   AE PERFORMANCE SUPPLY — Product Detail Page
   ===================================================================== */

.pdp-hero {
  display: grid;
  gap: 28px;
  padding-bottom: 32px;
}

/* ---- Gallery -------------------------------------------------------- */
.gallery__main {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.gallery__main img {
  width: 100%; height: 100%; object-fit: cover;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.gallery__badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--ink); color: #fff;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: var(--radius-sm); letter-spacing: 0.03em;
}
.gallery__thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.gallery__thumb {
  flex: 0 0 auto; width: 68px; height: 68px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--border); background: var(--surface); padding: 0;
}
.gallery__thumb.is-active { border-color: var(--accent); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Purchase panel --------------------------------------------------*/
.purchase-panel__eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint);
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.rating { display: inline-flex; align-items: center; gap: 5px; color: var(--warning); }
.rating svg { width: 13px; height: 13px; }

.purchase-panel h1 { font-size: 32px; margin-bottom: 6px; }
@media (min-width: 640px) { .purchase-panel h1 { font-size: 38px; } }

.price-row { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; }
.price { font-family: var(--font-mono); font-size: 30px; font-weight: 600; color: var(--ink); }
.price--was { font-family: var(--font-mono); font-size: 17px; color: var(--ink-faint); text-decoration: line-through; }
.stock-line { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.stock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.stock-line.is-low .stock-dot { background: var(--warning); }
.stock-line.in-stock { color: var(--success); }
.stock-line.is-low { color: var(--warning); }

/* Swatches — "machined chip" treatment */
.swatch-group { margin-bottom: 20px; }
.swatch-group__label {
  font-size: 13px; font-weight: 700; margin-bottom: 9px;
  display: flex; gap: 6px; align-items: baseline;
}
.swatch-group__label .current-value { font-weight: 500; color: var(--ink-muted); font-family: var(--font-body); }
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  position: relative;
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--border-strong), inset 0 1px 2px rgba(0,0,0,0.25), inset 0 -1px 1px rgba(255,255,255,0.25);
  cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.08s ease;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.is-selected { box-shadow: 0 0 0 2.5px var(--accent); }
.swatch:focus-visible { outline: 2px solid var(--secondary); outline-offset: 3px; }
.swatch__check {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; filter: drop-shadow(0 0 2px rgba(0,0,0,0.6));
}
.swatch.is-selected .swatch__check { opacity: 1; }
.swatch--text {
  border-radius: var(--radius-sm); width: auto; min-width: 46px; height: 38px;
  background: var(--surface); color: var(--ink); font-family: var(--font-mono);
  font-size: 13px; font-weight: 600; padding: 0 12px;
  box-shadow: none; border: 2px solid var(--border-strong);
}
.swatch--text.is-selected { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); }

/* Spec Readout — the signature Answer Box treatment */
.spec-readout {
  position: relative;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  margin: 4px 0 20px;
  overflow: hidden;
  border: 1px solid #262D34;
}
.spec-readout::before {
  content: "";
  position: absolute; top: 0; right: 0; width: 60px; height: 60px;
  background: repeating-linear-gradient(45deg, var(--accent) 0 4px, transparent 4px 10px);
  opacity: 0.9;
  -webkit-mask: linear-gradient(to bottom left, black 45%, transparent 46%);
          mask: linear-gradient(to bottom left, black 45%, transparent 46%);
}
.spec-readout__label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--accent); font-weight: 600; margin-bottom: 10px;
}
.spec-readout__stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; }
.spec-readout__stat { min-width: 70px; }
.spec-readout__num {
  font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: #fff; line-height: 1;
}
.spec-readout__unit { font-size: 12px; color: #9AA3AB; margin-left: 2px; }
.spec-readout__stat-label { font-size: 11px; color: #9AA3AB; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.spec-readout__copy { font-size: 14px; line-height: 1.6; color: #D7DBDF; margin: 0; }

.dims-line {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--ink-muted);
  padding: 14px 0; border-top: 1px solid var(--border); margin-top: 4px;
}
.dims-line strong { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.dims-line .dim-item { display: flex; align-items: center; gap: 6px; }
.dims-line svg { width: 15px; height: 15px; color: var(--ink-faint); }

.trust-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 12.5px; color: var(--ink-muted); }
.trust-row .item { display: flex; align-items: center; gap: 6px; }
.trust-row svg { width: 16px; height: 16px; color: var(--success); }

@media (min-width: 880px) {
  .pdp-hero { grid-template-columns: 1.15fr 1fr; gap: 44px; }
}

/* ---- Sticky mobile buy bar ------------------------------------------*/
.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -6px 18px rgba(0,0,0,0.08);
  transform: translateY(100%); transition: transform 0.2s ease;
}
.buy-bar.is-visible { transform: translateY(0); }
.buy-bar__price { font-family: var(--font-mono); font-weight: 700; font-size: 16px; white-space: nowrap; }
@media (min-width: 880px) { .buy-bar { display: none; } }

/* =====================================================================
   Section sub-nav (Overview / Specs / FAQ / Compare)
   ===================================================================== */
.section-nav {
  position: sticky; top: var(--header-h); z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.section-nav__list { display: flex; gap: 4px; padding: 0 20px; max-width: var(--max-width); margin: 0 auto; }
.section-nav__link {
  white-space: nowrap; padding: 14px 14px 12px; font-weight: 600; font-size: 14px;
  color: var(--ink-muted); border-bottom: 2px solid transparent;
}
.section-nav__link.is-active, .section-nav__link:hover { color: var(--ink); border-bottom-color: var(--accent); text-decoration: none; }

.pdp-section { padding: 44px 0; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 52px); }
.pdp-section:last-of-type { border-bottom: none; }
.pdp-section__head { margin-bottom: 22px; }
.pdp-section__eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--accent-dark); letter-spacing: 0.06em; margin-bottom: 6px; }
.pdp-section h2 { font-size: 26px; }
.prose { max-width: 68ch; color: var(--ink); font-size: 15.5px; }
.prose p + p { margin-top: 14px; }

/* ---- Specs & Fitment table -------------------------------------------*/
.spec-table { width: 100%; border-collapse: collapse; max-width: 640px; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table th, .spec-table td { text-align: left; padding: 12px 4px; font-size: 14.5px; vertical-align: top; }
.spec-table th { color: var(--ink-muted); font-weight: 600; width: 42%; }
.spec-table td { font-family: var(--font-mono); font-size: 13.5px; }

/* ---- FAQ accordion ----------------------------------------------------*/
.faq-list { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item__q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: none; border: none; text-align: left;
  padding: 18px 2px; font-weight: 600; font-size: 15.5px; color: var(--ink);
}
.faq-item__icon { flex: 0 0 auto; width: 22px; height: 22px; position: relative; }
.faq-item__icon::before, .faq-item__icon::after {
  content: ""; position: absolute; background: var(--ink); border-radius: 2px;
}
.faq-item__icon::before { top: 50%; left: 2px; right: 2px; height: 2px; margin-top: -1px; }
.faq-item__icon::after { left: 50%; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; transition: transform 0.15s ease; }
.faq-item.is-open .faq-item__icon::after { transform: rotate(90deg); opacity: 0; }
.faq-item__a { max-height: 0; overflow: hidden; transition: max-height 0.2s ease; }
.faq-item.is-open .faq-item__a { max-height: 400px; }
.faq-item__a p { padding: 0 2px 18px; margin: 0; color: var(--ink-muted); font-size: 14.5px; max-width: 68ch; }

/* ---- Comparison table (dyno-chart styling) -----------------------------*/
.compare-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.compare-table { border-collapse: collapse; width: 100%; min-width: 560px; background: var(--surface); }
.compare-table th, .compare-table td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); text-align: left; }
.compare-table thead th {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.03em;
  font-size: 13px; background: var(--surface-sunk); color: var(--ink-muted);
  position: sticky; top: 0;
}
.compare-table thead th:first-child { color: var(--ink); }
.compare-table tbody th { font-weight: 600; color: var(--ink-muted); white-space: nowrap; }
.compare-table td { font-family: var(--font-mono); }
.compare-table td.is-highlight { color: var(--accent-dark); font-weight: 600; background: var(--accent-tint); }

/* ---- Reviews ------------------------------------------------------ */
.stars { display: inline-flex; gap: 2px; color: var(--border); font-size: 15px; line-height: 1; }
.stars__star.is-filled { color: var(--accent); }
.review-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.review-summary__score { font-weight: 700; color: var(--ink); }
.review-summary__count { color: var(--ink-muted); font-size: 13.5px; }
.review-list { display: flex; flex-direction: column; gap: 22px; }
.review-item { border-bottom: 1px solid var(--border); padding-bottom: 22px; }
.review-item__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-item__title { font-size: 15px; margin: 0; color: var(--ink); }
.review-item__body { font-size: 14.5px; line-height: 1.6; color: var(--ink-muted); max-width: 68ch; margin: 0 0 10px; }
.review-item__meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-muted); }
.review-item__author { font-weight: 600; color: var(--ink); }
.review-item__badge {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent-dark); background: var(--accent-tint); border-radius: 999px; padding: 2px 8px;
}
.compare-table tr:last-child td, .compare-table tr:last-child th { border-bottom: none; }

/* JSON-LD / dev helper — never shown, just documents intent */
.jsonld-note { display: none; }
