/* ==========================================================================
   docs.rdoc.de — Dokumentbereich

   Die Farben, Schriften und Abstaende kommen aus `tokens.css` der
   Hauptseite. Hier steht nur, was dieser Bereich zusaetzlich braucht.

   ZUERST FUERS HANDY (Anforderung 3.1). Jede Regel hier gilt ab der
   kleinsten Breite; der Desktop wird weiter unten in einem einzigen
   Block ab 48rem abgewandelt. Wer das umdreht, baut die Seite zweimal.

   KEINE KARTENWAND. Die Liste ist eine Liste: eine Zeile je Produkt,
   mit dem Namen als schwerster Stimme und der Artikelnummer als
   ruhiger Nebenzeile. 91 Kacheln nebeneinander waeren eine Tapete,
   durch die niemand etwas findet.
   ========================================================================== */

:root {
  /* Eigene Masse dieses Bereichs. Alles andere ist geerbt. */
  --docs-rand: clamp(16px, 5vw, 32px);
  --docs-breit: 56rem;
  --docs-zeile: 1px solid var(--line);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  /* Der Fuss steht unten, auch wenn die Seite kurz ist. */
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sprite-halter {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: var(--mint-700);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--mint-800);
}

:focus-visible {
  outline: 3px solid var(--mint-700);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Kopf ----------
   Eine ruhige dunkle Leiste. Sie traegt nur zweierlei: das Signet als
   Weg zurueck zur Hauptseite und das Wort, auf welcher Seite man ist. */

.kopf {
  display: flex;
  align-items: center;
  gap: var(--docs-rand);
  padding: 14px var(--docs-rand);
  background: var(--navy-900);
  color: var(--white);
}

.kopf-signet {
  display: block;
  flex: none;
  color: currentColor;
}

.kopf-signet svg {
  display: block;
  width: 92px;
  height: auto;
}

.kopf-wort {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-2);
}

/* ---------- Hut: Ueberschrift, Satz, Suche ---------- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--docs-breit);
  margin: 0 auto;
  padding: clamp(28px, 7vw, 56px) var(--docs-rand) clamp(40px, 9vw, 80px);
}

.hut h1 {
  margin: 0 0 0.35em;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  /* Untergrenze 1.75rem: „Produktdokumente" ist ein einziges Wort und
     passt bei 320 px sonst nicht in die Zeile — gemessen 314 px in
     einer 288 px breiten Spalte. */
  font-size: clamp(1.75rem, 8vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

/* Deutsche Produktnamen werden lang. Lieber getrennt als aus dem
   Bild heraus. */
h1,
h2,
.pk-name {
  hyphens: auto;
  overflow-wrap: break-word;
}

.hut-satz {
  margin: 0 0 clamp(24px, 6vw, 40px);
  max-width: 34em;
  font-size: clamp(1.0625rem, 3.6vw, 1.25rem);
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Suche ----------
   Das groesste Bedienelement der Seite. Wer per QR-Code kommt, hat
   eine Nummer im Kopf und soll sie ohne Suchen nach dem Feld eintippen
   koennen. */

.suche {
  margin: 0 0 clamp(18px, 4vw, 26px);
}

.suche-schild {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.suche-feld {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-tile);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.suche-feld::placeholder {
  color: var(--dim);
}

.suche-feld:hover {
  border-color: var(--mint-700);
}

.suche-feld:focus {
  outline: none;
  border-color: var(--mint-700);
  box-shadow: 0 0 0 4px var(--mint-wash);
}

.suche-hilfe {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- Filterreihe ---------- */

.filterreihe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(28px, 7vw, 44px);
}

.filter {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.filter:hover {
  border-color: var(--mint-700);
  color: var(--ink);
}

.filter[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* ---------- Produktliste ---------- */

.bestand-titel {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.produktliste {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--docs-zeile);
}

.pk {
  border-bottom: var(--docs-zeile);
}

.pk[hidden] {
  display: none;
}

.pk-ziel {
  display: grid;
  gap: 2px;
  padding: 16px 0;
  color: inherit;
  text-decoration: none;
  /* Der Pfeil liegt rechts und wandert beim Zeigen ein Stueck mit. */
  position: relative;
  padding-right: 36px;
  transition: padding-left var(--dur-fast) var(--ease);
}

.pk-ziel::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--mint-600);
  border-bottom: 2px solid var(--mint-600);
  transform: translate(0, -50%) rotate(-45deg);
  transition: transform var(--dur-fast) var(--ease);
}

.pk-ziel:hover {
  padding-left: 8px;
}

.pk-ziel:hover::after {
  transform: translate(4px, -50%) rotate(-45deg);
}

.pk-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.pk-name {
  font-size: 1.0625rem;
  font-weight: 500;
}

.pk-welt {
  font-size: 0.8125rem;
  color: var(--dim);
}

.pk-nummer,
.nr,
.schuh-nummer {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.pk-nummer {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.pk-anzahl {
  font-size: 0.8125rem;
  color: var(--dim);
}

.leermeldung {
  margin: 28px 0 0;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-tile);
  font-size: 1.0625rem;
  text-align: center;
}

.leermeldung[hidden] {
  display: none;
}

/* ---------- Produktseite ---------- */

.zurueck {
  margin: 0 0 20px;
  font-size: 0.9375rem;
}

.ps-welt {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.produktseite h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: clamp(1.75rem, 6.5vw, 2.75rem);
  line-height: 1.1;
}

.ps-nummern {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 clamp(28px, 7vw, 44px);
  padding: 0;
  list-style: none;
}

.ps-nummern .nr {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--mint-wash);
  color: var(--mint-800);
  font-size: 0.9375rem;
}

.ps-titel,
.schuh h2 {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.schuh h2 {
  font-size: 1.25rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

/* ---------- Ein Dokument ---------- */

.dokliste {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.dok {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint-600);
  border-radius: var(--radius-tile);
  background: var(--white);
}

.dok-leer {
  border-left-color: var(--line-strong);
}

.dok-angaben {
  margin: 0 0 14px;
}

.dok-art {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 500;
}

.dok-wert {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.dok-marke {
  display: inline-block;
  min-width: 4.5em;
  color: var(--dim);
}

.dok-knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.knopf-voll {
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
}

.knopf-voll:hover {
  background: var(--mint-800);
  border-color: var(--mint-800);
  color: var(--white);
}

.knopf-leer {
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.knopf-leer:hover {
  border-color: var(--mint-700);
  color: var(--ink);
}

/* ---------- Schuhseite ---------- */

.schuhe {
  display: grid;
  gap: clamp(28px, 7vw, 44px);
}

.schuh-nummer {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- Fuss ---------- */

.fuss {
  flex: none;
  padding: 28px var(--docs-rand);
  background: var(--navy-900);
  color: var(--on-dark-2);
  font-size: 0.875rem;
}

.fuss-haus {
  margin: 0 0 12px;
}

.fuss-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fuss-liste a {
  color: var(--on-dark);
  text-decoration: none;
  /* Tippflaeche auf dem Handy. */
  display: inline-block;
  padding: 6px 0;
}

.fuss-liste a:hover {
  color: var(--mint-bright);
  text-decoration: underline;
}

/* ==========================================================================
   Unter 1000 px: nichts unter 16 px, nichts unter 44 px

   Hausregel des Projekts (CLAUDE.md): „Tippflaechen unter 1000 px
   mindestens 44 px hoch, Lesetext mindestens 16 px." Hier steht sie
   in einem Block statt verstreut in jeder Regel — so laesst sie sich
   nachmessen, ohne die ganze Datei zu lesen.

   Der Kunde sagt dasselbe in seinen eigenen Worten (Abnahme, Punkt 4):
   „gut lesbar, Suche und Download ohne Zoomen".
   ========================================================================== */

@media (max-width: 999px) {
  .kopf-wort,
  .suche-schild,
  .suche-hilfe,
  .filter,
  .bestand-titel,
  .pk-name,
  .pk-welt,
  .pk-nummer,
  .pk-anzahl,
  .ps-welt,
  .ps-titel,
  .ps-nummern .nr,
  .zurueck,
  .dok-wert,
  .schuh-nummer,
  .fuss,
  .fuss-liste a {
    font-size: 1rem;
  }

  /* Alles, was angetippt wird, ist mindestens eine Fingerkuppe hoch. */
  .zurueck a,
  .fuss-liste a,
  .leermeldung a {
    display: inline-block;
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .zurueck {
    margin-bottom: 8px;
  }
}

/* ==========================================================================
   Ab 48rem: zwei Spalten im Dokument, groessere Luft, Fuss in einer Zeile
   ========================================================================== */

@media (min-width: 48rem) {
  .kopf {
    padding: 18px clamp(24px, 4vw, 48px);
  }

  .kopf-signet svg {
    width: 118px;
  }

  .dok {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 22px 24px;
  }

  .dok-angaben {
    margin: 0;
  }

  .dok-knoepfe {
    justify-content: flex-end;
  }

  .fuss {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px clamp(24px, 4vw, 48px);
  }

  .fuss-haus {
    margin: 0;
  }
}

/* Wer Bewegung abgeschaltet hat, bekommt keine. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
