/* Öle-Welt Katalog. Farben als Tokens, helles und dunkles Farbschema, Systemschriften (keine externen Schriftdienste). */
:root {
    --bg: #f7f9f8; --surface: #ffffff; --fg: #17231f; --muted: #5b6b65; --line: #dfe6e3; --chrome: #e9eeec;
    --accent: #2f6b58; --accent-fg: #ffffff; --accent-soft: #e3efe9;
    --buy: #2c6ecb; --buy-hover: #245cae; --buy-fg: #ffffff; --buy-soft: #e1ecf7;
    --ok: #2e7d32; --ok-soft: #e3f2e4; --warn: #b26a00; --warn-soft: #fdf0db; --bad: #b3261e; --bad-soft: #fbe4e2;
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
    --radius: 8px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111715; --surface: #18201d; --fg: #e4ece8; --muted: #9aaba4; --line: #2b3632; --chrome: #222c28;
        --accent: #7cc4a8; --accent-fg: #0f1a16; --accent-soft: #1f3a31;
        --buy: #3a7de0; --buy-hover: #2c6ecb; --buy-fg: #ffffff; --buy-soft: #1c2b40;
        --ok: #81c995; --ok-soft: #1d3322; --warn: #f0b35a; --warn-soft: #3a2c14; --bad: #f28b82; --bad-soft: #3d1f1c;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.no-js .needs-js { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { line-height: 1.2; text-wrap: balance; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-block: 24px 64px; min-height: 60vh; }

/* Kopf und Fuß */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; padding-block: 14px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.brand span { font-weight: 400; color: var(--muted); }
.note, .small { font-size: .85rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; padding-block: 20px; }
.site-footer nav { display: flex; gap: 16px; }

/* Katalog */
.catalog-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.catalog-head h1 { font-size: 1.7rem; margin: 0; }
.count { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.toolbar-end { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-left: auto; }
.toolbar .search { flex: 1 1 220px; }
input[type="search"], input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], input[type="number"], select, textarea {
    width: 100%; min-width: 0; font: inherit; font-size: .95rem; color: var(--fg); background: var(--bg);
    border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
}
textarea { resize: vertical; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--fg); padding: 7px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--buy); color: var(--buy-fg); }
.range { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.range output { font-family: var(--mono); color: var(--fg); min-width: 1ch; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--accent); box-shadow: 0 6px 18px -12px rgba(0,0,0,.35); }
.card a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card .ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: #fff; }
.card .ph img { width: 88%; height: 88%; object-fit: contain; }
.card .bd { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; flex: 1; }
.card .nm { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.card .ft { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px; margin-top: auto; }
.prices { display: flex; flex-direction: column; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.was { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.expiry-note { font-size: .78rem; color: var(--muted); margin: 4px 0 0; }
.grid.dicht .card .nm { font-size: .8rem; }
.grid.dicht .card .bd { padding: 8px; }

.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.low { background: var(--warn-soft); color: var(--warn); }
.pill.out { background: var(--bad-soft); color: var(--bad); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.list { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .92rem; }
table.list th, table.list td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list th { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
table.list td a { color: var(--fg); font-weight: 600; text-decoration: none; }
table.list td a:hover { color: var(--accent); text-decoration: underline; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list td.was { text-decoration: line-through; font-size: inherit; }
.thumb { width: 48px; height: 48px; max-width: none; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; display: block; }
table.list td:first-child { width: 72px; }

.empty-filter { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-filter p { margin: 0 0 8px; }

/* Buttons und Hinweise */
.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); border-radius: 6px; padding: 8px 16px; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.lg { padding: 11px 22px; font-size: 1rem; }
/* Kauf-/Reservierungsknopf im Blau des Shops */
.btn.buy { background: var(--buy); border-color: var(--buy); color: var(--buy-fg); border-radius: 8px; }
.btn.buy:hover { background: var(--buy-hover); border-color: var(--buy-hover); filter: none; }
.notice { border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; font-size: .92rem; border: 1px solid; }
.notice.ok { background: var(--ok-soft); border-color: var(--ok); }
.notice.bad { background: var(--bad-soft); border-color: var(--bad); }
.notice ul { margin: 6px 0 0; padding-left: 1.2em; }

/* Produktseite */
.back { margin: 0 0 16px; font-size: .92rem; }
.back a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--buy); border-radius: 6px; background: var(--surface); color: var(--buy); font-weight: 600; text-decoration: none; }
.back a:hover { background: var(--buy); color: var(--buy-fg); }
.product { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.gallery-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-main { position: relative; }
.gallery-main img { width: 94%; height: 94%; object-fit: contain; cursor: zoom-in; }
/* Bildwechsel: altes Bild bleibt stehen, bis das neue fertig ist; dauert es länger, ein kleiner Ladekreis */
.gallery-main.laedt::after { content: ""; position: absolute; left: 14px; bottom: 14px; width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.zoom-knopf { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .92); font-size: 1.1rem; cursor: zoom-in; }

/* Großansicht der Produktbilder */
dialog.zoom { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(15, 20, 18, .92); }
dialog.zoom::backdrop { background: rgba(15, 20, 18, .92); }
dialog.zoom[open] { display: flex; align-items: center; justify-content: center; }
dialog.zoom img { position: absolute; inset: 0; margin: auto; width: min(94vw, 88vh, 1200px); height: min(94vw, 88vh, 1200px); max-width: none; object-fit: contain; background: #fff; border-radius: 6px; }
.zoom-zu, .zoom-pfeil { position: absolute; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; transition: background .15s; }
.zoom-zu:hover, .zoom-pfeil:hover { background: rgba(255, 255, 255, .28); }
.zoom-zu:focus { outline: none; }
.zoom-zu:focus-visible, .zoom-pfeil:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
dialog.zoom:focus { outline: none; }
.zoom-zu { top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; }
.zoom-pfeil { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.zoom-pfeil.zurueck { left: 14px; }
.zoom-pfeil.weiter { right: 14px; }
.zoom-zaehler { position: absolute; bottom: 22px; left: 0; right: 0; margin: 0; text-align: center; color: #fff; font-size: .9rem; }
@media (max-width: 760px) {
    /* Pfeile unter das Bild, damit sie keinen Text verdecken */
    .zoom-pfeil { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; }
    .zoom-pfeil.zurueck { left: calc(50% - 110px); }
    .zoom-pfeil.weiter { right: calc(50% - 110px); }
    .zoom-zaehler { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 14px); }
    dialog.zoom img { width: min(94vw, 76vh); height: min(94vw, 76vh); }
}
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gallery-thumbs button { padding: 0; border: 2px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; width: 64px; height: 64px; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.eyebrow { margin: 0 0 4px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.info h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 12px; }
.pricebox { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.bigprice { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pricebox .was { font-size: .95rem; }

.reserve { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.buyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stepper { display: inline-flex; align-items: center; height: 44px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff; overflow: hidden; }
.stepper button { width: 40px; height: 100%; border: 0; background: transparent; color: #1f2937; font-size: 1.2rem; cursor: pointer; }
.stepper button:hover { background: #f3f4f6; }
.stepper input { width: 44px; height: 100%; border: 0; border-radius: 0; background: transparent; color: #1f2937; text-align: center; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buyrow .btn.lg { height: 44px; padding-block: 0; }
.hint { font-size: .88rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 2px 10px; margin: 14px 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.js .reserve:not(.open) .fields { display: none; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.field span { letter-spacing: .02em; }
.full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; }
.check input { margin-top: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.description { margin-top: 40px; max-width: 75ch; }
.description h2 { font-size: 1.3rem; }
.prose h2, .prose h3, .prose h4 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 .9em; }
.prose table { border-collapse: collapse; margin: 1em 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 4px 8px; }

@media (max-width: 760px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #spaltenRegler { display: none; }
    .toolbar-end { margin-left: 0; }
    .product { grid-template-columns: 1fr; gap: 20px; }
    .gallery-main { max-width: 420px; }
    .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Impressum / Datenschutz */
.legal { max-width: 70ch; }
.legal h1 { font-size: 1.7rem; margin: 0 0 16px; }
.legal h2 { font-size: 1.1rem; margin: 1.6em 0 .4em; }

/* Kategorie-Auswahl: eigene Liste statt <select>, damit lange Namen vollständig lesbar bleiben */
.catpick { position: relative; flex: 1 1 240px; min-width: 0; }
.catpick-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; font: inherit; font-size: .95rem; text-align: left; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.catpick-toggle.gesetzt { border-color: var(--buy); background: var(--surface); }
.catpick-text { min-width: 0; overflow-wrap: anywhere; }
.catpick-toggle .caret { flex: none; color: var(--muted); }
.catpick-panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: max(100%, 320px); max-width: min(560px, calc(100vw - 32px)); max-height: min(60vh, 460px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.35); }
.catpick-panel button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: inherit; font-size: .92rem; line-height: 1.35; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.catpick-panel button:hover { background: var(--bg); }
.catpick-panel button[aria-selected="true"] { background: var(--buy-soft); color: var(--buy); font-weight: 600; }
@media (max-width: 760px) {
    .catpick { flex-basis: 100%; }
    .catpick-panel { position: static; width: 100%; max-width: none; margin-top: 6px; box-shadow: none; }
}

/* Kategorien auf der Produktseite als umbrechende Schilder */
.cat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.cat-tags li { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); line-height: 1.35; }

/* Inhaltsangabe und Grundpreis */
.content-note { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.content-line { margin: 2px 0 4px; font-size: .95rem; color: var(--muted); }
.nowrap { white-space: nowrap; }

.toolbar .sort { flex: 0 1 200px; }
@media (max-width: 760px) { .toolbar .sort { flex-basis: 100%; } }

/* Auswahl mehrerer Produkte für eine gemeinsame Reservierung */
.card { display: flex; flex-direction: column; }
.card a { flex: 1; height: auto; }
.pick { display: block; width: 100%; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--buy); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.pick:hover { background: var(--buy-soft); }
.pick[aria-pressed="true"] { background: var(--buy); color: var(--buy-fg); }
.pick.small { width: 34px; height: 34px; padding: 0; border: 1px solid var(--buy); border-radius: 6px; font-size: 1rem; }
.card.gewaehlt { border-color: var(--buy); box-shadow: 0 0 0 1px var(--buy); }
tr.gewaehlt td { background: var(--buy-soft); }
.grid.dicht .pick { font-size: .75rem; padding: 6px; }
.pickbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(0,0,0,.4); }
.pickbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-block: 10px; }
.pickbar-text { font-weight: 600; margin-right: auto; }
body.mit-leiste { padding-bottom: 76px; }
.picklist td .stepper { height: 38px; }
.picklist tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.linkbtn { border: 0; background: none; padding: 4px; color: var(--muted); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--bad); }
.reserve.multi { border-top: 0; margin-top: 0; padding-top: 0; }
.reserve.multi .fields { margin-top: 16px; }
@media (max-width: 760px) {
    .pickbar .wrap .btn { flex: 1 1 auto; text-align: center; }
    .pickbar-text { flex-basis: 100%; }
    body.mit-leiste { padding-bottom: 116px; }
}

/* Umschalter „Mit Bestand / Alle Produkte“ im Katalog */
.bestand-wahl button { white-space: nowrap; }
.bestand-wahl .cnt { font-size: .8rem; opacity: .85; }
@media (max-width: 760px) { .bestand-wahl { flex: 1 1 100%; } .bestand-wahl button { flex: 1; } }
