/*
 * Schaubild „Nachbestellen“ (bau/schau/nachbestellen.js, js/schau-nachbestellen.js)
 * Links Gerät und Mittel, rechts der Lieferschein mit Regal: Was bestellt ist, wird blau.
 */

/* Ohne JavaScript: nur der Satz mit Telefon und E-Mail */
.bestell__ohne { display: none; max-width: 44em; font-size: var(--t-gross); line-height: 1.45; }
html:not(.js) .bestell__ohne { display: block; }
html:not(.js) .bestell,
html:not(.js) .bestell__nurjs { display: none; }

.bestell {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 3.6vw, 64px);
  align-items: start;
}
.bestell [hidden] { display: none !important; }
.bestell fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.bestell legend { padding: 0; }

/* Wie letztes Mal */
.bestell__merk {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 12px 18px;
  border-left: 3px solid var(--blau);
  background: var(--eis100);
}
.bestell__merk p { max-width: 46em; line-height: 1.45; }
.bestell__merk-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.bestell__loeschen,
.bestell__kopie button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

/* Fragen mit Nummer wie auf einem Plan */
.bestell__frage {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.875rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.bestell__nr {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border: 1.5px solid var(--blau);
  border-radius: 50%;
  color: var(--blau);
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
  transform: translateY(-0.1em);
}

/* 1 · Gerät: Kacheln mit den Gerätezeichnungen */
.bestell__kacheln { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.bestell__kachel {
  position: relative;
  display: block;
  padding: 6px 6px 10px;
  border: 1.5px solid var(--linie);
  background: var(--weiss);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.bestell__kachel input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bestell__kachel img { width: 100%; height: auto; }
.bestell__kname { display: block; margin-top: 2px; font-size: var(--t-klein); line-height: 1.25; hyphens: manual; }
.bestell__kachel:hover { border-color: var(--blau); }
.bestell__kachel:has(input:checked) { border-color: var(--blau); background: var(--eis100); box-shadow: inset 0 0 0 1.5px var(--blau); }
.bestell__kachel:has(input:checked) .bestell__kname { color: var(--blau); font-weight: 500; }
.bestell__kachel:has(input:focus-visible) { outline: 3px solid var(--fokus); outline-offset: 3px; }
.bestell__zahl {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blau);
  color: var(--weiss);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

/* 2 · Mittel und Menge */
.bestell .bestell__gruppe { margin-top: clamp(30px, 3.4vw, 44px); }
.bestell__posten-liste { border-top: 1px solid var(--rahmen); }
.bestell__posten {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid var(--linie);
  box-shadow: inset 2px 0 0 var(--stahl300);
  transition: box-shadow 0.3s;
}
.bestell__posten[data-an] { box-shadow: inset 3px 0 0 var(--blau); }
.bestell__pille { position: relative; display: inline-block; }
.bestell__pille input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bestell__pille span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--stahl300);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.16s, background-color 0.16s, color 0.16s;
}
.bestell__pille span:hover { border-color: var(--blau); }
.bestell__pille input:checked + span { border-color: var(--blau); background: var(--blau); color: var(--weiss); }
.bestell__pille input:focus-visible + span { outline: 3px solid var(--fokus); outline-offset: 3px; }
.bestell__zusatz { color: var(--tinte-leise); font-size: var(--t-klein); line-height: 1.3; }

/* Menge: minus, Zahl, plus */
.bestell__menge { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.bestell__menge button {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--blau);
  border-radius: 50%;
  background: var(--weiss);
  color: var(--blau);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s, color 0.16s, border-color 0.16s;
}
.bestell__menge button:hover:not(:disabled) { background: var(--blau); color: var(--weiss); }
.bestell__menge button:disabled { border-color: var(--stahl300); color: var(--stahl400); cursor: default; }
.bestell__menge input {
  width: 2.6em;
  height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1.5px solid var(--stahl300);
  border-radius: 0;
  background: none;
  color: var(--tinte-leise);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.bestell__menge input::-webkit-inner-spin-button,
.bestell__menge input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bestell__posten[data-an] .bestell__menge input { border-bottom-color: var(--blau); color: var(--blau); }
.bestell__menge input:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
.bestell__einheit { width: 4.6em; color: var(--tinte-leise); font-size: var(--t-klein); }

.bestell__tipp { max-width: 40em; margin-top: 14px; color: var(--tinte-leise); font-size: var(--t-klein); line-height: 1.5; }
.bestell__etikett { max-width: 30em; margin-top: 14px; }
.bestell__etikett input { height: 48px; }

/* Desinfektion: getrennt von den Reinigern, mit Pflichthinweis */
.bestell__desinfektion { margin-top: clamp(26px, 3vw, 40px); padding-top: 16px; border-top: 1px dashed var(--stahl400); }
.bestell__desinfektion p { max-width: 40em; font-size: var(--t-klein); line-height: 1.5; }
.bestell__pflicht {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--rahmen);
  font-weight: 500;
}

/* Der Zettel: ein Lieferschein mit Schriftfeld */
.bestell__zettel { border: 1px solid var(--rahmen); background: var(--weiss); }
.bestell__kopf {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--rahmen);
}
.bestell__titel { font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem); letter-spacing: -0.01em; line-height: 1.1; }
.bestell__daten { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 0.8125rem; }
.bestell__daten div { display: flex; gap: 6px; }
.bestell__daten dt { color: var(--tinte-leise); }
.bestell__daten dd { font-variant-numeric: tabular-nums; }
.bestell__stempel {
  margin-top: 4px;
  padding: 2px 10px 3px;
  border: 1.5px solid var(--blau);
  color: var(--blau);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Das Regal: grau, was offen ist; blau, was auf dem Zettel steht */
.bestell__bild { position: relative; padding: 6px 10px 0; border-bottom: 1px solid var(--linie); }
.bestell__bild { display: grid; justify-items: center; }
.bestell__bild > svg { display: block; width: 100%; max-width: 440px; height: auto; }
.bestell__bild > .schau__schilder { left: 50%; right: auto; width: min(100%, 440px); transform: translateX(-50%); }
/* Das Blau füllt sein Ding von unten wie ein Füllstand */
.bestell__blau {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.45s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.bestell__blau[data-an] { clip-path: inset(-10% -10% -10% -10%); }
.bestell__fach { opacity: 0; transition: opacity 0.25s; }
.bestell__fach[data-an] { opacity: 1; }
.schau--nachbestellen .bestell__stueck { padding: 1px 7px 2px; border: 1.5px solid var(--weiss); font-variant-numeric: tabular-nums; transform: translate(-50%, -50%); }
.schau--nachbestellen .bestell__fachname {
  padding: 1px 8px 2px;
  font-size: 0.6875rem;
  opacity: 0;
  transition: opacity 0.25s;
}
.schau--nachbestellen .bestell__fachname--unten { transform: translate(-50%, 3px); }
.schau--nachbestellen .bestell__fachname[data-an] { opacity: 1; }

/* Positionen */
.bestell__liste { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--t-klein); }
.bestell__liste th {
  padding: 8px 6px 6px;
  border-bottom: 1px solid var(--linie);
  color: var(--tinte-leise);
  font-size: 0.75rem;
  font-weight: 400;
  text-align: left;
}
.bestell__liste th:first-child,
.bestell__liste td:first-child { width: 3.2rem; padding-left: 18px; font-variant-numeric: tabular-nums; }
.bestell__liste th:nth-child(2),
.bestell__liste td:nth-child(2) { width: 6.6rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bestell__liste th:last-child,
.bestell__liste td:last-child { width: 52px; padding-right: 8px; }
.bestell__liste td { padding: 6px; border-bottom: 1px solid var(--linie); vertical-align: middle; line-height: 1.3; }
.bestell__liste tbody tr:not(.bestell__leer) td:first-child { box-shadow: inset 3px 0 0 var(--blau); color: var(--blau); }
.bestell__liste td strong { display: block; font-weight: 500; overflow-wrap: anywhere; hyphens: auto; }
.bestell__liste td span { display: block; color: var(--tinte-leise); font-size: 0.8125rem; }
.bestell__leer td { height: 48px; border-bottom-style: dashed; border-bottom-color: var(--stahl300); color: var(--stahl400); }
.bestell__leer td:first-child { box-shadow: inset 2px 0 0 var(--stahl300); }
.bestell__weg {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--tinte-leise);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}
.bestell__weg:hover { background: var(--stahl100); color: var(--blau); }

/* Schriftfeld: Betrieb, Ort, Telefon, Kundennummer, Hinweise */
.bestell__schrift {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 18px;
  border-top: 1px solid var(--rahmen);
}
.bestell__feld {
  display: block;
  padding: 7px 12px 4px 18px;
  border-bottom: 1px solid var(--linie);
  box-shadow: inset 2px 0 0 var(--stahl300);
  cursor: text;
  transition: box-shadow 0.3s;
}
.bestell__feld:nth-child(even):not(.bestell__feld--breit) { border-left: 1px solid var(--linie); }
.bestell__feld--breit { grid-column: 1 / -1; }
.bestell__feld > span { display: block; color: var(--tinte-leise); font-size: 0.75rem; line-height: 1.3; }
.bestell__feld input,
.bestell__feld textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px dashed var(--stahl300);
  border-radius: 0;
  background: none;
  color: var(--tinte);
  font: inherit;
  font-size: 1.0625rem;
}
.bestell__feld textarea { resize: vertical; line-height: 1.4; }
.bestell__feld input:focus,
.bestell__feld textarea:focus { outline: none; }
.bestell__feld:focus-within { box-shadow: inset 0 0 0 2px var(--blau); }
.bestell__feld[data-da] { box-shadow: inset 3px 0 0 var(--blau); }
.bestell__feld[data-da]:focus-within { box-shadow: inset 3px 0 0 var(--blau), inset 0 0 0 2px var(--blau); }
.bestell__feld[data-da] > span { color: var(--blau); }
.bestell__feld:has([aria-invalid='true']) { box-shadow: inset 0 -3px 0 var(--nacht), inset 2px 0 0 var(--nacht); }

.bestell__fuss { display: grid; gap: 12px; padding: 14px 18px 18px; }
.bestell__haken { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.bestell__haken input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--blau); }
.bestell__meldung { font-weight: 500; }
.bestell__senden { width: 100%; white-space: normal; text-align: center; line-height: 1.2; }
.bestell__anruf { text-align: center; }
.bestell__anruf a { display: inline-flex; align-items: center; min-height: 44px; }
.bestell__status {
  padding: 10px 14px;
  border-left: 3px solid var(--stahl300);
  background: var(--stahl50);
  font-size: var(--t-klein);
  line-height: 1.45;
}
.schau--nachbestellen[data-geoeffnet] .bestell__status { border-left-color: var(--blau); background: var(--eis100); }
.bestell__kopie { color: var(--tinte-leise); font-size: var(--t-klein); }
.bestell__kopie button { min-height: 0; padding: 0 0 2px; font-size: inherit; }

/* Handy: erst Gerät, dann das Regal, dann Mittel, dann der Rest des Zettels */
@media (max-width: 899px) {
  .bestell { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .bestell__wahl,
  .bestell__zettel { display: contents; }
  .bestell__merk { order: 0; margin-bottom: 22px; }
  .bestell__geraete { order: 1; }
  .bestell__kopf,
  .bestell__bild { order: 2; border-inline: 1px solid var(--rahmen); background: var(--weiss); }
  .bestell__kopf { margin-top: 22px; border-top: 1px solid var(--rahmen); }
  .bestell__bild { border-bottom: 1px solid var(--rahmen); }
  .bestell__gruppe { order: 3; }
  .bestell__liste { order: 5; margin-top: 26px; border: 1px solid var(--rahmen); border-bottom: 0; }
  .bestell__schrift { order: 6; margin-top: 0; border-inline: 1px solid var(--rahmen); }
  .bestell__fuss { order: 7; border: 1px solid var(--rahmen); border-top: 0; }
  .bestell__desinfektion { order: 4; }
  .bestell > script { order: 9; }
  .bestell__kacheln { gap: 8px; }
  .bestell__kachel { padding: 4px 4px 8px; }
  .bestell__kname { font-size: 0.8125rem; }
  .bestell__bild { padding-inline: 4px; }
}
@media (max-width: 599px) {
  .bestell__kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bestell__schrift { grid-template-columns: minmax(0, 1fr); }
  .bestell__feld:nth-child(even):not(.bestell__feld--breit) { border-left: 0; }
  /* Jede Zeile gleich: Pille links, Menge rechts, die Einheit klein unter der Zahl */
  .bestell__posten { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding-left: 10px; }
  .bestell__pille span { padding: 8px 16px; line-height: 1.2; }
  .bestell__zusatz { grid-row: 2; grid-column: 1 / -1; }
  .bestell__menge { display: grid; grid-template-columns: 44px 2.4em 44px; gap: 0 4px; align-items: center; margin-left: 0; }
  .bestell__menge input { height: 36px; }
  .bestell__einheit { grid-row: 2; grid-column: 2; width: auto; font-size: 0.6875rem; line-height: 1.2; text-align: center; }
  .bestell__senden { padding-inline: 1rem; font-size: 1.0625rem; }
  .bestell__liste th:first-child,
  .bestell__liste td:first-child { width: 2.4rem; padding-left: 12px; }
  .bestell__liste th:nth-child(2),
  .bestell__liste td:nth-child(2) { width: 6.2rem; }
  .schau--nachbestellen .bestell__fachname { font-size: 0.625rem; padding: 0 5px 1px; }
  .schau--nachbestellen .bestell__stueck { font-size: 0.625rem; padding: 0 5px 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .bestell__blau,
  .bestell__fach,
  .bestell__posten,
  .bestell__feld,
  .schau--nachbestellen .bestell__fachname { transition: none; }
}

@media print {
  .bestell { display: block; }
  .bestell__wahl,
  .bestell__merk,
  .bestell__fuss .knopf,
  .bestell__anruf,
  .bestell__kopie,
  .bestell__weg { display: none !important; }
}

/* Durchsicht 25.11.: Flächen statt Striche, wie im übrigen Auftritt */
.bestell__kachel { border-color: transparent; border-radius: var(--rund-klein); background: var(--stahl50); }
.bestell__kachel:has(input:checked) { border-color: var(--blau); box-shadow: none; }
.bestell__pflicht,
.bestell__status { border: 0; border-radius: var(--rund); background: var(--eis100); }
.bestell__leer td { color: var(--stahl600); }
.bestell__fachname,
.bestell__einheit { font-size: 0.75rem; }
