/* =============================================================================
   mbMarket – Basis-Stylesheet
   Layout: linksseitiges vertikales Hauptmenü, Kopfgrafik, seitenspezifische
   Dropdown-Menüs darunter. Dezenter 3D-Look. Responsive: Desktop / Tablet / Phone.
   Farben kommen aus den Theme-Dateien (assets/css/themes/*.css).
   Keine externen Schriften oder Ressourcen (DSGVO).
   ========================================================================== */

:root {
    --bg: #e8ecf1; --surface: #ffffff; --surface-2: #f4f6f9; --fg: #1d2532; --muted: #5d6879;
    --line: #c8d0db; --accent: #2f5d9e; --accent-fg: #ffffff; --accent-2: #e07b24;
    --ok: #1f7a3a; --bad: #b3261e; --warn-bg: #fff3cd; --warn-fg: #6b4e00;
    --btn-top: #ffffff; --btn-bottom: #dde3ea; --btn-border: #aeb8c5; --btn-fg: #1d2532;
    --side-bg: #2b3646; --side-fg: #e8edf3; --side-btn-top: #3b495d; --side-btn-bottom: #2e3a4b; --side-btn-border: #1d2633;
    --hero-overlay: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.05));
    --radius: 6px; --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 6px rgba(20,30,45,.10);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --side-w: 250px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); background: var(--bg); color: var(--fg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
small, .meta, .help { color: var(--muted); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-fg); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Grundgerüst --------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: var(--side-bg); color: var(--side-fg); position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; padding: 1rem .8rem; border-right: 1px solid var(--side-btn-border);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
.brand { padding: .3rem .4rem 1rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: .9rem; }
/* Logo / Foto im linken Menü: Anzeige 120 × 120 px (Upload-Empfehlung 400 × 400 px) */
.brand-logo { display: block; width: 120px; height: 120px; margin: .2rem auto 1rem; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo.small { width: 72px; height: 72px; margin-bottom: .7rem; }
.logo-round img, img.topbar-logo.logo-round { border-radius: 50%; border: 3px solid var(--accent-2); box-shadow: 0 0 0 3px var(--side-btn-border), 0 4px 10px rgba(0,0,0,.45); }
.logo-square img, img.topbar-logo.logo-square { border-radius: 14px; border: 3px solid var(--accent-2); box-shadow: 0 0 0 3px var(--side-btn-border), 0 4px 10px rgba(0,0,0,.45); }
.logo-plain img { object-fit: contain; }
.brand:has(.brand-logo) { text-align: center; }
.topbar-logo { display: inline-block; flex: none; width: 34px; height: 34px; object-fit: cover; margin-right: .55rem; border-width: 2px !important; box-shadow: none !important; }
.topbar-logo.logo-plain { object-fit: contain; }
.brand-title { color: var(--side-fg); text-decoration: none; font-weight: 700; font-size: 1.25rem; display: block; letter-spacing: .01em; }
.brand-sub { font-size: .8rem; opacity: .75; }
.main { display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2.5rem; max-width: 1280px; width: 100%; }
.content:focus { outline: none; }

/* ---------- 3D-Buttons (dezent) ---------------------------------------- */
.btn3d {
    display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; border-radius: var(--radius);
    font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
    color: var(--btn-fg); background: linear-gradient(var(--btn-top), var(--btn-bottom));
    border: 1px solid var(--btn-border); border-bottom-color: color-mix(in srgb, var(--btn-border) 70%, #000);
    box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 1px 2px rgba(0,0,0,.14);
    transition: filter .12s, transform .06s, box-shadow .12s;
}
.btn3d:hover { filter: brightness(1.04); }
.btn3d:active, .btn3d.active {
    transform: translateY(1px);
    background: linear-gradient(var(--btn-bottom), var(--btn-top));
    box-shadow: 0 1px 3px rgba(0,0,0,.22) inset;
}
.btn3d.small { padding: .3rem .6rem; font-size: .85rem; }
.btn3d.big { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn3d.primary { color: var(--accent-fg); background: linear-gradient(color-mix(in srgb, var(--accent) 78%, #fff), var(--accent)); border-color: color-mix(in srgb, var(--accent) 75%, #000); }
.btn3d.primary.active, .btn3d.primary:active { background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 80%, #fff)); }
.btn3d.danger { color: #fff; background: linear-gradient(#d65a50, #a8291f); border-color: #7a1c15; }
.btn3d.paypal { color: #fff; background: linear-gradient(#2c8ad8, #0b5ca8); border-color: #084a87; }
.btn3d[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hauptmenü links -------------------------------------------- */
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.mainnav .btn3d {
    width: 100%; justify-content: flex-start; color: var(--side-fg);
    background: linear-gradient(var(--side-btn-top), var(--side-btn-bottom)); border-color: var(--side-btn-border);
    box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 1px 2px rgba(0,0,0,.35);
}
.mainnav .btn3d.active { background: linear-gradient(var(--side-btn-bottom), var(--side-btn-top)); box-shadow: 0 2px 4px rgba(0,0,0,.45) inset; border-left: 4px solid var(--accent-2); }
.mainnav .is-sub .btn3d { margin-left: 1rem; width: calc(100% - 1rem); font-size: .88rem; padding: .35rem .8rem; }
.mainnav .ico { width: 1.3em; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; padding-top: 1rem; font-size: .85rem; }
.langs { display: flex; gap: .4rem; margin-bottom: .6rem; }
.side-foot .btn3d { color: var(--side-fg); background: linear-gradient(var(--side-btn-top), var(--side-btn-bottom)); border-color: var(--side-btn-border); }
.side-foot .btn3d.active { background: var(--accent); color: var(--accent-fg); }
.whoami { opacity: .85; }

/* ---------- Kopfgrafik --------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: #223; aspect-ratio: 5 / 1; max-height: 300px; min-height: 120px; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); }
.hero-text { position: absolute; left: clamp(1rem, 3vw, 2.5rem); bottom: 1.1rem; z-index: 1; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.5); display: flex; flex-direction: column; }
.hero-title { font-size: clamp(1.4rem, 3.5vw, 2.6rem); font-weight: 800; letter-spacing: .01em; }
.hero-sub { font-size: clamp(.85rem, 1.5vw, 1.1rem); opacity: .9; }

/* ---------- Seitenspezifische Dropdown-Menüs ----------------------------- */
.subnav {
    background: linear-gradient(var(--surface), var(--surface-2)); border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 4px rgba(0,0,0,.06); padding: .55rem clamp(1rem, 3vw, 2.5rem); position: sticky; top: 0; z-index: 20;
}
.subnav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.subnav li { position: relative; }
.dd-menu {
    list-style: none; margin: 0; padding: .35rem; position: absolute; left: 0; top: calc(100% + 4px); min-width: 220px; max-width: 90vw;
    max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 8px 22px rgba(0,0,0,.16); display: none; z-index: 30;
}
.dd-menu a { display: block; padding: .45rem .7rem; border-radius: 4px; text-decoration: none; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-menu a:hover, .dd-menu a:focus { background: var(--surface-2); }
.dd-menu a.active { background: var(--accent); color: var(--accent-fg); }
.dd.open > .dd-menu { display: block; }
@media (hover: hover) and (pointer: fine) {
    .dd:hover > .dd-menu, .dd:focus-within > .dd-menu { display: block; }
    .dd::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 6px; } /* Hover-Brücke */
}
.caret { font-size: .75em; opacity: .7; }

/* ---------- Mobile Topbar ------------------------------------------------ */
.topbar { display: none; }
.backdrop { display: none; }

/* ---------- Hinweise ------------------------------------------------------ */
.testmode { background: repeating-linear-gradient(45deg, var(--warn-bg), var(--warn-bg) 12px, color-mix(in srgb, var(--warn-bg) 85%, #e0b100) 12px, color-mix(in srgb, var(--warn-bg) 85%, #e0b100) 24px);
    color: var(--warn-fg); font-weight: 700; text-align: center; padding: .6rem 1rem; border-bottom: 1px solid #e0c36b; }
.testmode.inline { border: 1px solid #e0c36b; border-radius: var(--radius); margin-bottom: 1rem; }
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; border: 1px solid; }
.flash-ok { background: #e7f5ea; border-color: #a9d8b4; color: #164f27; }
.flash-error { background: #fde8e7; border-color: #f1b5b1; color: #7d1c16; }
.flash-info { background: #e7f0fb; border-color: #b5cdee; color: #1d3f6e; }
.notice { background: var(--warn-bg); color: var(--warn-fg); padding: .6rem .9rem; border-radius: var(--radius); border: 1px solid #e0c36b; }
.hint { background: var(--surface-2); border-left: 4px solid var(--accent); padding: .5rem .8rem; border-radius: 4px; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.empty { color: var(--muted); font-style: italic; }

/* ---------- Panels & Karten ---------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); padding: 1.3rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.4rem; }
.panel.inset { background: var(--surface-2); box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; margin-bottom: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 8px 18px rgba(0,0,0,.10); }
.card-img { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 3rem; background: linear-gradient(135deg, var(--surface-2), var(--bg)); }
.placeholder.big { aspect-ratio: 1; font-size: 6rem; border-radius: var(--radius); }
.card-body { padding: .9rem 1rem .4rem; flex: 1; }
.card-body h3 { margin: .3rem 0 .4rem; }
.card-body h3 a { color: var(--fg); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent); }
.card-body p { margin: 0; color: var(--muted); font-size: .92rem; }
.card-foot { padding: .6rem 1rem .8rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--line); font-size: .9rem; }
.tag { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.price { font-weight: 800; color: var(--fg); }
.price.big { font-size: 1.9rem; }
.ship { color: var(--muted); font-size: .85rem; }
.more { text-align: right; }
.lead { font-size: 1.1rem; color: var(--muted); }

.detail { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 2rem; align-items: start; }
.detail-media img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.buybox { margin: 1rem 0 1.4rem; }
.facts { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.facts li { padding: .15rem 0; }
.addcart { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; }
.addcart input[type=number] { width: 5rem; }
.donate { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.donate small { display: block; margin-top: .4rem; }
.price-note { font-size: .82rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.prose { max-width: 75ch; }
.prose img { border-radius: var(--radius); margin: 1rem 0; }
.prose pre, .prose code { font-family: var(--mono); background: var(--surface-2); border-radius: 4px; }
.prose pre { padding: .8rem 1rem; overflow-x: auto; border: 1px solid var(--line); }
.prose code { padding: .1rem .3rem; }
.prose blockquote { border-left: 4px solid var(--accent); margin: 1rem 0; padding: .3rem 1rem; color: var(--muted); background: var(--surface-2); }
.zoom.post-img { display: block; margin-bottom: 1.2rem; }
.zoom.post-img img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); }

/* ---------- Shop-Markup in Texten -------------------------------------- */
.shop-link { font-weight: 600; text-decoration-style: dotted; }
.shop-link::after { content: " 🛒"; font-size: .8em; }
.shop-embed { display: flex; gap: 1rem; align-items: stretch; margin: 1.2rem 0; padding: .8rem; max-width: 640px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow); }
.shop-embed.inline { display: inline-flex; vertical-align: top; margin: .4rem 0; }
.shop-embed .se-img { flex: none; width: 140px; align-self: flex-start; border-radius: var(--radius); overflow: hidden; }
.shop-embed .se-img img { width: 140px; height: 140px; object-fit: cover; margin: 0; border-radius: var(--radius); }
.shop-embed .se-ph { height: 140px; display: grid; place-items: center; font-size: 3rem; background: var(--surface); text-decoration: none; border: 1px solid var(--line); }
.shop-embed .zoom-hint { width: 1.7rem; height: 1.7rem; font-size: .8rem; right: .35rem; bottom: .35rem; }
.se-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.se-title { font-weight: 800; font-size: 1.08rem; color: var(--fg); text-decoration: none; }
.se-title:hover { color: var(--accent); }
.se-short { color: var(--muted); font-size: .92rem; }
.se-buy { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.se-buy .price { font-size: 1.15rem; margin-right: .3rem; }
.shop-btn { vertical-align: middle; }
mark.sc-missing { background: #fde8e7; color: #7d1c16; padding: .1rem .4rem; border-radius: 4px; font-size: .9em; }
@media (max-width: 520px) {
    .shop-embed { flex-direction: column; }
    .shop-embed .se-img, .shop-embed .se-img img { width: 100%; height: auto; max-height: 220px; }
}

/* ---------- Vergrößerbare Fotos + Lightbox ------------------------------ */
.zoom { position: relative; display: inline-block; cursor: zoom-in; max-width: 100%; }
.zoom img { display: block; }
.zoom-hint { position: absolute; right: .5rem; bottom: .5rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
    background: rgba(0,0,0,.55); color: #fff; font-size: 1rem; opacity: .85; transition: opacity .15s, transform .15s; pointer-events: none; }
.zoom:hover .zoom-hint, .zoom:focus-visible .zoom-hint { opacity: 1; transform: scale(1.08); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem 2rem;
    background: rgba(8,10,14,.88); animation: lb-in .15s ease-out; }
.lightbox[hidden] { display: none; }
.lightbox [hidden] { display: none !important; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: min(96vw, 1800px); max-height: calc(100vh - 7rem); object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #fff; }
.lightbox figcaption { color: #eef2f7; margin-top: .7rem; text-align: center; font-size: .95rem; }
.lightbox .lb-close { position: absolute; top: .8rem; right: .8rem; font-size: 1.2rem; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.4rem; }
.lightbox .lb-prev { left: .8rem; } .lightbox .lb-next { right: .8rem; }
body.lb-open { overflow: hidden; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pager { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0; }

.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.shop-head h1 { margin: 0; }
.search { display: flex; gap: .4rem; }
.search input { min-width: 220px; }

/* ---------- Formulare ----------------------------------------------------- */
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%; padding: .55rem .65rem; font: inherit; color: var(--fg); background: var(--surface);
    border: 1px solid var(--line); border-radius: 5px; box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
}
textarea { resize: vertical; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.field.check { display: flex; align-items: flex-start; gap: .55rem; }
.field.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.field.check label { font-weight: 400; margin: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.field-error { display: block; color: var(--bad); font-size: .85rem; margin-top: .2rem; }
.req { color: var(--bad); }
.radio { display: block; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .5rem; background: var(--surface-2); cursor: pointer; }
.radio small { display: block; margin-left: 1.6rem; }
.radio:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.grid-zip { display: grid; grid-template-columns: 8rem 1fr; gap: .8rem; }
.narrow { max-width: 520px; margin: 0 auto; }
.narrow-form { max-width: 640px; }
details.optional { margin: .5rem 0 1rem; }
details.optional summary { cursor: pointer; color: var(--accent); margin-bottom: .6rem; }
.danger-zone { border-color: #e7b1ad; }

/* ---------- Tabellen ------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.num { text-align: right; white-space: nowrap; }
tfoot td { border-bottom: 0; }
tr.total td { font-weight: 800; font-size: 1.1rem; border-top: 2px solid var(--fg); }
input.qty { width: 5rem; }
.summary { list-style: none; padding: 0; margin: 0 0 1rem; }
.summary li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.summary li.total { font-weight: 800; border-bottom: 2px solid var(--fg); }
.downloads { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
dl.kv, .bank dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; word-break: break-word; }
.status { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.s-pending { background: #fff3cd; color: #6b4e00; border-color: #e7cf86; }
.s-paid, .s-completed { background: #e7f5ea; color: #164f27; border-color: #a9d8b4; }
.s-shipped { background: #e7f0fb; color: #1d3f6e; border-color: #b5cdee; }
.s-cancelled { background: #fde8e7; color: #7d1c16; border-color: #f1b5b1; }
.s-test { background: #efe7fb; color: #4b2a7d; border-color: #c9b5ee; }

/* ---------- Footer -------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); background: var(--surface-2); padding: 1.2rem clamp(1rem, 3vw, 2.5rem); font-size: .88rem; color: var(--muted); }
.footlinks { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: .4rem; }
.footer p { margin: .3rem 0; }

body.plain { padding: 2rem 1rem; }

/* =============================================================================
   Geräteoptimierung
   Desktop  > 1024 px  : volle Seitenleiste
   Tablet   761–1024 px: kompakte Seitenleiste, 2 Spalten
   Phone    ≤ 760 px   : ausklappbares Menü (Off-Canvas), einspaltig
   ========================================================================== */
@media (max-width: 1024px) {
    :root { --side-w: 205px; }
    .brand-logo { width: 104px; height: 104px; }
    .mainnav .btn3d { font-size: .9rem; padding: .45rem .7rem; }
    .detail { grid-template-columns: minmax(180px, 280px) 1fr; gap: 1.4rem; }
    .grid2 { grid-template-columns: 1fr; }
    .cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 760px) {
    .app { display: block; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: min(82vw, 300px); z-index: 60; height: 100%;
        transform: translateX(-105%); transition: transform .22s ease; box-shadow: 4px 0 18px rgba(0,0,0,.35);
    }
    body.menu-open .sidebar { transform: none; }
    body.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
    body.menu-open { overflow: hidden; }
    .topbar {
        display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; position: sticky; top: 0; z-index: 40;
        background: var(--side-bg); color: var(--side-fg); box-shadow: 0 2px 6px rgba(0,0,0,.25);
    }
    .topbar .btn3d { color: var(--side-fg); background: linear-gradient(var(--side-btn-top), var(--side-btn-bottom)); border-color: var(--side-btn-border); }
    .topbar-title { color: var(--side-fg); text-decoration: none; font-weight: 700; flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
    .cart-mini { position: relative; }
    .badge { position: absolute; top: -6px; right: -6px; background: var(--accent-2); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .35rem; min-width: 1.2rem; text-align: center; }
    .hero { aspect-ratio: 3 / 1; }
    .hero-text { bottom: .6rem; }
    .subnav { top: 52px; padding: .45rem .6rem; }
    .subnav > ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
    .subnav > ul::-webkit-scrollbar { display: none; }
    .subnav .btn3d { font-size: .85rem; padding: .4rem .7rem; }
    .subnav li { position: static; }
    .dd-menu { position: fixed; left: .6rem; right: .6rem; top: auto; min-width: 0; max-width: none; }
    .content { padding: 1rem .9rem 2rem; }
    .panel { padding: 1rem; }
    .detail { grid-template-columns: 1fr; }
    .detail-media { max-width: 360px; }
    .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
    .card-body { padding: .7rem .75rem .3rem; }
    .card-foot { padding: .5rem .75rem .6rem; flex-wrap: wrap; }
    .search, .search input { width: 100%; min-width: 0; }
    .grid-zip { grid-template-columns: 6.5rem 1fr; }
    /* Tabellen als Karten */
    table.cart thead, table.list thead { display: none; }
    table.cart tr, table.list tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
    table.cart td, table.list td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .25rem .2rem; }
    table.cart td[data-label]::before, table.list td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
    table.cart tfoot td[colspan] { display: block; }
}

@media (max-width: 420px) {
    .cards { grid-template-columns: 1fr; }
    .btn3d.big { width: 100%; justify-content: center; }
}

@media print {
    .sidebar, .topbar, .subnav, .hero, .footer, .actions, .btn3d { display: none !important; }
    .app { display: block; }
    body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Bildschutz (Einstellung „Kopierschutz für Produktfotos“) -------- */
.img-protect .zoom img, .img-protect .card-img img, .img-protect .shop-embed img, .img-protect .lightbox img, .img-protect .detail-media img {
    -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.img-protect .zoom, .img-protect .card-img, .img-protect .lightbox figure { -webkit-touch-callout: none; }
.img-protect .lightbox figure { position: relative; }
.img-protect .lightbox figure::after { content: ""; position: absolute; inset: 0 0 2rem 0; }   /* Schutzschicht über dem Bild */
@media print { .img-protect .zoom img, .img-protect .card-img img, .img-protect .shop-embed img { visibility: hidden; } }

.manual-done p { margin: .4rem 0; }
code.key { font-family: var(--mono); background: var(--surface); border: 1px solid var(--line); padding: .15rem .45rem; border-radius: 4px; user-select: all; }

.title-ico { font-size: .9em; margin-right: .15rem; }

.narrow-wide { max-width: 760px; }
.contact-form .prose { margin-bottom: 1rem; }
p.ask { margin-top: 1.4rem; }

/* ---- Bilder in Texten (Editor): Position und Größe ------------------------------------------ */
.prose::after { content: ""; display: table; clear: both; }
.prose h1, .prose h2 { clear: both; }
.prose figure.mb-img { margin: .35rem 0 1rem; max-width: 100%; }
.prose figure.mb-img img { display: block; width: 100%; height: auto; margin: 0; }
.prose figure.mb-img figcaption { font-size: .85rem; color: var(--muted); margin-top: .35rem; line-height: 1.35; }
.prose figure.mb-left { float: left; margin-right: 1.3rem; }
.prose figure.mb-right { float: right; margin-left: 1.3rem; }
.prose figure.mb-center { margin-left: auto; margin-right: auto; clear: both; }
.prose figure.mb-full { width: 100%; clear: both; }
.prose figure.mb-w25 { width: 25%; } .prose figure.mb-w40 { width: 40%; } .prose figure.mb-w60 { width: 60%; } .prose figure.mb-w100 { width: 100%; }
.prose figure.mb-left.mb-w100, .prose figure.mb-right.mb-w100 { float: none; margin-left: 0; margin-right: 0; }
@media (max-width: 640px) {
    .prose figure.mb-left, .prose figure.mb-right { float: none; margin-left: auto; margin-right: auto; }
    .prose figure.mb-w25, .prose figure.mb-w40 { width: 70%; } .prose figure.mb-w60 { width: 100%; }
}
.prose u { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; clear: both; }

/* Vorschau ungespeicherter Änderungen */
.preview-bar { position: sticky; top: 0; z-index: 40; margin: 0 0 1rem; padding: .6rem 1rem; border-radius: var(--radius);
    background: repeating-linear-gradient(-45deg, #fff4d6, #fff4d6 12px, #ffecbd 12px, #ffecbd 24px); color: #5b4100;
    border: 1px solid #e4c26a; box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: .92rem; }

/* Werbe-/Partnerlinks in der Fußzeile */
.footer-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .7rem 0 .4rem; }
.footer-badges.fb-left { justify-content: flex-start; } .footer-badges.fb-center { justify-content: center; } .footer-badges.fb-right { justify-content: flex-end; }
.fb-label { flex-basis: 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fb-center .fb-label { text-align: center; } .fb-right .fb-label { text-align: right; }
.fb-item { line-height: 0; font-size: .85rem; }
.fb-item a { display: inline-block; line-height: 1.3; }
.fb-item img { display: block; max-width: 100%; max-height: 90px; width: auto; height: auto; border-radius: 3px; }
.fb-item a:hover img { opacity: .85; }

/* Kasse: Angaben für Geschäftskunden */
.business-fields { border-left: 3px solid var(--accent); padding: .2rem 0 .1rem .9rem; margin: -.2rem 0 1rem; }
.business-fields[hidden] { display: none; }
.grid2.tight { gap: 0 1rem; }
.summary li.vat { font-size: .88rem; color: var(--muted); border-top: 0; }

/* Preis frei wählbar (2.1) */
.pwyw-hint { margin: .3rem 0 .8rem; font-size: .92rem; opacity: .85; }
.pwyw-in { display: inline-flex; align-items: center; gap: .4rem; margin: 0 .6rem .6rem 0; font-weight: 600; }
.pwyw-in input { width: 6.5em; text-align: right; }
td .pwyw-in { margin: 0; font-weight: normal; }
td .pwyw-in + small { display: block; opacity: .75; }
.price.big.pwyw-title { font-size: 1.3rem; line-height: 1.3; }

/* Privatverkauf (2.2) */
.private-box { margin: .8rem 0; padding: .7rem .85rem; border-left: 4px solid #b8860b; border-radius: var(--radius, 4px);
    background: color-mix(in srgb, #f3e3b5 45%, var(--surface, #fff)); font-size: .92rem; }
.private-box p { margin: .4rem 0 0; font-size: .82rem; line-height: 1.45; opacity: .9; }
.private-note { border-left: 4px solid #b8860b; }
.private-terms { margin: .6rem 0; padding: .6rem .75rem; max-height: 14rem; overflow: auto; font-size: .82rem; line-height: 1.45;
    border: 1px solid var(--line, #ccd); border-radius: var(--radius, 4px); background: color-mix(in srgb, #f3e3b5 35%, var(--surface, #fff)); }
.tag.private-tag { background: color-mix(in srgb, #e6c76a 55%, var(--surface, #fff)); color: #5a4300; }

/* Aktionscodes (2.3) */
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.promo-in { display: flex; gap: .35rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.promo-in input { width: 11em; text-transform: uppercase; font-size: .88rem; padding: .3rem .45rem; }
.promo-applied { margin-top: .35rem; font-size: .88rem; color: var(--ok, #1d7a3a); }
.linkish { background: none; border: 0; padding: 0 0 0 .4rem; color: var(--accent, #2f5d9e); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }
s.list-price { opacity: .6; font-size: .9em; }
.summary .promo-note, .promo-note { display: block; font-size: .82rem; color: var(--ok, #1d7a3a); }
.promo-hint { font-size: .88rem; margin: .5rem 0 0; color: var(--ok, #1d7a3a); }
