:root {
  --ink: #3b3b3b;
  --muted: #7a776f;
  --line: #3b3b3b;
  --accent: #c4d4e0;
  --chip: #4a4a48;
  --mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --bw: 1.5px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background: #fff;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.tiny { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Paketschein ---------- */
.sheet { min-height: 100vh; display: flex; flex-direction: column; padding: clamp(16px, min(4.5vw, 6vh), 72px); }
.label {
  flex: 1;
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.label > :not(.legal) { border-left: var(--bw) solid var(--line); border-right: var(--bw) solid var(--line); }
.head { border-top: var(--bw) solid var(--line); }
.foot { border-bottom: var(--bw) solid var(--line); }

/* Kopfzeile */
.head { display: grid; grid-template-columns: 1fr auto 74px; min-height: 64px; }
.cell { display: flex; align-items: center; background: none; border: 0; padding: 0 18px; }
.cell + .cell { border-left: var(--bw) solid var(--line); }
.cell.counter { border-left: 0; } /* Zähler und Logo ohne Trennlinie */
.logo { flex-direction: column; align-items: flex-start; justify-content: center; text-decoration: none; gap: 0; }
.logo img { height: 40px; width: auto; display: block; }
.logo-word { font-weight: 800; font-style: italic; font-size: 34px; line-height: .9; letter-spacing: -.06em; }
.logo-sub { white-space: nowrap; font-weight: 800; font-style: italic; font-size: 7.5px; letter-spacing: -.01em; margin-left: 22px; }
.counter { font-family: var(--mono); font-weight: 600; font-size: 19px; letter-spacing: .04em; padding: 0 22px; white-space: nowrap; }
.cart-btn { justify-content: center; position: relative; }

/* Warenkorb-Übersicht (Hover) */
.head { position: relative; z-index: 5; }
.cart-pop {
  position: absolute; top: calc(100% + var(--bw)); right: calc(-1 * var(--bw)); width: min(380px, 100vw - 40px);
  background: #fff; border: var(--bw) solid var(--line); padding: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.cart-pop.open { opacity: 1; visibility: visible; transform: none; }
.cart-pop ul { list-style: none; margin: 10px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.cart-pop li { border-top: 1px dashed #b9b5aa; }
.pop-line { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 4px; background: none; border: 0; text-align: left; }
.pop-line img { width: 44px; height: 44px; object-fit: contain; background: #f3f1ea; border-radius: 3px; }
.pop-line b { display: block; font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; font-size: 15px; margin-bottom: 3px; }
.pop-line .tiny { text-transform: none; }
.pop-line .mono { font-weight: 600; }
@media (hover: hover) { .pop-line:hover { background: #f4f3ef; } }
.pop-sum { display: flex; justify-content: space-between; align-items: center; border-top: var(--bw) solid var(--line); padding: 8px 4px; }
.pop-sum.total { font-weight: 800; font-size: 20px; letter-spacing: -.04em; padding-bottom: 10px; }
.pop-go { width: 100%; background: var(--chip); color: #fff; border: 0; padding: 11px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.pop-empty { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 14px 0 4px; }
.cart-dot { position: absolute; top: 16px; right: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
@media (hover: hover) { .counter:hover, .cart-btn:hover { background: #f4f4f2; } }

/* Hauptbereich: links Bildfenster, rechts Angaben */
.body {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 1fr);
  border-top: var(--bw) solid var(--line);
  border-bottom: var(--bw) solid var(--line);
  min-height: 430px;
}
.win { min-width: 0; }
.right { border-left: var(--bw) solid var(--line); display: flex; flex-direction: column; }

/* ---------- Bildfenster ---------- */
.viewer { position: relative; height: 100%; min-height: 430px; display: flex; flex-direction: column; user-select: none; }
.viewer .tiny { position: absolute; top: 14px; left: 14px; z-index: 1; }
/* Bild randlos bis an den Rahmen */
.stage { flex: 1; position: relative; min-height: 0; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity .2s; }
.stage img.loading { opacity: 0; }
/* Zoom (Maßstab und Verschiebung setzt app.js) */
.stage { overflow: hidden; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='12.5' fill='%23fff' fill-opacity='.85' stroke='%231a1a1a' stroke-width='1.5'/%3E%3Cpath d='M16 10v12M10 16h12' stroke='%231a1a1a' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, zoom-in; touch-action: none; }
.stage img { transform-origin: 0 0; transition: opacity .2s, transform .3s ease; -webkit-user-drag: none; }
.stage.dragging img { transition: opacity .2s; }
.stage.zoomed { cursor: grab; }
.stage.zoomed.dragging { cursor: grabbing; }
.stage.zoomed::after, .stage.expanded::after {
  content: "ZIEHEN ZUM VERSCHIEBEN · KLICK SCHLIESST"; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: var(--muted); background: rgba(255,255,255,.85); padding: 2px 6px; white-space: nowrap;
}
@media (hover: none) { .stage.zoomed::after, .stage.expanded::after { content: "ZWEI FINGER ZOOMEN · TIPPEN SCHLIESST"; } }
.viewer .scroll-hint { z-index: 1; }
.nav-arrow { z-index: 2; position: absolute; bottom: 0; width: 56px; height: 42px; display: grid; place-items: center; background: #fff; border: 0; font-size: 26px; line-height: 1; padding: 0 0 3px; }
.nav-arrow.prev { left: 0; }
.nav-arrow.next { right: 0; }
.nav-arrow:disabled { color: rgba(59, 59, 59, .25); cursor: default; }
/* Pfeile in deckenden Boxen, unten bündig am Rahmen (liegen oft auf dem Bild) */

/* ---------- Angaben ---------- */
.title { background: var(--accent); flex: 1; min-height: 200px; padding: 16px 16px 18px; position: relative; transition: background .3s; display: flex; flex-direction: column; align-items: flex-start; }
.title-details { margin-top: auto; padding-top: 16px; }
.title-details .tiny { color: rgba(40, 40, 40, .6); }
.title-details p { margin: 6px 0 6px; font-size: 14px; line-height: 1.35; max-width: 42ch; }
.ship-note { text-transform: none; }
.title-details .material { display: block; text-transform: none; color: var(--ink); margin-bottom: 4px; }
.ship-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.title h1 { font-weight: 800; font-size: clamp(30px, 3.4vw, 44px); line-height: .95; letter-spacing: -.06em; margin: 12px 0 10px; text-transform: uppercase; }
.title .mono { font-size: 11px; text-transform: none; }
/* Farbauswahl: eckige Farbfelder zum Anhaken, Name daneben */
.colors { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 4px; }
.color-box { width: 18px; height: 18px; padding: 0; border: 1px solid var(--ink); background: var(--c); position: relative; }
.color-box.on::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px; border: solid var(--k); border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* Farbe in keiner Größe vorrätig: blass und durchgestrichen (bleibt anklickbar, zeigt dann SOLD OUT) */
.color-box.out { opacity: .5; }
.color-box.out::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink); transform: rotate(45deg); }
@media (hover: hover) { .color-box:not(.on):hover { outline: 1px solid var(--ink); outline-offset: 2px; } }
.colors .color-name { margin-left: 4px; color: var(--ink); }
.swatch { display: inline-block; width: 8px; height: 8px; border: 1px solid var(--ink); margin: 0 4px -1px 0; }
.pnav { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 13px; }
.pnav button { background: none; border: 0; padding: 4px 7px; font-size: 15px; }
.pnav button:hover { background: rgba(255,255,255,.45); }

.rowline { border-top: var(--bw) solid var(--line); display: flex; align-items: center; gap: 18px; padding: 10px 12px; min-height: 54px; }
.rowline .tiny { min-width: 74px; }


/* Menge: rechts im Preis-Stil, darunter ein mittig geteiltes Feld (links −, rechts +) */
.qtyrow { border-top: var(--bw) solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Geteiltes Feld (Größe, Menge): links klicken = zurück, rechts klicken = weiter, Wert mittig */
.splitcell { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 96px; }
.splitcell + .splitcell { border-left: var(--bw) solid var(--line); }
.split-legend { position: absolute; top: 12px; left: 12px; right: 8px; z-index: 2; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.splitcell:has(.half)::after { content: ""; position: absolute; left: 50%; width: var(--bw); height: 9px; background: var(--line); transform: translateX(-50%); z-index: 1; pointer-events: none; }
.splitcell::after { bottom: 0; }
.pricecell { display: block; }
/* Pflichthinweis Versandkosten hinter dem Stückpreis (die Preisbox selbst ist nicht klickbar, der Link schon) */
.ship-link { pointer-events: auto; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .ship-link:hover { text-decoration: underline; text-underline-offset: 2px; } }
/* passt die Zeile nicht, rutscht nur „+ Versand“ direkt darunter */
.pricecell .split-sub { white-space: normal; text-align: center; letter-spacing: 0; line-height: 1.3; }
.half { background: none; border: 0; padding: 0; }
.half:disabled { cursor: default; }
.half:active:not(:disabled) { background: #eceae3; }
@media (hover: hover) { .half:hover:not(:disabled) { background: #f4f3ef; } }
.split-value { position: absolute; inset: 26px 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
.split-value .price { margin: 0; font-size: 28px; white-space: nowrap; transition: color .12s; }
.split-value .unit { margin-left: .22em; }
.split-value .price.preview, .split-value.preview .price { color: #a9a69e; }
.split-sub { text-transform: none; white-space: nowrap; }
.split-sub b { font-weight: 400; }
.split-sub b.on { color: var(--ink); font-weight: 600; }
.split-sub b.out { text-decoration: line-through; opacity: .55; }
.split-sub.soldout { color: #b3261e; font-weight: 600; letter-spacing: .08em; }
.hidden-flag { color: #b3261e; font-weight: 600; }
.price { font-weight: 800; font-size: 26px; letter-spacing: -.04em; margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  width: 35px; height: 35px; border-radius: 50%;
  border: 1.2px solid var(--ink); background: transparent;
  font-family: var(--mono); font-size: 14px; display: grid; place-items: center; padding: 0;
}
.chip.wide { width: auto; min-width: 35px; padding: 0 10px; border-radius: 18px; }
.chip.on { background: var(--chip); color: #fff; border-color: var(--chip); }
@media (hover: hover) { .chip:hover:not(.on):not(:disabled) { background: #eceae3; } }
.chip:disabled { opacity: .3; cursor: default; }

/* ---------- Warenkorb ---------- */
.cartlist { padding: 14px; height: 100%; display: flex; flex-direction: column; }
.cartlist .tiny:first-child { margin-bottom: 10px; }
.cline { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px dashed #b9b5aa; }
.cline:last-child { border-bottom: 1px dashed #b9b5aa; }
.cline img { width: 64px; height: 64px; object-fit: contain; background: #f3f1ea; border-radius: 4px; }
.cline .name { font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; font-size: 17px; }
/* Größe und Menge nebeneinander unter Name und Preis, eckige Felder im Etikett-Stil */
.cline img { grid-row: 1 / 3; }
.cline .sum { grid-column: 3; grid-row: 1; }
.cline-opts { grid-column: 2 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: -6px; }
.cline-row { display: flex; align-items: center; gap: 10px; }
/* breite Ansicht: Boxen in der Zeile des Produktnamens, zwischen Name und Preis */
@media (min-width: 561px) and (min-height: 520px) {
  .cline { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
  .cline img { grid-row: 1; }
  .cline-opts { grid-column: 3; grid-row: 1; margin-top: 0; flex-wrap: nowrap; gap: 14px; padding-top: 1px; }
  .cartlist .cline > .sum { grid-column: 4; min-width: 100px; }
  .cline-row .tiny { display: none; }
  /* Größen- und Mengenboxen über alle Zeilen bündig (Platz für bis zu 5 Größen) */
  .cline-opts .cline-row:first-child { min-width: 122px; }
}
.cline-row .tiny { min-width: 48px; font-size: 9px; line-height: 1; margin: 0 !important; }
.cline .chips { gap: 3px; }
.cline .chips .chip { width: 22px; height: 22px; font-size: 11.5px; border-radius: 0; border-width: 1px; }
.cline .chips .chip.wide { width: auto; min-width: 22px; padding: 0 5px; border-radius: 0; }
.cline .sum { font-family: var(--mono); font-weight: 600; min-width: 74px; text-align: right; padding-top: 2px; }
.swipe-hint { display: none; margin-top: 8px; text-transform: none; }
@media (hover: none) { .swipe-hint { display: block; } }
.linkbtn { background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; text-transform: uppercase; letter-spacing: .06em; }
.empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.sumrow { min-height: 46px; justify-content: space-between; font-family: var(--mono); font-size: 13px; }
.sumrow.total { font-family: var(--sans); font-weight: 800; font-size: 24px; letter-spacing: -.04em; }
.checkout { margin-top: auto; margin-left: auto; width: min(100%, 420px); padding-top: 18px; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; margin-bottom: 12px; }
.agree input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--chip); flex: none; }
.note { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.msg { font-family: var(--mono); font-size: 12px; padding: 10px; border: 1px dashed var(--ink); margin-top: 8px; }
#paypal-buttons { min-height: 45px; }
#paypal-buttons.locked { opacity: .45; pointer-events: none; filter: grayscale(1); }

/* ---------- Fußzeile ---------- */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 12px 10px; min-height: 74px; }
.foot-meta { flex: none; display: flex; flex-direction: column; gap: 8px; }
#footCode { white-space: nowrap; }
.barcode { width: min(440px, 52%); text-align: center; }
.barcode svg { width: 100%; height: 36px; display: block; }

.shop .label { padding-bottom: 0 !important; }
/* links bündig mit dem Text der Fußzeile (Innenabstand + Rahmenlinie) */
.legal { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px 22px; padding: 16px 12px 17px calc(12px + var(--bw)); }
.legal a { text-decoration: none; }
.legal a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid #1d5fbf; outline-offset: 2px; }

/* ---------- Tablet / Phone: oben/unten ---------- */
@media (max-width: 860px) {
  .body { grid-template-columns: 1fr; min-height: 0; }
  .right { border-left: 0; border-top: var(--bw) solid var(--line); }
  .viewer { min-height: 0; aspect-ratio: 1 / 1; max-height: 70vh; }
  .title { min-height: 150px; }
  [data-mode="cart"] .right { order: -1; border-top: 0; border-bottom: var(--bw) solid var(--line); }
  [data-mode="cart"] .title { min-height: 0; }
}
@media (max-width: 560px) {
  .sheet { padding: 20px 16px; }
  .label { padding: 10px; border-radius: 10px; }
  .head { grid-template-columns: 1fr auto 54px; min-height: 54px; }
  .cell { padding: 0 10px; }
  .logo-word { font-size: 26px; }
  .logo img { height: 32px; }
  .logo-sub { font-size: 6px; margin-left: 14px; }
  .counter { font-size: 12.5px; padding: 0 10px; letter-spacing: 0; }
  .cart-btn svg { width: 24px; height: 24px; }
  .cart-dot { top: 12px; right: 10px; }
  .rowline { gap: 10px; }
  .rowline .tiny { min-width: 62px; }
  .chip { width: 33px; height: 33px; }
  .price { font-size: 22px; }
  .split-value .price { font-size: 22px; }
  .split-legend { top: 9px; left: 9px; }
  .split-value { inset: 22px 4px 7px; gap: 2px; }
  .splitcell { min-height: 84px; }
  .cline { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; }
  .cline img { width: 52px; height: 52px; }
  /* schmale Spalte: Beschriftung weglassen, Buchstaben (Größe) und Zahlen (Menge) sind eindeutig */
  .cline-opts { gap: 6px 14px; }
  .cline-row .tiny { display: none; }
  .cline .chips .chip { width: 24px; height: 24px; font-size: 13px; }
  .cline .chips .chip.wide { min-width: 24px; }
  .foot { min-height: 62px; flex-wrap: wrap; row-gap: 12px; }
  .legal { gap: 4px 14px; padding: 12px 12px 13px calc(12px + var(--bw)); font-size: 10.5px; }
  .barcode svg { height: 28px; }
}

/* ---------- Schein passt exakt ins Fenster, keine Scrollbalken (PC & Phone) ---------- */
@media (min-height: 520px) {
  html:has(body.shop) { overflow: hidden; overscroll-behavior: none; }
  body.shop { overflow: hidden; overscroll-behavior: none; }
  .shop .sheet {
    height: 100vh; height: 100dvh; height: var(--app-h, 100dvh);
    min-height: 0;
    /* Abstand zu abgerundeten Ecken / Home-Leiste (iPhone) */
    padding-bottom: calc(clamp(16px, min(4.5vw, 6vh), 72px) + env(safe-area-inset-bottom, 0px));
  }
  .shop .label { min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
  .shop .body { min-height: 0; }
  .shop .left, .shop .right { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b9b5aa transparent; }
  .shop .viewer { min-height: 0; }
  .shop .title { min-height: auto; flex-shrink: 0; }
  .shop [data-mode="product"] .body { touch-action: none; }
}
@media (min-height: 520px) and (max-width: 860px) {
  .shop .body { grid-template-rows: minmax(0, 1fr) auto; }
  .shop [data-mode="cart"] .body { grid-template-rows: auto minmax(0, 1fr); }
  .shop .viewer { aspect-ratio: auto; max-height: none; }
  .shop .viewer .tiny { top: 10px; left: 10px; }
  .shop .right { overflow: visible; }
  .shop [data-mode="cart"] .right { overflow: visible; }
  .shop .title { flex: none; min-height: 0; padding: 10px 12px 12px; }
  .shop .title h1 { font-size: 30px; margin: 8px 0 6px; }
  .shop .pnav { top: 5px; right: 4px; }
}
/* Desktop/Laptop: Fußzeile, Strichcode und Linkzeile wachsen mit der Fensterbreite mit
   (bei ~1500 px wie gehabt, darüber nicht größer) – sonst wirken sie auf kleineren Laptops zu groß */
@media (min-height: 520px) and (min-width: 861px) {
  .shop .foot { min-height: clamp(56px, 4.93vw, 74px); padding: clamp(8px, .8vw, 12px) 12px clamp(7px, .67vw, 10px); }
  .shop .foot-meta { gap: clamp(5px, .53vw, 8px); }
  .shop .foot .tiny { font-size: clamp(8.5px, .67vw, 10px); }
  .shop #footCode { font-size: clamp(10px, .8vw, 12px); }
  .shop .barcode { width: min(440px, 29.3vw); }
  .shop .barcode svg { height: clamp(24px, 2.4vw, 36px); }
  .shop .legal { font-size: clamp(10px, .8vw, 12px); gap: 6px clamp(14px, 1.47vw, 22px); padding: clamp(10px, 1.07vw, 16px) 12px clamp(10px, 1.13vw, 17px) calc(12px + var(--bw)); }
}
/* Flache Desktop-/Laptop-Fenster (z. B. Windows-Skalierung 125–150 % oder Browser-Zoom): Namensfeld kompakter */
@media (min-height: 520px) and (max-height: 640px) and (min-width: 861px) {
  .shop .title { padding: 12px 16px 12px; }
  .shop .title h1 { font-size: clamp(26px, 3vw, 36px); margin: 8px 0 6px; }
  .shop .title-details p { margin: 4px 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
}
@media (min-height: 520px) and (max-height: 580px) and (min-width: 861px) {
  .shop .splitcell { min-height: 80px; }
  .shop .split-value { inset: 24px 6px 6px; gap: 2px; }
  .shop .title-details p { -webkit-line-clamp: 2; }
  .shop .head { min-height: 52px; }
  .shop .logo img { height: 32px; }
  .shop .foot { min-height: 60px; padding: 8px 12px 7px; }
  .shop .foot-meta { gap: 5px; }
  .shop .barcode svg { height: 30px; }
}
/* Phone hoch: im Zoom macht das Namensfeld dem Bild Platz (zurück, sobald der Zoom schließt) */
@media (min-height: 520px) and (max-width: 860px) {
  .shop:has(.stage.zoomed) .title, .shop:has(.stage.expanded) .title { display: none; }
  .shop:has(.stage.zoomed) .qtyrow, .shop:has(.stage.expanded) .qtyrow { border-top: 0; } /* sonst liegen zwei Linien übereinander */
}
@media (min-height: 520px) and (max-width: 560px) {
  .shop .sheet { padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .shop .label { padding: 7px; }
  .shop .head { min-height: 48px; }
  .shop .logo-word { font-size: 23px; }
  .shop .logo img { height: 29px; }
  .shop .title-details { padding-top: 8px; }
  .shop .title-details p { font-size: 13px; margin: 4px 0; }
  .shop .split-value .price { font-size: 21px; }
  .shop .rowline { min-height: 44px; padding: 5px 10px; }
  .shop .chip { width: 31px; height: 31px; font-size: 13px; }
  .shop .sumrow { min-height: 36px; }
  .shop .foot { min-height: 0; padding: 6px 10px; row-gap: 6px; }
  .shop .foot-meta { gap: 3px; flex: none; min-width: 0; }
  /* Code inkl. Farbe und Menge bleibt einzeilig: etwas kleiner; der Strichcode nimmt nur den Rest (höchstens 44 %) */
  .shop #footCode { font-size: 11px; letter-spacing: .02em; }
  .shop .barcode { width: auto; flex: 1 1 0; min-width: 0; max-width: 44%; }
  .shop .barcode svg { height: 20px; }
  .shop .legal { gap: 3px 12px; padding: 9px 10px 10px calc(10px + var(--bw)); }
}

/* Kleine / kurze Phones: mehr Platz fürs Bild */
@media (min-height: 520px) and (max-height: 760px) and (max-width: 560px) {
  .shop .foot-meta .tiny { display: none; }
  .shop .ship-note { font-size: 9.5px; letter-spacing: .02em; white-space: nowrap; }
  .shop .title { padding: 8px 12px 10px; }
  .shop .title h1 { font-size: 26px; margin: 6px 0 4px; }
  .shop .rowline { min-height: 40px; padding: 4px 10px; }
  .shop .chip { width: 29px; height: 29px; }
  .shop .head { min-height: 44px; }
  .shop .logo img { height: 26px; }
  .shop .barcode svg { height: 16px; }
  .shop .legal { padding: 7px 10px 8px calc(10px + var(--bw)); font-size: 10px; }
}

/* ---------- Phone quer: Bild links, Angaben rechts, alles kompakt im Fenster ---------- */
@media (max-height: 519px) and (orientation: landscape) and (min-width: 520px) {
  html:has(body.shop) { overflow: hidden; overscroll-behavior: none; }
  body.shop { overflow: hidden; overscroll-behavior: none; }
  .shop .sheet {
    height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); min-height: 0;
    /* Notch / Kamera-Ausschnitt seitlich */
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  .shop .label { min-height: 0; padding: 6px; border-radius: 10px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .shop .head { grid-template-columns: 1fr auto 48px; min-height: 40px; }
  .shop .cell { padding: 0 10px; }
  .shop .logo img { height: 23px; }
  .shop .counter { font-size: 12.5px; padding: 0 10px; letter-spacing: 0; }
  .shop .cart-btn svg { width: 22px; height: 22px; }
  .shop .cart-dot { top: 8px; right: 8px; }
  .shop .body { min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr); }
  .shop .left, .shop .right { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b9b5aa transparent; }
  .shop .right { border-left: var(--bw) solid var(--line); border-top: 0; border-bottom: 0; }
  .shop [data-mode="cart"] .right { order: 0; border-bottom: 0; }
  .shop [data-mode="product"] .body { touch-action: none; }
  .shop .viewer { min-height: 0; aspect-ratio: auto; max-height: none; }
  .shop .viewer .tiny { top: 8px; left: 8px; }
  .shop .scroll-hint { top: 8px; right: 8px; }
  .shop .nav-arrow { font-size: 20px; width: 44px; height: 32px; }
  .shop .title { flex: 1 0 auto; min-height: 0; padding: 7px 10px 8px; }
  .shop .title h1 { font-size: 22px; margin: 5px 0 3px; }
  .shop .pnav { top: 3px; right: 3px; font-size: 12px; }
  .shop .title-details { padding-top: 6px; }
  /* lange Beschreibungen kürzen, damit Größe / Menge / Preis immer sichtbar bleiben (komplett im Hochformat) */
  .shop .title-details p { font-size: 12px; margin: 2px 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .shop .title-details .material { margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .shop .ship-note { font-size: 9.5px; letter-spacing: .02em; white-space: nowrap; }
  .shop .splitcell { min-height: 64px; }
  .shop .split-legend { top: 6px; left: 8px; }
  .shop .split-value { inset: 18px 4px 8px; gap: 2px; }
  .shop .split-value .price { font-size: 19px; }
  .shop .rowline { min-height: 38px; padding: 4px 10px; gap: 10px; }
  .shop .chip { width: 28px; height: 28px; font-size: 12px; }
  .shop .sumrow { min-height: 32px; }
  .shop .foot { min-height: 0; padding: 4px 10px; gap: 12px; }
  .shop .foot-meta { gap: 2px; }
  .shop .foot-meta .tiny { display: none; }
  .shop .barcode { width: min(300px, 45%); }
  .shop .barcode svg { height: 15px; }
  .shop .legal { gap: 2px 14px; padding: 5px 10px 4px calc(10px + var(--bw)); font-size: 9.5px; }
  /* Warenkorb-Zeilen wie im Hochformat: Menge unter dem Namen */
  .shop .cartlist { padding: 10px; }
  .shop .cline { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; }
  .shop .cline img { width: 44px; height: 44px; }
  .shop .cline .name { font-size: 15px; }
  .shop .cline .sum { min-width: 0; }
  .shop .cline .chips .chip { width: 21px; height: 21px; font-size: 12px; }
  .shop .cline-opts { gap: 6px 14px; }
  .shop .cline-row .tiny { display: none; }
}
/* Flache Phones quer (360–380 px hoch) */
@media (max-height: 380px) and (orientation: landscape) and (min-width: 520px) {
  .shop .title-details > .tiny:first-child { display: none; }
}
/* Sehr flache Phones quer (z. B. iPhone SE) */
@media (max-height: 340px) and (orientation: landscape) and (min-width: 520px) {
  .shop .head { min-height: 34px; }
  .shop .logo img { height: 20px; }
  .shop .title h1 { font-size: 19px; margin: 4px 0 2px; }
  .shop .title-details { padding-top: 4px; }
  .shop .title-details p { -webkit-line-clamp: 1; }
  .shop .splitcell { min-height: 58px; }
  .shop .split-value .price { font-size: 17px; }
  .shop .pricecell .split-sub { font-size: 8.5px; }
  /* Warenkorb: Größe + Menge nutzen die volle Breite (unter dem Produktbild) */
  .shop .cline img { grid-row: 1; }
  .shop .cline-opts { grid-column: 1 / -1; margin-top: 0; }
  .shop .barcode svg { height: 13px; }
}

/* Produktwechsel: Rahmen bleibt, Inhalt fährt ein */
@keyframes in-up { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes in-down { from { transform: translateY(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
.enter-up > * { animation: in-up .38s cubic-bezier(.2,.7,.2,1) both; }
.enter-down > * { animation: in-down .38s cubic-bezier(.2,.7,.2,1) both; }
.right.enter-up > *:nth-child(2), .right.enter-down > *:nth-child(2) { animation-delay: .03s; }
.right.enter-up > *:nth-child(n+3), .right.enter-down > *:nth-child(n+3) { animation-delay: .06s; }
@media (prefers-reduced-motion: reduce) { .enter-up > *, .enter-down > * { animation: none; } }

.scroll-hint { position: absolute; top: 14px; right: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.scroll-hint i { display: block; width: 1px; height: 18px; background: var(--muted); animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- Strichcode teilen ---------- */
.foot { position: relative; }
button.barcode { background: none; border: 0; padding: 4px; margin: -4px; color: inherit; cursor: pointer; }
button.barcode:disabled { cursor: default; }
@media (hover: hover) { button.barcode:not(:disabled):hover { background: #f4f3ef; } }
.share-pop {
  position: absolute; bottom: calc(100% + var(--bw)); right: calc(-1 * var(--bw)); z-index: 6;
  width: min(380px, 100vw - 40px); background: #fff; border: var(--bw) solid var(--line); padding: 12px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .1);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.share-pop.open { opacity: 1; visibility: visible; transform: none; }
.share-code { font-family: var(--mono); font-weight: 600; font-size: 22px; letter-spacing: .04em; margin: 10px 0 8px; }
.share-pop p { font-size: 13px; line-height: 1.4; margin: 0 0 10px; }
.share-pop .share-tip { text-transform: none; }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.share-actions button { flex: 1 1 auto; background: #fff; border: var(--bw) solid var(--line); padding: 9px 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.share-actions button:first-child { background: var(--chip); color: #fff; border-color: var(--chip); }
@media (hover: hover) { .share-actions button:not(:first-child):hover { background: #f4f3ef; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100vw - 32px); background: var(--chip); color: #fff;
  font-family: var(--mono); font-size: 12px; line-height: 1.4; padding: 12px 16px;
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nowrap { white-space: nowrap; }

/* ---------- Papier-Hintergrund: glattes Papier mit weicher Beule rechts (Label über einer Wölbung im Paket), nicht im Admin ---------- */
body:not(.admin) { background: #f2f2ef; }
body:not(.admin)::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    /* Beule: Lichtseite oben links, Schattenseite unten rechts, dazwischen eine weiche Kante */
    radial-gradient(ellipse 15% 36% at 71% 44%, rgba(255,255,255,.95), rgba(255,255,255,.45) 55%, transparent 100%),
    linear-gradient(97deg, transparent 57%, rgba(0,0,0,.08) 63.5%, rgba(255,255,255,.65) 66%, transparent 72%),
    radial-gradient(ellipse 24% 48% at 81% 59%, rgba(55,55,50,.22), rgba(55,55,50,.08) 60%, transparent 100%),
    /* leichtes Durchhängen links und am unteren Rand */
    radial-gradient(ellipse 32% 42% at 16% 90%, rgba(55,55,50,.07), transparent 100%),
    linear-gradient(180deg, rgba(255,255,255,.5), transparent 32%);
}
body:not(.admin)::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .4 0 0 0 0 .4 .3 0 0 0 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* weiße Flächen weg, Produktbilder liegen „gedruckt“ auf dem Papier */
.nav-arrow { background: transparent; }
.shop .stage img, .cline img, .pop-line img { mix-blend-mode: multiply; }

/* Footer: auf schmalen Handys kurze Begriffe, damit die Zeile nicht umbricht */
@media (max-width: 760px) {
  .legal .lg { display: none; }
  .shop .legal, .legal { column-gap: 9px; letter-spacing: .04em; }
}
