/* PC-Oberfläche: Shop-Layout mit Kopfzeile, Filterleiste, Produktkarten, Listen-Seitenleiste */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
/* .row.wrap ist ein Flex-Umbruch-Helfer, kein Seiten-Container: Innenabstand und Breite nicht erben */
.row.wrap { max-width: none; margin: 0; padding: 0; }

/* Kopfzeile */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.hdr-in { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.logo-txt { font-weight: 750; font-size: 17px; line-height: 1.1; display: grid; }
.logo-txt small { font-weight: 500; font-size: 12px; color: var(--muted); }
.hdr-search { flex: 1 1 auto; max-width: 640px; }
.hdr-search .field { height: 44px; }
.hdr-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hdr-status { font-weight: 500; color: var(--ink-2); max-width: 260px; }
.hdr-list { position: relative; height: 44px; padding: 0 18px; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--accent); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav a { padding: 12px 14px; text-decoration: none; color: var(--ink-2); font-weight: 550; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding: 28px 24px 80px; outline: none; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h h1 { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.page-h p { margin: 6px 0 0; color: var(--ink-2); }
.page-h > * { min-width: 0; max-width: 100%; }
.sec { margin-top: 36px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 16px; }
.sec-h h2 { font-size: 20px; font-weight: 700; min-width: 0; }
.sec-h > span, .sec-h > .muted { min-width: 0; }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 20px; }
.card + .card { margin-top: 16px; }

/* Kennzahlen oben */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-1); display: grid; gap: 4px; text-decoration: none; transition: box-shadow .2s, transform .2s; cursor: pointer; border: 0; text-align: left; }
.kpi:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.kpi .s { font-size: 13px; color: var(--ink-2); }
.kpi.hero { background: var(--accent); color: #fff; }
.kpi.hero .l, .kpi.hero .s { color: rgba(255, 255, 255, .85); }

/* Produktkarten */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 16px; }
.pcard { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); display: flex; flex-direction: column; overflow: hidden; cursor: pointer; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.pcard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.pcard .pimg { position: relative; aspect-ratio: 1 / 1; flex: none; background: #fff; display: grid; place-items: center; overflow: hidden; }
.pcard .pimg img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; }
.pcard .pimg .ph { color: #c9c9c9; }
.pcard .disc { position: absolute; left: 10px; top: 10px; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 8px; }
.pcard .disc { white-space: nowrap; line-height: 1.4; }
.pcard .mine { position: absolute; right: 10px; top: 10px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; line-height: 1.4; max-width: calc(100% - 84px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pbody { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.pcard .pbrand { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pbrand button { all: unset; cursor: pointer; }
.pcard .pbrand button:hover { color: var(--ink); text-decoration: underline; }
.pcard .pname { font-weight: 600; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pcard .psize { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pprice { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin-top: 4px; white-space: nowrap; }
.pcard .pprice b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pcard .pprice s { color: var(--muted); font-size: 13px; }
.pcard .pnote { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pvalid { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; }
.pcard .pbadges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pcard .pbadges .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pcard .padd { position: absolute; right: 12px; bottom: 12px; }
.pcard .padd .btn.icon { width: 40px; height: 40px; box-shadow: var(--shadow-2); }
.pcard .pbody { padding-bottom: 64px; }
.pcard.off { opacity: .55; }
.pcard.off .pimg img { filter: grayscale(1); }
.pcard.off:hover { opacity: .8; }

/* Seiten mit Filterleiste */
.shop { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 132px; max-height: calc(100vh - 150px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.side h3:first-child { margin-top: 0; }
.seg { display: grid; gap: 2px; }
.seg button { all: unset; box-sizing: border-box; padding: 8px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-2); }
.seg button:hover { background: var(--surface-3); color: var(--ink); }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--surface); font-weight: 600; }
.catlist { display: grid; gap: 1px; }
.cat { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.cat:hover { background: var(--surface-3); color: var(--ink); }
.cat .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; background: var(--surface); }
.cat.inc .box { background: var(--good); border-color: var(--good); color: #fff; }
.cat.exc .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat.exc .t { text-decoration: line-through; color: var(--muted); }
.cat .t { flex: 1; min-width: 0; }
.cat .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .count { font-weight: 650; }
.toolbar select.field { width: auto; height: 38px; border-radius: 999px; }
.activechips { display: flex; gap: 6px; flex-wrap: wrap; }

/* Scrim, Seitenleiste, Modal */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 14, .38); z-index: 80; opacity: 0; transition: opacity .25s var(--ease); }
.scrim.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface); z-index: 90; box-shadow: var(--shadow-3); transform: translateX(105%); transition: transform .3s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.drawer-h h2 { font-size: 20px; }
.drawer-b { flex: 1; overflow: auto; padding: 0 20px 20px; }
.drawer-f { padding: 14px 20px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; background: var(--surface); }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 17px; }
.sum small { font-weight: 500; color: var(--muted); font-size: 12px; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(10, 10, 14, .42); animation: fade .2s var(--ease); }
.modal-card { background: var(--surface); border-radius: 22px; width: min(1000px, 100%); max-height: calc(100vh - 48px); overflow: auto; box-shadow: var(--shadow-3); animation: pop .25s var(--ease); position: relative; }
.modal-card.narrow { width: min(480px, 100%); }
.modal-x { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 3; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Produkt-Detail */
.pd-top { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; padding: 28px; }
.pd-img { position: relative; aspect-ratio: 1; background: #fff; border-radius: var(--r-lg); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; align-self: start; }
.pd-img img { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); object-fit: contain; }
.pd-info { display: grid; gap: 8px; align-content: start; }
.pd-info h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.pd-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pd-price b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.pd-price s { color: var(--muted); font-size: 16px; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pd-body { padding: 0 28px 28px; display: grid; gap: 28px; }
.pd-body h3 { font-size: 17px; margin-bottom: 12px; }
.regbox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); }
.regbox .v { font-size: 22px; font-weight: 750; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Einkaufsliste */
.addbar { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-3); z-index: 5; max-height: 360px; overflow: auto; padding: 6px; }
.sg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.sg[aria-selected=true], .sg:hover { background: var(--surface-3); }
.sg img, .sg .ph { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.sg .ph { display: grid; place-items: center; color: var(--muted); background: var(--surface-3); }
.sg .t { flex: 1; min-width: 0; }
.sg .p { font-weight: 700; font-size: 14px; }
.lgroup h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 4px; }
.lrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.cbx { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; transition: background .15s, border-color .15s, transform .1s; padding: 0; }
.cbx:active { transform: scale(.9); }
.lrow.done .cbx { background: var(--good); border-color: var(--good); color: #fff; }
.lrow .lt { font-weight: 600; cursor: pointer; }
.lrow.done .lt { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.lrow .lo { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.lrow .lo .deal { color: var(--good); font-weight: 650; }
.lrow .lo button.link { all: unset; cursor: pointer; color: var(--info); font-weight: 550; }
.lrow .lo button.link:hover { text-decoration: underline; }
.lrow .lr { display: flex; align-items: center; gap: 6px; }
.lrow .price { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.editor { display: grid; gap: 10px; padding: 12px; margin: 6px 0 4px; background: var(--surface-2); border-radius: var(--r); grid-column: 1 / -1; }
.candlist { display: grid; gap: 4px; max-height: 280px; overflow: auto; }
.cand { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; background: var(--surface); }
.cand:hover { border-color: var(--line-strong); }
.cand.on { border-color: var(--good); background: var(--good-bg); }
.cand img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 8px; }

/* Formular-Raster */
.fgrid { display: grid; grid-template-columns: 2fr 1.5fr 1fr .8fr 1.2fr auto; gap: 12px; align-items: end; }
.fgrid .actions { display: flex; gap: 8px; align-items: center; }
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.leafs { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; }
.leaf { all: unset; box-sizing: border-box; flex: none; width: 160px; border-radius: var(--r); padding: 8px; background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer; border: 2px solid transparent; }
.leaf[aria-pressed=true] { border-color: var(--accent); }
.leaf img { width: 100%; height: 190px; object-fit: contain; background: #fff; border-radius: 8px; }
.leaf b { display: block; font-size: 13px; margin-top: 8px; }
.leaf span { font-size: 12px; color: var(--muted); }
.pdfbar { position: sticky; top: 118px; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 0; background: var(--bg); }
.radar-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.radar-row img, .radar-row .ph { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 10px; }
.radar-row:hover .grow b { text-decoration: underline; }

.hdr-status .ellipsis { min-width: 0; }
.pd-body .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1000px) { .pd-body .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .pd-top { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 24px; }
  .pd-body { padding: 0 24px 24px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 1024px) {
  .hdr-in { gap: 12px; }
  .hdr-status { width: 38px; padding: 0; overflow: hidden; }
  .hdr-status .ellipsis { display: none; }
}
@media (max-width: 720px) {
  .shop { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; padding-right: 0; }
  .side .catlist { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-height: 260px; overflow: auto; }
  .pd-top { grid-template-columns: 1fr; padding: 20px; }
  .pd-img { max-width: 280px; }
  .pd-body { padding: 0 20px 20px; }
  .pd-body .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px; }
  main { padding: 18px 14px 60px; }
  .hdr-in { gap: 10px; height: auto; padding: 10px 0; flex-wrap: wrap; }
  .hdr-search { order: 3; flex-basis: 100%; max-width: none; }
  .hdr-list span:not(.badge) { display: none; }
  .hdr-status { display: none; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media print {
  .hdr, main, .scrim, .modal, .drawer-f, .noprint { display: none !important; }
  .drawer { position: static; transform: none; box-shadow: none; width: auto; }
  body { background: #fff; }
}
