/* create.textil.team – Konfigurator, Design-Variante 1 „Werkbank“
   Vorgabe: Claude-Doc „Konfigurator – Design-Vorgabe“ und vorlagen/design/variante-1-werkbank.pdf.
   Ab 900 px: Kopfzeile, Bühne links, Seitenleiste 340 px rechts. Darunter: Seitenleiste unter der Bühne,
   Mindestmenge/Preis/Weiter als feste Leiste unten.
   Regeln: kein waagerechtes Scrollen, Tippflächen ≥ 44 px, Eingaben 16 px (kein iOS-Zoom),
   sichtbarer Fokus, sichere Ränder (viewport-fit=cover), reduzierte Bewegung. */

/* Hausschrift Asap, selbst gehostet (SIL Open Font License, assets/schrift/OFL.txt).
   Variable Schrift: eine Datei je Zeichensatz für alle Stärken 400–700. Quelle: Google Fonts, Asap v34. */
@font-face {
  font-family: "Asap"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../schrift/asap-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Asap"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../schrift/asap-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Farben der Oberfläche: Designer-Paletten Lilac und Lilac-Gray */
  /* Lilac – nur Logo (das Logo ist eine eigene Datei, assets/marke/tt-create.svg) */
  --tt-lilac-primary: #B893EB;
  --tt-lilac-dark: #8D70BF;
  --tt-lilac-light: #E9E2F8;
  --tt-lilac-offwhite: #F8F6FC;

  /* Lilac-Gray – Bedienelemente */
  --tt-gray-primary: #C5C2D1;
  --tt-gray-dark: #9491A5;
  --tt-gray-light: #E9E8F0;
  --tt-gray-offwhite: #F8F7FA;

  /* Rollen */
  --tt-primary: var(--tt-gray-dark);          /* Hauptknöpfe, z. B. „Weiter zur Veredelung“ */
  --tt-primary-hover: #7E7A91;                /* Hover/gedrückt */
  --tt-primary-text: #FFFFFF;
  --tt-accent-bg: #D5D2E3;                    /* ausgewählte Optionen und Chips; dunkler als die Seitenleiste */
  --tt-accent-border: var(--tt-gray-dark);    /* Auswahlrahmen; dunkler als gray-primary, damit die Auswahl erkennbar bleibt */
  --tt-surface: var(--tt-gray-light);         /* Seitenleiste (Menü), Ansichten-Umschalter */
  --tt-border: var(--tt-gray-primary);        /* Rahmen, Trennlinien, Eingabefelder */
  --tt-focus: var(--tt-gray-dark);            /* Tastaturfokus, gewähltes Bauteil (liest app.js) */
  --tt-stage: #FAFAFA;                        /* Bühne, neutral – keine Lila-Tönung */
  --tt-stage-dots: #D4D4D4;                   /* Punktraster der Bühne, alle 24 px */
  --tt-text: #1A1A1A;                         /* Haupttext */
  --tt-text-rgb: 26, 26, 26;                  /* Haupttext als RGB für Schatten und halbtransparente Ränder */
  --tt-text-muted: #5E5B6E;                   /* Nebentexte, Beschriftungen */
  --tt-link: #2563EB;                         /* nur Textlinks und Info-Hinweise */
  --tt-page-bg: #FFFFFF;
  --warn: #B3261E;
  /* Linien des Artikels: hell auf dunklen, dunkel auf hellen Stofffarben (liest app.js) */
  --linie-hell: #C9CED3;
  --linie-dunkel: #1D1D1B;

  --tippen: 44px;
  --rund: 6px;
  --leiste: 340px;
  --rand: max(16px, env(safe-area-inset-left));
  --rand-r: max(16px, env(safe-area-inset-right));
  --fuss-hoehe: 0px;       /* setzt app.js auf dem Handy (Höhe der festen Leiste) */
  --zoom: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font: 15px/1.45 "Asap", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tt-text);
  background: var(--tt-page-bg);
  overflow-x: clip;
  padding-bottom: var(--fuss-hoehe);
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tt-focus); outline-offset: 2px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tippen); padding: 0 16px;
  font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center; white-space: nowrap;
  border: 1px solid var(--tt-border); border-radius: var(--rund);
  background: var(--tt-page-bg); color: var(--tt-text); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knopf:hover { border-color: var(--tt-gray-dark); }
.knopf-haupt { font-size: 19px; font-weight: 700; background: var(--tt-primary); border-color: var(--tt-primary); color: var(--tt-primary-text); }
.knopf-haupt:hover { background: var(--tt-primary-hover); border-color: var(--tt-primary-hover); }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.knopf-breit { width: 100%; }
.textknopf {
  min-height: var(--tippen); padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--tt-link); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ Kopfzeile */
.kopf {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "marke aktionen" "ansichten ansichten";
  align-items: center; gap: 10px 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--rand-r) 10px var(--rand);
  background: var(--tt-page-bg);
}
.marke { grid-area: marke; display: inline-flex; align-items: center; min-height: var(--tippen); align-self: center; text-decoration: none; }
/* Logo TEXTIL Team Create (assets/marke/tt-create.svg, Seitenverhältnis 567 : 240); auf dem Handy so hoch wie der Speichern-Knopf */
.marke-logo { display: block; height: var(--tippen); width: auto; }
.kopf-aktionen { grid-area: aktionen; display: flex; gap: 8px; }
.kopf-bestellen { display: none; }
/* Teilen: auf dem Handy nur das Symbol, ab 600 px mit Text (900–1279 px wieder nur Symbol, siehe unten) */
.knopf-teilen { width: var(--tippen); padding: 0; }
.knopf-teilen:hover { background: var(--tt-gray-offwhite); }
.teilen-icon { display: block; flex: none; }
.teilen-text { display: none; }
.text-lang { display: none; }

/* Ansichten-Umschalter: Segmente, auf dem Handy im 3er-Raster */
.ansichten {
  grid-area: ansichten; min-width: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 4px; background: var(--tt-surface); border-radius: 8px;
}
.ansichten button {
  min-width: 0; min-height: var(--tippen); padding: 4px 8px;
  font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--tt-text-muted);
  background: transparent; border: 0; border-radius: var(--rund); cursor: pointer; overflow-wrap: anywhere;
}
.ansichten button[aria-pressed="true"] { background: var(--tt-page-bg); color: var(--tt-text); font-weight: 700; box-shadow: 0 1px 2px rgba(var(--tt-text-rgb), .12); }

/* ------------------------------------------------------------------ Bühne */
.buehne { position: relative; background: var(--tt-stage); }
.buehne-flaeche {
  position: relative; height: min(100vw, 62vh); overflow: hidden;
  background-color: var(--tt-stage);
  background-image: radial-gradient(circle, var(--tt-stage-dots) 1px, transparent 1.5px);
  background-size: 24px 24px; background-position: 12px 12px;
}
.buehne-flaeche.gezoomt { overflow: auto; overscroll-behavior: contain; }
.artikel { width: calc(100% * var(--zoom)); height: calc(100% * var(--zoom)); padding: 12px 12px 64px; }
.artikel svg { display: block; width: 100%; height: 100%; }
.artikel [data-zone] { cursor: pointer; }
.buehne-meldung { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--tt-text-muted); }
.buehne-leiste {
  position: absolute; left: var(--rand); bottom: 12px; right: var(--rand-r);
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.buehne-leiste > * { pointer-events: auto; }
.knopf-zoom { width: var(--tippen); padding: 0; font-size: 20px; font-weight: 500; }
.bearbeitet { min-width: 0; margin-left: 6px; font-size: 14px; color: var(--tt-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ Seitenleiste */
.leiste { background: var(--tt-surface); }
.leiste-inhalt { padding: 4px var(--rand-r) 24px var(--rand); }
.block { padding: 18px 0; }
.block + .block { border-top: 1px solid var(--tt-border); }
.block-artikel { padding-top: 20px; }
.blockkopf { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.blockkopf:focus { outline: none; }
.blockkopf:focus-visible { outline: 2px solid var(--tt-focus); }
.blockkopf-zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.blockkopf-zeile .blockkopf { margin: 0; }
.unterkopf { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.artikel-name { font-size: 22px; font-weight: 700; line-height: 1.2; }
.artikel-text { margin-top: 4px; font-size: 14px; color: var(--tt-text-muted); }
.artikel-wechsel select {
  margin-top: 6px; min-height: var(--tippen); max-width: 100%; padding: 0 28px 0 0;
  font-size: 16px; font-weight: 500; color: var(--tt-link); border: 0; background: transparent; cursor: pointer;
}
.sperre { margin-top: 16px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--tt-border); border-left: 4px solid var(--tt-link); border-radius: var(--rund); background: var(--tt-accent-bg); }
.sperre a { color: var(--tt-link); font-weight: 600; }

/* Auswahl-Chips (Bauteil, Schnitt, Variante) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: var(--tippen); max-width: 100%; padding: 0 14px;
  font-size: 15px; font-weight: 500; line-height: 1.2;
  background: var(--tt-page-bg); color: var(--tt-text); border: 1px solid var(--tt-border); border-radius: var(--rund); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--tt-accent-bg); border-color: var(--tt-accent-border); color: var(--tt-text); font-weight: 600; }
.schalter { display: flex; align-items: center; gap: 10px; min-height: var(--tippen); margin-top: 6px; font-size: 14px; color: var(--tt-text-muted); cursor: pointer; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--tt-primary); }

/* Farbe */
.farbe-aktuell { min-width: 0; font-size: 14px; color: var(--tt-text-muted); text-align: right; }
.farbe-aktuell b { font-weight: 500; color: var(--tt-text); }
.farbfelder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.farbfeld {
  position: relative; aspect-ratio: 1; min-height: var(--tippen); padding: 0;
  border: 1px solid rgba(var(--tt-text-rgb), .14); border-radius: var(--rund); cursor: pointer;
}
.farbfeld[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--tt-page-bg) inset, 0 0 0 2px var(--tt-accent-border); border-color: var(--tt-accent-border); }
.farbfelder-klein { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pantone-knopf { width: 100%; margin-top: 10px; font-weight: 500; font-size: 14px; border-style: dashed; }
.pantone-knopf[aria-expanded="true"] { border-style: solid; border-color: var(--tt-accent-border); }
.pantone { margin-top: 12px; padding: 14px; border: 1px solid var(--tt-border); border-radius: var(--rund); }
.pantone-fertig { width: 100%; margin-top: 14px; }
.hinweis { margin-top: 12px; padding-left: 10px; border-left: 3px solid var(--tt-border); font-size: 14px; color: var(--tt-text-muted); }

/* Eingabefelder */
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.feld:last-child { margin-bottom: 0; }
.feld-name { font-size: 14px; font-weight: 500; color: var(--tt-text); }
.feld-hilfe { font-size: 14px; color: var(--tt-text-muted); }
input[type=search], input[type=text], input[type=email], input[type=number], select.eingabe, .feld select {
  width: 100%; min-height: var(--tippen); padding: 8px 12px;
  font-size: 16px; color: var(--tt-text);
  background: var(--tt-page-bg); border: 1px solid var(--tt-border); border-radius: var(--rund);
}
.treffer-info { font-size: 14px; color: var(--tt-text-muted); }
.treffer-info:empty { display: none; }
.farbliste { list-style: none; margin: 6px 0 0; padding: 0; max-height: 264px; overflow-y: auto; }
.farbliste:empty { display: none; }
.farbzeile {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: var(--tippen); padding: 6px 8px; text-align: left;
  background: var(--tt-page-bg); border: 0; border-radius: var(--rund); cursor: pointer;
}
.farbzeile:hover { background: var(--tt-accent-bg); }
.farbzeile[aria-pressed="true"] { background: var(--tt-accent-bg); box-shadow: inset 3px 0 0 var(--tt-accent-border); }
.farbzeile .probe { width: 32px; height: 32px; border-radius: 4px; border: 1px solid rgba(var(--tt-text-rgb), .14); }
.farbzeile .name { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.farbzeile .nummer { display: block; font-size: 14px; color: var(--tt-text-muted); }
.farbzeile .abstand { font-size: 14px; color: var(--tt-text-muted); text-align: right; }
.umwandler { margin-top: 4px; }
.umwandler-zeile { display: grid; grid-template-columns: var(--tippen) minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.farbprobe { width: var(--tippen); height: var(--tippen); border: 1px solid var(--tt-border); border-radius: var(--rund); background: var(--tt-page-bg); }
.fehlertext { margin-top: 6px; font-size: 14px; color: var(--warn); }
.fehlertext:empty { display: none; }

/* Motiv-Bibliothek (Veredelung): Ablage, Liste, Wandler, häufige Fragen */
.motive { margin-bottom: 18px; }
.motive .unterkopf { margin-top: 0; }
.motive-ablage {
  display: grid; justify-items: center; gap: 6px; padding: 18px 14px; text-align: center; cursor: pointer;
  font-size: 15px; color: var(--tt-text); background: var(--tt-page-bg);
  border: 1.5px dashed var(--tt-gray-dark); border-radius: 8px;
}
.motive-ablage.ziehen { background: var(--tt-gray-offwhite); border-color: var(--tt-text-muted); border-style: solid; }
.motive-ablage .textknopf { min-height: 0; font-size: 15px; }
.motive-symbol { color: var(--tt-text-muted); }
.motive-formate { font-size: 14px; color: var(--tt-text-muted); }
.motive-liste { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.motiv {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px;
  background: var(--tt-page-bg); border: 1px solid var(--tt-border); border-radius: var(--rund);
}
.motiv.laedt { opacity: .7; }
.motiv-bild {
  width: 56px; height: 56px; object-fit: contain; padding: 4px; border-radius: 4px;
  background: var(--tt-stage); border: 1px solid var(--tt-gray-light);
}
.motiv-platzhalter { display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--tt-text-muted); }
.motiv-info { min-width: 0; display: grid; gap: 2px; }
.motiv-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.motiv-status { font-size: 14px; color: var(--tt-text-muted); }
.motiv-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.motiv-flaeche {
  max-width: 100%; min-height: 40px; padding: 6px 10px; font-size: 16px; color: var(--tt-text);
  background: var(--tt-page-bg); border: 1px solid var(--tt-border); border-radius: var(--rund);
}
.motiv.aktiv { border-color: var(--tt-accent-border); box-shadow: inset 0 0 0 1px var(--tt-accent-border); }
/* Zuordnung je Motiv: Ansicht → Position, Art, Breite (cm), Notiz */
.motiv-felder { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.motiv-feld { display: grid; gap: 4px; min-width: 0; }
.motiv-feld-breit { grid-column: 1 / -1; }
.motiv-feld-name { font-size: 13px; font-weight: 500; color: var(--tt-text-muted); }
.motiv-feld select.eingabe, .motiv-feld input { min-height: 40px; padding: 6px 10px; text-overflow: ellipsis; }
.motiv-feld select:disabled, .motiv-feld input:disabled { color: var(--tt-text-muted); background: var(--tt-gray-offwhite); }
.motive-leer { font-size: 14px; color: var(--tt-text-muted); padding: 4px 0; }
.motive-tipp { margin-top: 8px; font-size: 14px; color: var(--tt-text-muted); }
.motiv[draggable="true"] { cursor: grab; }
/* Motive auf der Bühne (im Artikel-SVG, Ebene #tt-motive) */
.tt-platz { cursor: move; touch-action: none; outline: none; }
.tt-platz:not(.gewaehlt):hover .tt-platz-flaeche, .tt-platz:not(.gewaehlt):focus-visible .tt-platz-flaeche { stroke: var(--tt-focus); stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.tt-griff { touch-action: none; }
.tt-griff[data-griff="skalieren"] { cursor: nwse-resize; }
.tt-griff[data-griff="drehen"] { cursor: grab; }
.tt-griff[data-griff="loeschen"] { cursor: pointer; }
.motive-faq { margin-top: 2px; }
.wandler-buehne {
  display: grid; place-items: center; height: 220px; margin: 12px 0;
  background-color: var(--tt-stage); background-image: radial-gradient(circle, var(--tt-stage-dots) 1px, transparent 1.5px);
  background-size: 16px 16px; border-radius: var(--rund);
}
.wandler-bild { max-width: 90%; max-height: 200px; }
.wandler-feld { margin-top: 12px; }
.wandler-detail { width: 100%; min-height: var(--tippen); accent-color: var(--tt-primary); }
.faq { padding: 10px 0; border-top: 1px solid var(--tt-border); }
.faq:first-child { border-top: 0; padding-top: 0; }
.faq summary { min-height: 32px; font-weight: 600; cursor: pointer; }
.faq p { margin-top: 6px; color: var(--tt-text-muted); }

/* Projekt und Produktionsdaten (Veredelung, Stufe 3) */
.projekt-form { margin-top: 12px; }
.projekt-form .knopf { margin-top: 4px; }
.projekt-kopf { font-size: 15px; overflow-wrap: anywhere; }
.prod-flaeche { margin-top: 10px; background: var(--tt-page-bg); border: 1px solid var(--tt-border); border-radius: var(--rund); }
.prod-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; min-height: 48px; }
.prod-name { font-size: 15px; font-weight: 600; }
.prod-dateien { padding: 0 14px 4px; }
.prod-datei { min-width: 0; overflow-wrap: anywhere; }
.prod-datei small { color: var(--tt-text-muted); font-size: 14px; }
.eintrag.laedt { opacity: .7; }
.prod-weitere { margin-top: 10px; }
.prod-fertig { align-items: flex-start; margin-top: 16px; padding: 12px 14px; background: var(--tt-page-bg); border: 1px solid var(--tt-border); border-radius: var(--rund); color: var(--tt-text); }
.prod-fertig input { margin-top: 2px; }
.prod-fertig span { display: grid; gap: 2px; }
.prod-fertig b { font-weight: 600; }
.prod-fertig small { font-size: 14px; color: var(--tt-text-muted); }

/* Veredelung und Ausstattung */
.zeilen { display: flex; flex-direction: column; gap: 6px; }
.zeile { border: 1px solid var(--tt-border); border-radius: var(--rund); }
.zeile-knopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; padding: 6px 14px; text-align: left;
  font-size: 15px; background: none; border: 0; border-radius: var(--rund); cursor: pointer;
}
.zeile-knopf .zeichen { flex: none; width: 20px; text-align: center; font-size: 18px; color: var(--tt-text); }
.zeile-knopf small { display: block; font-size: 14px; color: var(--tt-text-muted); }
.zeile-knopf[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--tt-accent-border); }
.zeile-form { padding: 4px 14px 14px; }
.zeile-form .chips { margin-bottom: 12px; }
.zeile-form .knoepfe { display: flex; gap: 8px; }
.zeile-form .knoepfe .knopf { flex: 1; }
.eintraege { list-style: none; margin: 0; padding: 0 14px 6px; }
.eintrag { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tippen); font-size: 14px; border-top: 1px solid var(--tt-border); }
.eintrag-entfernen { flex: none; width: var(--tippen); height: var(--tippen); font-size: 20px; line-height: 1; background: none; border: 0; border-radius: var(--rund); cursor: pointer; color: var(--tt-text-muted); }
.eintrag-entfernen:hover { color: var(--warn); }
.zeilen-hinweis { margin-top: 8px; font-size: 14px; color: var(--tt-text-muted); }
.option { display: flex; align-items: center; gap: 12px; min-height: var(--tippen); cursor: pointer; }
.option-anzahl { display: flex; align-items: center; gap: 10px; margin: 0 0 6px 32px; font-size: 14px; color: var(--tt-text-muted); }
.option-anzahl select { width: auto; min-width: 80px; }

/* Fuß: Mindestmenge, Preis, Weiter */
.leiste-fuss {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px var(--rand-r) calc(10px + env(safe-area-inset-bottom)) var(--rand);
  background: var(--tt-surface); border-top: 1px solid var(--tt-border);
  box-shadow: 0 -4px 16px rgba(var(--tt-text-rgb), .08);
}
/* Handy: Preis links, Mindestmenge rechts, darunter der Knopf. Desktop: wie im Bild untereinander. */
.leiste-fuss { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "preis mindest" "warnung warnung" "knopf knopf"; align-items: end; column-gap: 12px; }
.preis { grid-area: preis; min-width: 0; }
.preis-stueck { font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.preis-stueck small, .preis-gesamt { font-size: 14px; font-weight: 400; color: var(--tt-text-muted); }
.preis-gesamt { display: block; }
.mindestmenge { grid-area: mindest; font-size: 14px; color: var(--tt-text-muted); text-align: right; }
.mindestmenge b { display: block; font-weight: 600; color: var(--tt-text); white-space: nowrap; }
.fuss-warnung { grid-area: warnung; }
.leiste-fuss > .knopf { grid-area: knopf; margin-top: 8px; }
.fuss-warnung { margin: 6px 0 0; font-size: 14px; color: var(--warn); }
.fuss-warnung:empty { display: none; }

/* Dialog (Entwurf gespeichert, Muster bestellen) */
.dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  color: var(--tt-text); border: 1px solid var(--tt-border); border-radius: 10px; box-shadow: 0 16px 48px rgba(var(--tt-text-rgb), .25);
}
.dialog::backdrop { background: rgba(var(--tt-text-rgb), .45); }
.dialog-inhalt { padding: 22px; }
.dialog-titel { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.dialog-text { font-size: 15px; }
.dialog-text p + p, .dialog-text p + .link-feld, .dialog-text .link-feld + p { margin-top: 10px; }
.dialog-text .betrag { font-size: 22px; font-weight: 700; }
.dialog-text .klein { font-size: 14px; color: var(--tt-text-muted); }
.link-feld { width: 100%; }
.dialog-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dialog-knoepfe .knopf { flex: 1 1 140px; }
.noscript { padding: 24px; }

/* Einführung (index.html #einfuehrung): steht direkt aufgerufen unter der Werkbank (Google soll die Startseite nicht als
   leer werten). Eingebettet entfernt app.js sie. Ab 900 px scrollt die Seite dafür; die Werkbank bleibt bildschirmhoch. */
.einfuehrung { max-width: 720px; margin: 0 auto; padding: 32px var(--rand-r) 48px var(--rand); color: var(--tt-text); }
html:not(.eingebettet) .einfuehrung { border-top: 1px solid var(--tt-border); max-width: none; }
html:not(.eingebettet) .einfuehrung > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.einfuehrung h1 { font-size: 24px; line-height: 1.25; margin-bottom: 12px; }
.einfuehrung h2 { font-size: 18px; margin: 20px 0 8px; }
.einfuehrung p, .einfuehrung li { font-size: 15px; }
.einfuehrung p + p, .einfuehrung ul + p, .einfuehrung ol + p { margin-top: 10px; }
.einfuehrung ul, .einfuehrung ol { margin: 0; padding-left: 20px; }
.einfuehrung li + li { margin-top: 6px; }
.einfuehrung a { color: var(--tt-link); }
@media (min-width: 900px) {
  html:not(.eingebettet) body { height: auto; overflow: visible; }
  html:not(.eingebettet) .werkbank { flex: none; height: calc(100dvh - var(--kopf-hoehe, 65px)); }
}
@media (scripting: none) { body { height: auto !important; overflow: visible !important; } }

/* Teilen-Auswahl im Dialog: zwei große Karten */
.teilen-wahl { display: grid; gap: 8px; margin-top: 14px; }
.teilen-option {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center;
  width: 100%; min-height: 72px; padding: 12px 14px; text-align: left;
  color: var(--tt-text); background: var(--tt-page-bg); border: 1px solid var(--tt-border); border-radius: 8px; cursor: pointer;
}
.teilen-option:hover { background: var(--tt-gray-offwhite); border-color: var(--tt-gray-dark); }
.teilen-option[disabled] { opacity: .55; cursor: progress; }
.teilen-symbol {
  grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--tt-accent-bg); color: var(--tt-text);
}
.teilen-option b { align-self: end; font-size: 16px; font-weight: 600; }
.teilen-option small { align-self: start; font-size: 14px; line-height: 1.35; color: var(--tt-text-muted); }

/* ------------------------------------------------------------------ ab 600 px: Hauptknopf in der Kopfzeile */
@media (min-width: 600px) {
  .kopf-bestellen { display: inline-flex; }
  .knopf-teilen { width: auto; padding: 0 14px 0 12px; }
  .teilen-text { display: inline; }
  .text-lang { display: inline; }
  .text-kurz { display: none; }
  .ansichten { display: flex; flex-wrap: wrap; justify-content: center; }
  .ansichten button { flex: 1 1 auto; padding: 4px 12px; }
  .leiste-inhalt { max-width: 720px; margin: 0 auto; }
}

/* ------------------------------------------------------------------ ab 900 px: Werkbank (Bühne + Seitenleiste 340 px) */
@media (min-width: 900px) {
  body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; padding-bottom: 0; }
  .kopf {
    flex: none; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "marke ansichten aktionen";
    min-height: 64px; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px;
    border-bottom: 1px solid var(--tt-border);   /* nur in der Werkbank-Ansicht; auf dem Handy ohne Linie über der Bühne */
    padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
  }
  .marke-logo { height: 40px; }
  /* Passt der Umschalter nicht, wird er waagerecht scrollbar; Zentrieren über Auto-Ränder schneidet links nichts ab */
  .ansichten { display: flex; flex-wrap: nowrap; justify-content: flex-start; justify-self: center; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ansichten::-webkit-scrollbar { display: none; }
  .ansichten button:first-child { margin-left: auto; }
  .ansichten button:last-child { margin-right: auto; }
  .ansichten button { flex: none; min-height: 36px; padding: 0 12px; }
  .kopf-aktionen { justify-self: end; }
  .werkbank { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--leiste); }
  .buehne { min-height: 0; }
  .buehne-flaeche { height: 100%; }
  .artikel { padding: 24px 24px 72px; }
  .buehne-leiste { left: 16px; bottom: 16px; }
  .leiste { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--tt-border); }
  .leiste-inhalt { flex: 1; min-height: 0; max-width: none; margin: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
  .leiste-fuss {
    position: static; flex: none; padding: 12px 20px 20px; box-shadow: none;
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "mindest" "preis" "warnung" "knopf";
  }
  .mindestmenge { display: flex; justify-content: space-between; gap: 12px; text-align: left; }
  .mindestmenge b { display: inline; font-weight: 500; }
  .preis { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 12px; margin-top: 6px; }
  .preis-gesamt { display: inline; }
}

/* 900–1279 px (z. B. iPad quer): kurzer Speichern-Text, damit Ansichten und Knöpfe in eine Zeile passen */
@media (min-width: 900px) and (max-width: 1279px) {
  .text-lang { display: none; }
  .text-kurz { display: inline; }
  .knopf-teilen { width: var(--tippen); padding: 0; }
  .teilen-text { display: none; }
  .ansichten button { padding: 0 9px; }
}
/* ab 1280 px: Ansichten-Umschalter in der Mitte, solange links und rechts genug Platz ist;
   sonst rückt er nach links, statt die Knöpfe zu überdecken */
@media (min-width: 1280px) {
  .kopf { grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
}

/* Große Bildschirme: Artikel darf mitwachsen, Kopfzeile bleibt ruhig */
@media (min-width: 1400px) {
  .artikel { padding: 32px 48px 80px; }
}

/* Eingebettet (iframe, html.eingebettet setzt app.js; docs/EINBETTUNG.md). Die Elternseite passt die Rahmenhöhe an
   die gemeldete Höhe an. Dialoge oben statt mittig, weil der Rahmen auf dem Handy so hoch wie der ganze Inhalt ist;
   app.js meldet beim Öffnen „nach oben“. Ab 900 px füllt die Werkbank den Rahmen, mindestens 720 px hoch
   (sonst bliebe ein anfangs niedriger Rahmen niedrig). */
.eingebettet .dialog { margin: 16px auto auto; }
@media (min-width: 900px) {
  .eingebettet body { height: max(100dvh, 720px); }
}

/* Bewegung reduzieren, wenn das Betriebssystem es verlangt */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Info zur Veredelung (seit 14.11.2026): „i“ neben Stick, Siebdruck, DTF und Pop-up mit Galerie, Erklärung und Technik.
   Inhalt aus assets/veredelung-info.json (werkzeuge/veredelung_info.py, Quelle: Konfigurator). */
.zeile-kopf { display: flex; align-items: center; }
.zeile-kopf .zeile-knopf { flex: 1; min-width: 0; }
.zeile-info {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%;
  border: 1px solid var(--tt-border); background: #fff; color: var(--tt-text-muted); font: inherit; font-size: 14px; font-weight: 700; font-style: italic; cursor: pointer;
}
.zeile-info:hover, .zeile-info:focus-visible { background: var(--tt-text); color: #fff; border-color: var(--tt-text); }
.vinfo {
  --vinfo-h: min(40rem, calc(100dvh - 2rem));
  width: min(calc(var(--vinfo-h) + 26rem), calc(100vw - 2rem)); max-width: none; max-height: var(--vinfo-h); padding: 0; border: 0;
  border-radius: 16px; background: #fff; color: var(--tt-text); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); overflow: hidden; overscroll-behavior: contain;
}
.vinfo::backdrop { background: rgba(var(--tt-text-rgb), .45); }
.vinfo-karte { position: relative; display: grid; grid-template-columns: minmax(0, var(--vinfo-h)) minmax(22rem, 1fr); height: var(--vinfo-h); }
.vinfo-zu {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--tt-text); font: inherit; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.vinfo-zu:hover { background: var(--tt-text); color: #fff; }
.vinfo-galerie { position: relative; min-height: 0; background: #f4f4f4; }
.vinfo-buehne { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.vinfo-buehne::-webkit-scrollbar { display: none; }
.vinfo-buehne:focus-visible { outline: 2px solid var(--tt-text); outline-offset: -4px; }
.vinfo-bild { flex: 0 0 100%; margin: 0; scroll-snap-align: center; }
.vinfo-bild img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vinfo-pfeil {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .9); color: var(--tt-text); font: inherit; font-size: 26px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.vinfo-pfeil:hover { background: var(--tt-text); color: #fff; }
.vinfo-pfeil-zurueck { left: 12px; }
.vinfo-pfeil-vor { right: 12px; }
.vinfo-punkte { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.vinfo-punkt { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); background: rgba(255, 255, 255, .85); cursor: pointer; }
.vinfo-punkt[aria-current="true"] { width: 22px; border-radius: 999px; background: var(--tt-lilac-primary); border-color: var(--tt-lilac-dark); }
.vinfo-text { display: grid; align-content: start; gap: 14px; padding: 30px 30px 0; overflow-x: hidden; overflow-y: auto; min-height: 0; font-size: 15px; line-height: 1.55; }
.vinfo-text p { margin: 0; }
.vinfo-marke { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--tt-lilac-light); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.vinfo-titel { margin: 0; padding-right: 40px; font-size: 24px; line-height: 1.2; font-weight: 700; }
.vinfo-block { display: grid; gap: 6px; }
.vinfo-block h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tt-text-muted); }
.vinfo-block ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.vinfo-block li { position: relative; padding-left: 22px; }
.vinfo-block li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 8px; height: 8px; border-radius: 2px; background: var(--tt-lilac-primary); }
.vinfo-hinweis { font-size: 13px; color: var(--tt-text-muted); }
.vinfo-eignung { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vinfo-gut, .vinfo-grenzen { align-content: start; padding: 12px 14px; border-radius: 10px; background: var(--tt-gray-offwhite); }
.vinfo-gut li::before { content: "✓"; background: none; width: auto; height: auto; top: 0; left: 1px; font-weight: 700; color: var(--tt-text); }
.vinfo-grenzen li::before { content: "–"; background: none; width: auto; height: auto; top: 0; left: 3px; font-weight: 700; color: var(--tt-text-muted); }
.vinfo-mehr { font-weight: 700; color: var(--tt-text); text-decoration: underline; text-decoration-color: var(--tt-lilac-dark); text-underline-offset: 3px; }
.vinfo-fuss { position: sticky; bottom: 0; padding: 10px 0 20px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 10px); }
@media (max-width: 47.99rem) {
  .vinfo { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .vinfo-karte { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
  .vinfo-galerie { aspect-ratio: 1 / 1; max-height: 52dvh; }
  .vinfo-text { padding: 20px 18px 0; }
  .vinfo-titel { font-size: 21px; }
  .vinfo-eignung { grid-template-columns: 1fr; }
  .vinfo-fuss { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Handy: Felder der Motivkarte mit voller Tippfläche */
@media (max-width: 899px) {
  .motiv-feld select.eingabe, .motiv-feld input { min-height: var(--tippen); }
}

/* All-Over-Print: Felder und Größenregler in der Veredelung, Siebkosten unter dem Preis */
.allover .unterkopf { margin-top: 14px; }
.allover .unterkopf:first-child { margin-top: 4px; }
.allover .farbfelder { margin-top: 6px; }
.allover .blockkopf-zeile { margin-top: 14px; }
.allover .blockkopf-zeile .unterkopf { margin-top: 0; }
.allover-suche { margin: 10px 0 0; }
.allover-regler { display: flex; align-items: center; gap: 12px; margin-top: 6px; min-height: var(--tippen); }
.allover-regler input[type=range] { flex: 1 1 auto; min-width: 0; accent-color: var(--tt-primary); }
.allover-regler output { min-width: 60px; text-align: right; color: var(--tt-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.allover #allover-raster { margin-top: 4px; }
.preis-zusatz { font-size: 13px; color: var(--tt-text-muted); }

/* Rechtliches unten in der Seitenleiste */
.rechtliches { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 18px 0 8px; border-top: 1px solid var(--tt-border); font-size: 13px; }
.rechtliches a { color: var(--tt-text-muted); text-decoration: underline; text-underline-offset: 3px; min-height: 24px; display: inline-flex; align-items: center; }
.rechtliches a:hover { color: var(--tt-text); }
html.ohne-einwilligung .rechtliches [data-einwilligung] { display: none; }

/* Einwilligungs-Hinweis Google Analytics (assets/js/einwilligung.js, Texte assets/einwilligung.json).
   Beide Knöpfe gleich groß und gleich auffällig. Liegt über der festen Leiste unten (Handy). */
.einwilligung {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px;
  padding: 18px var(--rand-r) calc(env(safe-area-inset-bottom) + 18px) var(--rand);
  background: var(--tt-page-bg); color: var(--tt-text);
  border-top: 1px solid var(--tt-border); box-shadow: 0 -6px 24px rgba(var(--tt-text-rgb), .12);
  transform: translateY(110%); transition: transform .3s ease;
}
.einwilligung.da { transform: none; }
.einwilligung-text { flex: 1 1 420px; min-width: 0; }
.einwilligung-titel { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.einwilligung-text p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--tt-text-muted); }
.einwilligung-text a { color: var(--tt-link); text-decoration: underline; text-underline-offset: 3px; }
.einwilligung-knoepfe { flex: 0 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: min(100%, 340px); }
.einwilligung-knopf { width: 100%; background: var(--tt-surface); border-color: var(--tt-gray-dark); font-size: 16px; }
.einwilligung-knopf:hover { background: var(--tt-accent-bg); }
.einwilligung-knopf:focus-visible { outline: 3px solid var(--tt-focus); outline-offset: 2px; }
@media (max-width: 600px) { .einwilligung-knoepfe { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { .einwilligung { transition: none; } }
