/*
  Product detail — shared by the 10 szerelvenygyartas.html product-card
  subpages (code/szerelvenygyartas/, filenames slugified from their full
  product title, e.g.
  "fojtokupos_szabalyozo_illetve_elzaro_szelepek_200c_ig_020_as_tipus.html")
  and the 6 leser-termekek.html product-card subpages (code/leser-termekek/).
  Each page reuses page-hero.css for its header; this file covers the
  blocks unique to these pages: a spec sheet (label/value pairs, only the
  rows that particular product actually has on the real brunnbauer.hu
  page), an optional .product-detail__family sub-group (a repeated
  heading + spec grid used when one product page covers several distinct
  sub-families, e.g. the LESER rugóterhelésű/vezérelt pages' six/two
  families), and a rehosted-PDF downloads list. The 126/166
  szerelvenygyartas pages and most leser-termekek pages add a
  .product-detail__advantages bullet list; the 016 szerelvenygyartas page
  and two leser-termekek pages (biztonsági szelep átadása, leser
  raktárkészlet) have no .product-detail__downloads block — no PDFs exist
  for those on the old site.
*/

.product-detail {
  background: var(--color-white);
  padding-top: var(--space-9); padding-bottom: var(--space-9);
}

.product-detail__section + .product-detail__section {
  margin-top: var(--space-8);
}

.product-detail__eyebrow {
  color: var(--color-slate-600);
  font-family: var(--font-eyebrow);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-eyebrow);
  text-transform: uppercase;
}

.product-detail__title {
  margin-top: var(--space-3);
}

.product-detail__divider {
  width: 56px;
  height: 3px;
  margin-top: var(--space-5);
  background: var(--color-red-600);
  border-radius: 2px;
}

/* ---- Spec sheet + product photo ---- */
.product-detail__specs-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
  align-items: stretch;
}

.product-detail__specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  align-content: start;
}

/* Beside the photo the spec boxes fill the full row height, so the box
   block and the photo share top and bottom edges. */
.product-detail__specs-layout > .product-detail__specs {
  grid-auto-rows: 1fr;
  align-content: stretch;
}

.product-detail__specs-media {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border-radius: 24px 0 24px 0;
  box-shadow: var(--shadow-md);
}

.product-detail__specs-media img {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-spring);
}

.product-detail__specs-media:hover img {
  transform: scale(1.08);
}

.product-detail__spec {
  padding: var(--space-5);
  background: var(--color-surface);
  /* Diagonal pair, same convention as .products__card / .cert-card. */
  border-radius: 24px 0 24px 0;
  box-shadow: var(--shadow-sm);
}

.product-detail__spec-label {
  color: var(--color-slate-600);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-detail__spec-value {
  margin-top: var(--space-2);
  color: var(--color-navy-900);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

/* ---- Family sub-groups (e.g. the 6 LESER product families) ---- */
.product-detail__family {
  margin-top: var(--space-6);
}

/* Family after family (e.g. 1.1 -> 1.2): 64px, so each heading clearly
   belongs to the boxes below it, not to the ones above (2026-11-15, user
   request; was 32px). The first family under the divider keeps 32px. */
.product-detail__family + .product-detail__family {
  margin-top: var(--space-8);
}

.product-detail__family-title {
  margin-bottom: var(--space-4);
}

.product-detail__note {
  margin-top: var(--space-5);
  color: var(--color-slate-600);
  font-size: var(--fs-small);
  font-style: italic;
}

/* In-text links in notes: red, bold, underlined so they read as links */
.product-detail__note a {
  color: var(--color-red-600);
  font-weight: var(--fw-bold);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease-out), text-decoration-color 0.2s var(--ease-out);
}

.product-detail__note a:hover {
  color: var(--color-red-700);
  text-decoration-thickness: 2px;
}

.product-detail__note a:focus-visible {
  outline: 2px solid var(--color-red-600);
  outline-offset: 2px;
  border-radius: 2px;
}

.product-detail__note a:active {
  color: var(--color-navy-900);
}

/* Lead-in line between two lists (Leser raktárkészlet: parts, then
   "Alkatrészeket tartunk az alábbi típusokhoz is:" + the type list). */
.product-detail__list-intro {
  margin-top: var(--space-6);
  color: var(--color-navy-900);
  font-weight: var(--fw-bold);
}

.product-detail__list-intro + .product-detail__advantages-list {
  margin-top: var(--space-4);
}

/* ---- Advantages (126 / 166 only) ---- */
.product-detail__advantages-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.product-detail__advantage {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: #b4c7e7; /* one-off light blue, same literal used across products.css/certifications.css */
  border-radius: 24px 0 24px 0;
  font-weight: var(--fw-bold);
  font-size: var(--fs-small);
  color: var(--color-navy-900);
}

.product-detail__advantage svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--color-red-600);
}

/* ---- Downloads ---- */
.product-detail__downloads-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.product-detail__download {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  transition: transform var(--duration-base) var(--ease-spring), box-shadow var(--duration-base) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.product-detail__download:hover,
.product-detail__download:focus-within {
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-detail__download:active {
  transform: translateY(0);
}

/* Opens the PDF in a new tab. The separate .product-detail__download-meta
   link below is the only element that actually downloads the file. */
.product-detail__download-open {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: inherit;
  text-decoration: none;
}

.product-detail__download-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--color-navy-900);
  border-radius: var(--radius-sm);
  color: var(--color-white);
}

.product-detail__download-icon svg {
  width: 20px;
  height: 20px;
}

.product-detail__download-label {
  font-weight: var(--fw-bold);
  font-size: var(--fs-small);
  color: var(--color-navy-900);
}

.product-detail__download-meta {
  align-self: flex-start;
  margin-left: calc(40px + var(--space-4));
  color: var(--color-slate-400);
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.product-detail__download-meta:hover,
.product-detail__download-meta:focus-visible {
  color: var(--color-red-600);
  text-decoration: underline;
}

/* ---- Tablet / mobile (<= 768px) ---- */
@media (max-width: 768px) {
  /* Family h3s one step below the section h2 (user, 2026-11-18): the
     fluid --fs-h3 (25.2px) was bigger than the stepped 24px h2 on phones. */
  .product-detail__family-title {
    font-size: calc(var(--fs-h2) * 0.85);
  }

  .product-detail {
    padding-top: var(--space-8); padding-bottom: var(--space-8);
  }

  .product-detail__specs-layout {
    grid-template-columns: 1fr;
  }

  /* width: 100% is required (2026-11-21): a grid item with aspect-ratio
     does not stretch, and its only content is the absolute img, so it was
     0x0 and the photo never showed on phones/tablets. */
  .product-detail__specs-media {
    order: -1;
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .product-detail__advantages-list,
  .product-detail__downloads-list {
    grid-template-columns: 1fr;
  }
}

/* ---- Mobile (<= 560px) ---- */
@media (max-width: 560px) {
  .product-detail__specs {
    grid-template-columns: 1fr;
  }
}

/* ---- Uncropped spec photo (--full-photo, 126 page; 2026-11-25, user) ----
   The photo box keeps the photo's own shape (1600x920), so nothing is cut off
   and there is no empty band. At >=1220px the photo column is wider and the
   spec boxes less padded, so the photo is taller than the specs (367 vs 342
   at 1440) and the spec boxes stretch to its height (shared top/bottom edges
   as on the other pages). Below 1220px (at 1200-1219 they were still 5-6px taller) the specs are always taller than the
   photo could be, so the photo sits full width above them, as on phones.
   Ratio must match the photo file; also in main.js's aspect-ratio table. */
.product-detail__specs-layout--full-photo {
  grid-template-columns: minmax(0, 1fr);
}

.product-detail__specs-layout--full-photo .product-detail__specs-media {
  order: -1;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1600 / 920;
  align-self: start;
}

@media (min-width: 1220px) {
  .product-detail__specs-layout--full-photo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .product-detail__specs-layout--full-photo .product-detail__specs-media {
    order: 0;
  }

  .product-detail__specs-layout--full-photo .product-detail__spec {
    padding: var(--space-4) var(--space-5);
  }

  /* auto rows (not the shared 1fr): 1fr made every row as tall as the
     2-line one, so the specs ran past the photo; align-content: stretch
     still spreads the spare height over the rows. */
  .product-detail__specs-layout--full-photo > .product-detail__specs {
    grid-auto-rows: auto;
  }
}

