/* =====================================================================
   FAGOR PROFESSIONAL DE — PRODUKTKATALOG
   Ergänzt style.css. Verwendet ausschließlich Tokens aus tokens.css:
   kein Radius, kein Schatten, Roboto, Markenrot #E22119.
   Datenquelle: assets/data/produkte.js (aus dem PDF-Katalog erzeugt).
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Seitenkopf
   --------------------------------------------------------------------- */
.p-head {
  margin-top: var(--header-h);   /* fixierter Header, wie .hero in style.css */
  padding: 60px 0 30px;
  border-bottom: 1px solid var(--line-soft);
}
.p-head .breadcrumb {
  font-size: 14px;
  line-height: 20px;
  font-weight: 300;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.p-head .breadcrumb a:hover { color: var(--brand); }
.p-head .breadcrumb span[aria-current] { color: var(--ink); }
.p-head h1 { margin-bottom: 18px; }
.p-head .lead {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  max-width: 780px;
}
.p-head .source {
  margin-top: 18px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------------
   2. Filterleiste — klebt unter dem Header
   --------------------------------------------------------------------- */
.p-filter {
  position: sticky;
  top: var(--header-h);
  z-index: var(--z-search);
  background: var(--white);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
}
.p-filter-inner { display: flex; flex-direction: column; gap: 14px; }

.p-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.p-chip {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  padding: 8px 14px;
  cursor: pointer;
  transition: background var(--t-btn), border-color var(--t-btn), color var(--t-btn);
}
.p-chip:hover { border-color: var(--brand); color: var(--brand); }
.p-chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}
/* opacity .75 mischte Weiss auf --brand zu #F8C8C6 (3,15:1).
   Ohne opacity: Weiss auf #E22119 = 4,70:1 (WCAG AA).
   Die optische Zuruecknahme uebernimmt weiterhin font-weight 300. */
.p-chip .n { font-weight: 300; margin-left: 6px; }

.p-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.p-search {
  position: relative;
  flex: 1 1 320px;
  min-width: 220px;
}
.p-search input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  line-height: 22px;
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-soft);
  padding: 10px 38px 10px 12px;
}
.p-search input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.p-search svg {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  fill: none; stroke: var(--ink-muted); stroke-width: 2;
  pointer-events: none;
}
.p-select {
  /* Leeres <select> ist schmal; sobald produkte.js die Baureihen einfuegt,
     waechst es und die Flex-Zeile bricht anders um -> Layout-Shift.
     Ab 768px greift weiter unten width:100%, dort ist es egal. */
  min-width: 220px;
  font-family: inherit;
  font-size: 15px;
  line-height: 22px;
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-soft);
  padding: 10px 12px;
  min-width: 200px;
  cursor: pointer;
}
.p-count {
  margin-left: auto;
  font-size: 14px;
  line-height: 20px;
  /* Platz fuer eine Zeile reservieren: #p-count und #p-serie sind im HTML
     leer und werden erst von produkte.js gefuellt. Ein leeres <p> ist 0px
     hoch, mit Text 20px — das verschob alles darunter.
     Gemessen: CLS 0.353 auf /produkte.html, Verursacher `.p-tools`
     (Lighthouse `layout-shifts` / `cls-culprits-insight`). */
  min-height: 20px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.p-reset {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}
.p-reset:hover { color: var(--brand); }

/* ---------------------------------------------------------------------
   3. Produktgitter — Bild links, Merkmale rechts
   --------------------------------------------------------------------- */
.p-results { padding: 40px 0 20px; }

/* kein text-transform: Markennamen wie iKORE müssen ihre Schreibweise behalten */
.p-group-title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: 300;
  margin: 40px 0 6px;
}
.p-results > .p-group:first-child .p-group-title { margin-top: 0; }
.p-group-sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-muted);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--brand);
}

.p-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.p-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  border: 1px solid var(--line-soft);
  padding: 20px;
  background: var(--white);
  transition: border-color var(--t-default);
}
.p-card:hover { border-color: var(--brand); }

.p-card .p-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-100);
  padding: 12px;
  min-height: 190px;
}
.p-card .p-figure img {
  max-width: 100%;
  max-height: 210px;
  width: auto; height: auto;
  object-fit: contain;
  mix-blend-mode: multiply; /* Katalogbilder haben weißen Hintergrund */
}

.p-card .p-body { display: flex; flex-direction: column; min-width: 0; }
.p-card .p-serie {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.p-card h3 {
  font-size: 19px;
  line-height: 24px;
  font-weight: 500;
  margin-bottom: 12px;
  word-break: break-word;
}

.p-feat {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 7px;
}
.p-feat li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 300;
}
/* In der Karte auf 3 Zeilen kürzen – der volle Text steht im Detail-Dialog */
.p-card .p-feat li {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-feat li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 1px;
  background: var(--brand);
}

.p-models {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.p-models span {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  color: var(--ink-muted);
  white-space: nowrap;
}
.p-models span.more { border-style: dashed; }

.p-card .p-actions { margin-top: auto; display: flex; align-items: center; gap: 16px; }
.p-detail-btn {
  appearance: none;
  border: 0;
  background: transparent;
  /* Dokunma hedefi: 20px yükseklik yerine 44px (dikey padding ile) */
  padding: 12px 4px 12px 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color var(--t-default);
}
.p-detail-btn .dash-line { width: 30px; margin: 0; transition: width var(--t-default); }
.p-detail-btn:hover { color: var(--brand); }
.p-detail-btn:hover .dash-line { width: 44px; }
.p-page {
  font-size: 12px;
  color: var(--ink-muted);
  margin-left: auto;
  white-space: nowrap;
}

.p-more { text-align: center; padding: 30px 0 10px; }
.p-more-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.p-show-all { border: 1px solid var(--line, #d6d2ce); background: transparent; color: var(--ink, #2e2d2c); padding: 12px 18px; font: inherit; cursor: pointer; }
.p-show-all:hover, .p-show-all:focus-visible { border-color: var(--red, #e22119); color: var(--red, #e22119); }
.p-empty {
  padding: 60px 0;
  text-align: center;
  font-size: var(--fs-body);
  font-weight: 300;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------------
   4. Detail-Dialog
   --------------------------------------------------------------------- */
.p-dialog {
  border: 0;
  padding: 0;
  width: min(920px, 92vw);
  max-height: 88vh;
  background: var(--white);
  color: var(--ink);
}
.p-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.p-dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line-soft);
}
.p-dialog-head h2 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 400;
}
.p-dialog-head .p-serie { margin-bottom: 4px; }
.p-dialog-close {
  appearance: none;
  margin-left: auto;
  border: 1px solid var(--line-soft);
  background: var(--white);
  color: var(--ink);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background var(--t-btn), color var(--t-btn), border-color var(--t-btn);
}
.p-dialog-close:hover { background: var(--brand); border-color: var(--brand); color: var(--white); }
.p-dialog-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.p-dialog-body {
  padding: 24px 28px 32px;
  overflow-y: auto;
  max-height: calc(88vh - 92px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.p-dialog-body .p-figure {
  background: var(--surface-100);
  padding: 18px;
  display: grid;
  place-items: center;
}
.p-dialog-body .p-figure img { max-width: 100%; height: auto; mix-blend-mode: multiply; }
.p-dialog h3 {
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.p-dialog h3 + * { margin-bottom: 26px; }
.p-tech {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}
.p-tech th, .p-tech td {
  text-align: left;
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.p-tech th { font-weight: 400; color: var(--ink-muted); width: 46%; }
.p-tech td { font-weight: 300; }
.p-dialog .p-models span { font-size: 13px; }
.p-dialog-note {
  grid-column: 1 / -1;
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

/* ---------------------------------------------------------------------
   5. Teaser auf der Startseite — kategorisierter Katalogeinstieg
   Zwei Ebenen je Kachel: Gerätegruppe (.tile-head) und darunter die
   Baureihen (.tile-reihen) als Direktfilter. Kein Radius, kein Schatten
   (DESIGN-SYSTEM.md §4); Trennlinien in --line-soft.
   --------------------------------------------------------------------- */
.section-catalog { padding: 60px 0 40px; background: var(--surface-100); }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 40px 0 34px;
}
.catalog-tile {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line-soft);
  padding: 18px;
  transition: border-color var(--t-default), transform var(--t-default);
}
.catalog-tile:hover { border-color: var(--brand); transform: translateY(-2px); }

/* --- Ebene 1: Gerätegruppe ---------------------------------------- */
.catalog-tile .tile-head {
  display: flex;
  flex-direction: column;
  color: inherit;
}
.catalog-tile .thumb {
  display: grid;
  place-items: center;
  height: 130px;
  margin-bottom: 14px;
}
.catalog-tile .thumb img {
  max-height: 130px; max-width: 100%;
  width: auto; height: auto;
  mix-blend-mode: multiply;
}
.catalog-tile .name {
  font-size: 17px;
  line-height: 22px;
  font-weight: 500;
  margin-bottom: 4px;
}
.catalog-tile .tile-head:hover .name { color: var(--brand); }
.catalog-tile .n {
  font-size: 13px;
  line-height: 18px;
  font-weight: 300;
  color: var(--ink-muted);
}

/* --- Ebene 2: Baureihen ------------------------------------------- */
.tile-reihen {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}
.tile-reihen li { border-bottom: 1px solid var(--line-soft); }
.tile-reihen li:last-child { border-bottom: 0; }
.tile-reihen a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  transition: color var(--t-default);
}
.tile-reihen a:hover { color: var(--brand); }
.tile-reihen .c {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 300;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.tile-reihen a:hover .c { color: var(--brand); }

/* Achte Kachel: Gesamtkatalog statt Baureihenliste */
.catalog-tile .tile-note {
  margin: 14px 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 20px;
  font-weight: 300;
  color: var(--ink-muted);
}
.catalog-tile .tile-all {
  margin-top: auto;
  font-size: 14px;
  line-height: 24px;
}

/* ---------------------------------------------------------------------
   6. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .p-filter { top: var(--header-h); }
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .p-grid { grid-template-columns: minmax(0, 1fr); }
  .p-dialog-body { grid-template-columns: minmax(0, 1fr); }
  .p-dialog-body .p-figure { max-width: 320px; }
}
@media (max-width: 767px) {
  .p-head { padding: 34px 0 24px; }
  .p-card { grid-template-columns: minmax(0, 1fr); }
  .p-card .p-figure { min-height: 0; }
  .p-card .p-figure img { max-height: 240px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  /* Telefonda kachel dar kalıyor: görsel ve baureihe listesi küçülür,
     adet rozetleri düşer — kategori kırılımı yine de okunur kalır.    */
  .catalog-tile { padding: 14px; }
  .catalog-tile .thumb { height: 100px; margin-bottom: 10px; }
  .catalog-tile .thumb img { max-height: 100px; }
  .catalog-tile .name { font-size: 16px; }
  .tile-reihen { margin: 10px 0 14px; }
  .tile-reihen a { padding: 6px 0; font-size: 13px; line-height: 18px; }
  .tile-reihen .c { display: none; }
  .catalog-tile .tile-note { margin: 10px 0 14px; padding-top: 10px; font-size: 13px; line-height: 18px; }
  .p-count { margin-left: 0; width: 100%; }
  .p-select { width: 100%; }

  /* Kategori chip'leri 8 satır kaplıyordu (176px). Telefonda tek satır
     halinde yatay kaydırılır — katalogda alışıldık desen.              */
  .p-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Kenarlara taşarak "daha var" hissi ver, container padding'ini telafi et */
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: 2px;
  }
  .p-chips::-webkit-scrollbar { display: none; }
  .p-chip { flex: 0 0 auto; scroll-snap-align: start; padding: 11px 14px; }
}

@media (max-width: 575px) {
  .p-filter { position: static; }
  .catalog-grid { grid-template-columns: minmax(0, 1fr); }
  /* Tek kolonda kachel tam genişlikte: baureihe listesi iki kolona
     bölünür, aksi hâlde katalog bölümü telefonda 3000px'i aşıyordu.  */
  .tile-reihen {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
  /* Iki kolonda son satır iki hücreden oluşur; last-child istisnası
     tek tarafı çizgisiz bırakıyordu — grid'de tüm satırlar çizgili.  */
  .tile-reihen li:last-child { border-bottom: 1px solid var(--line-soft); }
  .catalog-tile .thumb { height: 90px; }
  .catalog-tile .thumb img { max-height: 90px; }
  .p-dialog-head, .p-dialog-body { padding-inline: 18px; }

  /* Detay diyaloğu telefonda tam ekran "sheet" olur: başlık sabit kalır,
     yalnız gövde kayar. Bunun için açıkken flex kolona çevrilir.        */
  .p-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    top: 0; left: 0;
  }
  .p-dialog[open] { display: flex; flex-direction: column; }
  .p-dialog-head { flex: 0 0 auto; }
  .p-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
  .p-dialog-body .p-figure { max-width: none; }
}

/* iOS Safari 16px'ten küçük yazı tipli alanda sayfayı yakınlaştırır */
@media (max-width: 991px) {
  .p-search input, .p-select { font-size: 16px; }
  .p-reset { padding: 10px 4px; }
}

@media print {
  .p-filter, .p-more, .p-detail-btn { display: none !important; }
  .p-grid { grid-template-columns: 1fr; }
  .p-card { break-inside: avoid; border-color: #999; }
}


/* =====================================================================
   ARTIKELTABELLE IM DETAILDIALOG  (Preisliste EXPORT 2026)
   Ersetzt bei Produkten mit Artikeldaten die reinen Modell-Chips.
   Die Spaltenzahl waehlt assets/js/produkte.js je Produkt (max. 4
   Merkmale), damit die Tabelle auf dem Telefon lesbar bleibt.
   ===================================================================== */
.p-art-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line-soft);
}
.p-art {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 19px;
}
.p-art th,
.p-art td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  white-space: nowrap;
}
.p-art thead th {
  position: sticky;
  top: 0;
  background: var(--surface-100);
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.p-art tbody th { font-weight: 400; color: var(--ink); }
.p-art tbody td { font-weight: 300; color: var(--ink-muted); }
.p-art tbody tr:last-child th,
.p-art tbody tr:last-child td { border-bottom: 0; }

.p-art-code { font-variant-numeric: tabular-nums; }
.p-art-code .p-art-alt {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
}
.p-art-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-muted);
}

/* =====================================================================
   MODELL- UND ARTIKELNUMMERNSUCHE  (Abschnitt #modelle)
   ===================================================================== */
.p-modelle {
  padding: 64px 0 72px;
  background: var(--surface-100);
  border-top: 1px solid var(--line-soft);
}
.p-modelle .lead {
  max-width: 62ch;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  margin: 16px 0 8px;
}
.p-modelle .source {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
  margin: 0 0 24px;
}
.p-modelle .source a { color: var(--brand); }

.m-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.m-tools .p-search { flex: 1 1 320px; }
.m-count {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.m-status { margin: 0; font-size: 14px; color: var(--ink-muted); }
.m-error { color: var(--brand); }

.m-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid var(--line-soft);
  max-height: 70vh;
  overflow-y: auto;
}
.m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 19px;
}
.m-table th,
.m-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.m-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-200);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.m-table tbody th { font-weight: 400; color: var(--ink); white-space: nowrap; }
.m-table tbody td { font-weight: 300; color: var(--ink-muted); }
.m-table tbody tr:hover th,
.m-table tbody tr:hover td { background: var(--surface-100); }

.m-code {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.m-code-alt { display: block; color: var(--ink-muted); font-size: 12px; }
.m-page { text-align: right; font-variant-numeric: tabular-nums; }

.m-more { margin-top: 20px; }

@media (max-width: 991px) {
  .p-modelle { padding: 44px 0 52px; }
  /* Bereich und Seite fallen zuerst weg - Modell und Nummer bleiben */
  .m-table th:nth-child(4), .m-table td:nth-child(4),
  .m-table th:nth-child(5), .m-table td:nth-child(5) { display: none; }
  .m-count { width: 100%; }
}

@media print {
  .p-modelle { display: none !important; }
}
