/* katalog.css – Regeln nur für die Katalogseiten des Entwurfs
   (katalog.html, katalog-innenstuck.html, katalog-fassadenstuck.html, katalog-baustoffe.html,
   katalog-werkzeuge.html, produkt.html, warenkorb.html).
   Lädt NACH css/entwurf.css. Nur Variablen des Systems, keine eigenen Farbwerte.
   Kleinste Schrift: var(--t-label) = 15 px. Klickflächen mindestens 44 px. */

/* 1. Anwendungsseiten (Liste, Produkt, Warenkorb): der Abschnitt wächst mit dem Inhalt.
      Die Regel „ein Abschnitt je Bildschirm" gilt hier laut Auftrag nicht. */
main > section.app.section { height: auto; min-height: 100vh; min-height: 100svh; display: block; }
main > section.app > div.wrap:not(.grid) { display: block; height: auto; }
.app h1 { font-size: var(--t-h2); line-height: 1.1; }
main > section.app .section-head { margin-bottom: var(--s-6); }
.app__leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-5); margin-bottom: var(--s-5); }
.link--zurueck::after { content: none; }
.link--zurueck::before { content: "\2190"; display: inline-block; }
.app [hidden] { display: none !important; }

/* 2. Übersicht (katalog.html): Sprungziele unter der festen Kopfzeile, Unterkategorien */
.tile[id] { scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.kat-raster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-5) var(--gutter); }
.kat-raster .tile { gap: var(--s-2); --tile-ratio: 1 / 1; }
.kat-raster .tile__media > img { padding: var(--s-3); mix-blend-mode: multiply; }
.kat-raster .tile__head > h3 { font: 500 var(--t-body)/1.3 var(--font-text); letter-spacing: 0; }
.kat-raster .tile__facts { margin-top: 0; font-size: var(--t-label); }
@media (max-width: 1023px) { .kat-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .kat-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-4); } }

/* 3. Produktliste mit Kategorie-Auswahl (katalog-innenstuck.html, katalog-fassadenstuck.html)
      Ab 1024 px: links eine Spalte, die beim Scrollen unter der Kopfzeile stehen bleibt (sticky in .liste,
      endet deshalb mit der Liste, also vor dem Fußbereich); ist das Fenster niedriger als die Spalte,
      scrollt die Kategorienliste in sich, Überschrift und Suchfeld bleiben sichtbar.
      Darunter: keine Spalte; eine Leiste mit einem Knopf bleibt unter der Kopfzeile stehen und öffnet
      das Blatt (dialog.blatt) von unten. */
.liste { --spalte-oben: calc(var(--nav) + var(--s-5)); }

/* Kategorienliste: dieselben Zeilen in der Spalte und im Blatt */
.katwahl { display: flex; flex-direction: column; min-height: 0; }
.katwahl__titel { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; margin-bottom: var(--s-3); }
.katwahl__auswahl { font-weight: 500; margin-bottom: var(--s-3); }
.katliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.katliste__zeile { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 44px; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font: 500 17px/1.25 var(--font-text); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.katliste__zeile:hover { background: color-mix(in oklab, var(--ink) 8%, var(--bg)); }
.katliste__zeile[aria-current] { background: var(--ink); color: var(--bg); }
.katliste__zeile:focus-visible { outline-offset: -3px; }
.katliste__zeile[aria-current]:focus-visible { outline-color: var(--bg); }
.katliste__zahl { flex: none; font-weight: 400; font-variant-numeric: tabular-nums; }

/* Zeile über dem Raster: Trefferzahl, Sortierung, Filter zurücksetzen */
.lzeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); padding-bottom: var(--s-4); margin-bottom: var(--s-6); border-bottom: 1px solid var(--line); }
.lzeile__treffer { margin-right: auto; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lzeile__sort { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-small); font-weight: 500; }
.lzeile__sort select { height: 44px; padding: 0 var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: 400 var(--t-small)/1.4 var(--font-text); }
.lzeile__zurueck { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 500 var(--t-small)/1.2 var(--font-text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; cursor: pointer; }
.lzeile__zurueck:hover { text-decoration-color: currentColor; }

/* Hinweis unter der Liste (Fassadenstuck: empfohlene Angaben für eine Anfrage) */
.liste__anfrage { display: grid; gap: var(--s-3); justify-items: start; margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.liste__anfrage > h2 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.liste__anfrage > p { max-width: 60ch; }

/* PC: zwei Spalten */
@media (min-width: 1024px) {
  .liste { display: grid; grid-template-columns: 272px minmax(0, 1fr); column-gap: var(--s-7); align-items: start; }
  .katleiste, dialog.blatt { display: none; }
  .liste__spalte { position: sticky; top: var(--spalte-oben); align-self: start; display: flex; flex-direction: column; gap: var(--s-5); max-height: calc(100vh - var(--spalte-oben) - var(--s-5)); max-height: calc(100dvh - var(--spalte-oben) - var(--s-5)); }
  .katwahl { flex: 0 1 auto; }
  .katliste { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; min-height: 132px; }
  .liste__suche { flex: none; }
}

/* Handy und Tablet: Leiste mit Knopf, Suche und Sortierung am Listenanfang */
@media (max-width: 1023px) {
  .liste__spalte > .katwahl { display: none; }
  .liste__suche { margin-top: var(--s-4); }
  .katleiste { position: sticky; top: var(--nav); z-index: 5; padding-block: var(--s-2); background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax -1px); border-bottom: 1px solid var(--line); }
  .katleiste__knopf { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%; min-height: 48px; padding: var(--s-2) var(--s-4); border: 1px solid color-mix(in oklab, var(--ink) 55%, transparent); border-radius: var(--r-btn); background: var(--bg); color: var(--ink); font: 500 17px/1.25 var(--font-text); text-align: left; cursor: pointer; }
  .katleiste__knopf > svg { flex: none; }
  .katleiste__knopf:focus-visible { outline-offset: -3px; }
  .lzeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-top: var(--s-4); padding-bottom: var(--s-2); margin-bottom: var(--s-5); }
  .lzeile__sort { grid-column: 1 / -1; grid-row: 1; display: grid; gap: var(--s-2); }
  .lzeile__sort select { width: 100%; height: var(--btn-h); font-size: var(--t-body); }
  .lzeile__treffer { display: flex; align-items: center; min-height: 44px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .liste__suche { max-width: 420px; }
  .lzeile { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .lzeile__sort { grid-column: auto; grid-row: auto; display: flex; align-items: center; }
  .lzeile__sort select { width: auto; }
  .lzeile__treffer { grid-column: 1; grid-row: 1; }
}

/* Blatt „Kategorie wählen": <dialog> im obersten Stapel, also über Kopfzeile und unterer Handy-Leiste */
dialog.blatt { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 640px; max-height: 86vh; max-height: 86dvh; margin: 0 auto; padding: 0; border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg); color: var(--ink); overflow: hidden; }
dialog.blatt:not([open]) { display: none; }
dialog.blatt::backdrop { background: color-mix(in oklab, var(--p-ink) 55%, transparent); }
.blatt__innen { display: flex; flex-direction: column; max-height: 86vh; max-height: 86dvh; padding: var(--s-4) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom)); }
.blatt__kopf { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 0 0 var(--s-3) var(--s-3); }
.blatt__kopf > h2 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.blatt__zu { min-height: 48px; padding: 0 var(--s-4); border: 1px solid color-mix(in oklab, var(--ink) 55%, transparent); border-radius: var(--r-btn); background: var(--bg); color: var(--ink); font: 500 17px/1.2 var(--font-text); cursor: pointer; }
.blatt .katwahl__auswahl { padding-left: var(--s-3); }
.blatt .katliste { overflow-y: auto; overscroll-behavior: contain; }
.blatt .katliste__zeile { min-height: 52px; font-size: var(--t-body); }
html.blatt-offen { overflow: hidden; }

/* 4. Produktraster und Produktkarte (die ganze Karte ist der Link) */
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-7) var(--gutter); }
@media (max-width: 1023px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-4); } }
/* neben der Kategorie-Spalte: 3 Karten je Reihe, ab 1500 px 4 */
@media (min-width: 1024px) and (max-width: 1499px) { .liste .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 4a. Variantenwahl in der Produktansicht (Fassadenstuck: Breite) */
.produkt__variante { display: grid; gap: var(--s-2); justify-items: start; }
.produkt__variante .field { min-width: 200px; }

/* 4b. Übersicht: große Einstiege (Fassadenstuck nach Kategorie) und Textkarten (Baustoffe, Werkzeuge) */
.kat-gross .tile { --tile-ratio: 3 / 2; }
.kat-gross .tile__media > img { mix-blend-mode: multiply; }
.card__kat { font-size: var(--t-label); color: var(--muted); }
.card > .card__bsp { font-size: var(--t-small); margin-top: var(--s-2); }
.pcard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); align-content: start; height: 100%; color: inherit; text-decoration: none; border-radius: var(--r-lg); }
.pcard:focus-visible { outline-offset: 4px; }
/* Bild liegt absolut im Quadrat: hochformatige Bilder dehnen die Karte sonst über ihre Spalte hinaus */
.pcard__media { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: clip; margin-bottom: var(--s-3); border-radius: var(--r-lg); background: var(--p-surface); }
.pcard__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: var(--s-5); mix-blend-mode: multiply; }
.pcard h3 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.pcard__kat { font-size: var(--t-small); color: var(--muted); }
.pcard__masse { font-size: var(--t-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__preis { margin-top: var(--s-2); font-variant-numeric: tabular-nums; }
@media (max-width: 639px) { .pcard__media > img { padding: var(--s-3); } }
@media (hover: hover) and (pointer: fine) {
  html:not([data-motion="off"]) a.pcard { transition: transform var(--dur) var(--ease); }
  html:not([data-motion="off"]) a.pcard:hover { transform: translateY(var(--m-lift, -2px)); }
}
@media (prefers-reduced-motion: reduce) { html a.pcard, html a.pcard:hover { transition: none; transform: none; } }

/* Preisangabe: Bruttopreis groß, Zusatz „inkl. MwSt. / Stück" darunter */
.preis__jetzt { font-weight: 500; font-size: var(--t-card); }
.preis__alt { color: var(--muted); font-size: var(--t-small); margin-left: var(--s-2); }
.preis__zusatz { display: block; font-size: var(--t-label); color: var(--muted); }

/* fehlendes Bild: ruhige Fläche mit der Produktnummer */
.bild-fehlt { display: grid; place-items: center; width: 100%; height: 100%; padding: var(--s-4); text-align: center; font-size: var(--t-small); font-weight: 500; color: var(--muted); }

/* unter dem Raster: Stand und „Weitere anzeigen" */
.mehr { display: grid; justify-items: center; gap: var(--s-4); margin-top: var(--s-8); }
.mehr__stand { color: var(--muted); font-variant-numeric: tabular-nums; }
.leer { display: grid; gap: var(--s-5); justify-items: start; padding-block: var(--s-7); }

/* 5. Produktansicht: Angaben links, Bild rechts; am Handy Kopf, Bild, Angaben */
.produkt { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "kopf bild" "angaben bild"; grid-template-rows: auto 1fr; column-gap: var(--s-8); row-gap: var(--s-6); align-items: start; }
.produkt__kopf { grid-area: kopf; display: grid; gap: var(--s-2); }
.produkt__kat { font-size: var(--t-lead); color: var(--muted); }
.produkt__bild { grid-area: bild; position: sticky; top: calc(var(--nav) + var(--s-5)); width: 100%; aspect-ratio: 1 / 1; max-height: calc(100svh - var(--nav) - var(--s-7)); display: grid; place-items: center; overflow: clip; border-radius: var(--r-lg); background: var(--p-surface); }
.produkt__bild > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: var(--s-7); mix-blend-mode: multiply; }
.produkt__angaben { grid-area: angaben; display: grid; gap: var(--s-6); }
.produkt__preis { font-variant-numeric: tabular-nums; }
.produkt__preis .preis__zusatz + .preis__zusatz { margin-top: var(--s-1); }
.produkt__preis .preis__jetzt { font-size: var(--t-h3); }
.produkt__preis .preis__alt { font-size: var(--t-body); }
.produkt__preis .preis__zusatz { font-size: var(--t-small); }
.produkt__kauf { display: grid; gap: var(--s-4); justify-items: start; }
.produkt__kauf-zeile { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-4); }
.produkt__menge { display: grid; gap: var(--s-2); font-size: var(--t-small); font-weight: 500; }
.produkt__status { font-weight: 500; }
.produkt__status a { text-decoration: underline; text-underline-offset: 4px; }
.produkt__block { display: grid; gap: var(--s-3); }
.produkt__block > h2 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.produkt__block > p { max-width: 60ch; }
.masse { width: 100%; border-collapse: collapse; }
.masse tr { border-bottom: 1px solid var(--line); }
.masse th { width: 45%; padding: var(--s-3) var(--s-4) var(--s-3) 0; text-align: left; font-weight: 400; color: var(--muted); }
.masse td { padding: var(--s-3) 0; font-variant-numeric: tabular-nums; }
.epochen { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin: 0; padding: 0; list-style: none; }
.weitere-produkte { margin-top: var(--s-9); padding-top: var(--s-7); border-top: 1px solid var(--line); }
.weitere-produkte > h2 { font-size: var(--t-h3); line-height: 1.2; margin-bottom: var(--s-6); }
@media (max-width: 899px) {
  .produkt { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kopf" "bild" "angaben"; grid-template-rows: none; row-gap: var(--s-5); }
  .produkt__bild { position: relative; top: auto; max-height: none; aspect-ratio: 4 / 3; }
  .produkt__bild > img { padding: var(--s-5); }
  .weitere-produkte { margin-top: var(--s-8); }
}
@media (max-width: 479px) {
  .produkt__kauf-zeile > .btn { flex: 1 1 auto; }
}

/* Mengenwähler (Produktansicht und Warenkorb) */
.menge { display: inline-grid; grid-template-columns: 48px 64px 48px; height: var(--btn-h); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); }
.menge__knopf { border: 0; background: none; color: var(--ink); font: 400 var(--t-lead)/1 var(--font-text); cursor: pointer; }
.menge__knopf:hover { background: color-mix(in oklab, var(--ink) 8%, var(--bg)); }
.menge__feld { width: 100%; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: none; color: var(--ink); text-align: center; font: 500 var(--t-body)/1 var(--font-text); -moz-appearance: textfield; appearance: textfield; }
.menge__feld::-webkit-outer-spin-button, .menge__feld::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.menge :focus-visible { outline-offset: -3px; }

/* 6. Warenkorb */
.wk { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s-8); align-items: start; }
.wk__liste { list-style: none; margin: 0; padding: 0; }
.wk__pos { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: var(--s-4) var(--s-5); align-items: start; padding-block: var(--s-5); border-bottom: 1px solid var(--line); }
.wk__pos:first-child { padding-top: 0; }
.wk__bild { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: clip; border-radius: var(--r-md); background: var(--p-surface); }
.wk__bild > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: var(--s-2); mix-blend-mode: multiply; }
.wk__bild .bild-fehlt { padding: var(--s-1); font-size: var(--t-label); }
.wk__text { display: grid; gap: var(--s-1); }
.wk__name { font: 500 var(--t-card)/1.3 var(--font-text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; justify-self: start; }
.wk__name:hover { text-decoration-color: currentColor; }
.wk__klein { font-size: var(--t-small); }
.wk__klein .muted { color: var(--muted); }
.wk__rechts { display: grid; gap: var(--s-2); justify-items: end; }
.wk__summe-pos { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk__entfernen { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 500 var(--t-small)/1.2 var(--font-text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; cursor: pointer; }
.wk__entfernen:hover { text-decoration-color: currentColor; }
.wk__summe { position: sticky; top: calc(var(--nav) + var(--s-5)); display: grid; gap: var(--s-5); padding: var(--s-6); border-radius: var(--r-lg); background: var(--p-surface); }
.wk__summe > h2 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.wk__summe dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4); margin: 0; }
.wk__summe dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk__summe .wk__gesamt { padding-top: var(--s-4); border-top: 1px solid var(--line-strong); font-weight: 500; font-size: var(--t-lead); }
.wk__knoepfe { display: grid; gap: var(--s-3); }
.wk__knoepfe .btn { width: 100%; }
@media (max-width: 1023px) {
  .wk { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .wk__summe { position: static; }
}
@media (max-width: 639px) {
  .wk__pos { grid-template-columns: 80px minmax(0, 1fr); }
  .wk__rechts { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: start; }
  .wk__rechts .wk__summe-pos { justify-self: end; }
  .wk__rechts .wk__entfernen { grid-column: 1 / -1; }
  .wk__summe { padding: var(--s-5); }
}

/* Warenkorb: Ablauf nach der Anfrage (Abholung, Lieferung nach Absprache) */
.wk__ablauf { margin-top: var(--s-5, 24px); padding-top: var(--s-4, 16px); border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.wk__ablauf h3 { font-size: var(--t-body); font-weight: 600; margin: 0 0 var(--s-2, 8px); }
.wk__ablauf ol { margin: 0; padding-left: 1.3em; list-style: decimal; display: grid; gap: var(--s-2, 8px); font-size: var(--t-small, 16px); line-height: 1.5; }
