/* ==========================================================================
   Template: single-product
   Enqueued only on is_singular('product') by the theme — see functions.php hook.
   ========================================================================== */

.single-product {
  --sp-border: #e5e5e5;
  --sp-muted: #6b7280;
  --sp-brand: #cf2a2f;
  --sp-card-bg: #f8f8f8;
}

.single-product__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: var(--sp-brand);
  margin-bottom: 0.4rem;
}

.single-product__summary {
  font-size: 1.15rem;
  color: var(--sp-muted);
  margin-bottom: 1.5rem;
}

.single-product__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.single-product__gallery-figure {
  margin: 0;
  background: var(--sp-card-bg);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.single-product__gallery-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.single-product__body {
  margin-bottom: 2rem;
}

.single-product__section {
  margin-top: 2.5rem;
}

.single-product__section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ------- Specs table ------- */

.single-product__specs {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--sp-border);
}

.single-product__specs th,
.single-product__specs td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--sp-border);
  vertical-align: top;
  text-align: left;
}

.single-product__specs th {
  font-weight: 600;
  width: 35%;
  color: #111;
  background: var(--sp-card-bg);
}

/* ------- Documents list ------- */

.single-product__doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.single-product__doc-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--sp-card-bg);
  border: 1px solid var(--sp-border);
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.single-product__doc-link:hover {
  background: var(--sp-brand);
  border-color: var(--sp-brand);
  color: #fff;
}

.single-product__doc-icon {
  font-size: 1.4rem;
}

.single-product__doc-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.single-product__doc-title {
  font-weight: 600;
}

.single-product__doc-description {
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.75;
}

.single-product__doc-action {
  font-size: 1rem;
}

/* ------- Sidebar card ------- */

.single-product__sidebar {
  position: sticky;
  top: 110px;
  align-self: flex-start;
}

@media (max-width: 991.98px) {
  .single-product__sidebar { position: static; margin-top: 2rem; }
}

.single-product__card {
  background: var(--sp-card-bg);
  border: 1px solid var(--sp-border);
  border-radius: 4px;
  padding: 1.5rem;
}

.single-product__card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.single-product__attributes {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.single-product__attribute {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.single-product__attribute dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sp-muted);
  margin: 0;
}

.single-product__attribute dd {
  font-size: 0.95rem;
  color: #111;
  margin: 0;
}

.single-product__attributes-empty {
  color: var(--sp-muted);
  font-size: 0.9rem;
}

.single-product__back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

/* ==========================================================================
   Single product — dark dotted page background
   ========================================================================== */

.site-content--single-product.bg-dark-pattern {
  background-color: #0a0a0a;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.single-product__hero {
  --sp-hero-text: rgba(255, 255, 255, 0.92);
  --sp-hero-muted: rgba(255, 255, 255, 0.62);
  --sp-hero-cell-bg: rgba(255, 255, 255, 0.04);
  --sp-hero-cell-border: rgba(255, 255, 255, 0.08);
  --sp-hero-brand: #cf2a2f;

  padding: 4rem 0 5rem;
  color: var(--sp-hero-text);
}

.single-product__breadcrumb {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  line-height: 1.25;
}

.single-product__breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.single-product__breadcrumb a:hover,
.single-product__breadcrumb a:focus {
  color: #fff;
  text-decoration: underline;
}

@media (min-width: 992px) {
  .single-product__hero {
    padding: 5.5rem 0 6.5rem;
  }
}

.single-product__hero-row {
  align-items: center;
}

/* ---- Eyebrow pill ---- */

.single-product__hero-eyebrow {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: var(--sp-hero-brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  margin-bottom: 1.25rem;
}

/* ---- Title + summary ---- */

.single-product__hero-title {
  margin: 0 0 0.6rem;
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.single-product__hero-summary {
  margin: 0 0 1.75rem;
  color: var(--sp-hero-muted);
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 36rem;
}

/* ---- Spec grid (3 × 2 on desktop, 2 × 3 on tablet, 1 × 6 on mobile) ---- */

.single-product__hero-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin: 0 0 1.75rem;
  max-width: 32rem;
}

@media (min-width: 576px) {
  .single-product__hero-specs {
    grid-template-columns: 1fr 1fr;
  }
}

.single-product__hero-spec {
  background: var(--sp-hero-cell-bg);
  border: 1px solid var(--sp-hero-cell-border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem 0.7rem;
}

.single-product__hero-spec dt {
  margin: 0 0 0.15rem;
  color: var(--sp-hero-muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.2;
}

.single-product__hero-spec dd {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
}

/* ---- CTA row ---- */

.single-product__hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.single-product__hero-btn--primary i,
.single-product__hero-btn--secondary i {
  margin-left: 0.4rem;
}

.single-product__hero-btn--secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent !important;
  border: none;
  color: var(--sp-hero-text);
  padding: 0.35rem 0.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.single-product__hero-btn--secondary:hover,
.single-product__hero-btn--secondary:focus {
  color: #fff;
  text-decoration: underline;
}

/* ---- Visual column (GLB / fallback image) ---- */

.single-product__hero-visual {
  position: relative;
  min-height: 360px;
}

@media (min-width: 992px) {
  .single-product__hero-visual {
    min-height: 480px;
  }
}

.single-product__hero-model {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 8px;
  overflow: hidden;
}

@media (min-width: 992px) {
  .single-product__hero-model {
    height: 480px;
  }
}

.single-product__hero-model canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}

.single-product__hero-model canvas:active {
  cursor: grabbing;
}

.single-product__hero-model.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: single-product-hero-spin 0.9s linear infinite;
  z-index: 1;
}

@keyframes single-product-hero-spin {
  to { transform: rotate(360deg); }
}

.single-product__hero-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* ==========================================================================
   Legacy body section — neutralise the white article on the dark page so
   the existing specs / docs / sidebar stay readable until they're
   replaced with proper dark-themed Cursor blocks.
   ========================================================================== */

.single-product--legacy {
  margin-top: 0;
  padding-top: 3rem;
}

/* ==========================================================================
   Technical spec sheet — dark section on the bg-dark-pattern page.
   Parameter / Typical / Unit table + Specifications/Documentation downloads.
   ========================================================================== */

.single-product__spec-sheet {
  padding: 4rem 0;
  color: #f5f5f5;
}

.single-product__spec-sheet-eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sp-brand);
  margin-bottom: 0.5rem;
}

.single-product__spec-sheet-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1.75rem;
}

.single-product__spec-sheet-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.single-product__spec-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: transparent;
  color: #f5f5f5;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}

.single-product__spec-download:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.single-product__spec-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

.single-product__spec-table thead th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cfcfcf;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.single-product__spec-table tbody th,
.single-product__spec-table tbody td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  text-align: left;
  font-weight: 400;
}

.single-product__spec-table tbody th {
  color: #fff;
  width: 45%;
}

.single-product__spec-table tbody td {
  color: #c9c9c9;
}

@media (max-width: 575.98px) {
  .single-product__spec-sheet-title {
    font-size: 1.9rem;
  }

  .single-product__spec-table thead th,
  .single-product__spec-table tbody th,
  .single-product__spec-table tbody td {
    padding: 0.7rem 0.85rem;
  }
}
