/* Grundlayout. Farben, Schriften und Formen kommen aus /theme/theme.css. */
:root {
  --bg: #fff; --surface: #f6f6f6; --text: #111; --muted: #666; --line: #e5e5e5;
  --accent: #111; --accent-text: #fff; --deal: #c33; --deal-text: #fff;
  --radius: 8px; --gap: 24px; --max: 1200px;
  --font: system-ui, sans-serif; --font-head: var(--font);
  --card-ratio: 1 / 1; --cols: 3;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: 100%; }
[hidden] { display: none !important; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 16px; max-width: var(--max); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { height: 40px; width: auto; }
.shop-name { font-family: var(--font-head); font-size: 1.6rem; text-decoration: none; }
.tagline { color: var(--muted); font-size: .9rem; }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { text-decoration: none; }
.cart-btn { background: var(--accent); color: var(--accent-text); border: 0; border-radius: var(--radius); padding: 10px 16px; display: inline-flex; gap: 8px; align-items: center; }
.badge { background: var(--accent-text); color: var(--accent); border-radius: 99px; min-width: 22px; padding: 0 6px; font-size: .8rem; text-align: center; }

main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 6px 14px; }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: var(--card-ratio); background: var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.noimg { width: 100%; height: 100%; background: var(--line); display: block; }
.has-video { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; }
.deals { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.deal { display: inline-block; background: var(--deal); color: var(--deal-text); font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: calc(var(--radius) / 2); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-cat { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.card-title { font-size: 1.1rem; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; }
.price.big { font-size: 1.6rem; margin: 8px 0; }
.soldout { opacity: .55; }
.out { color: var(--muted); font-size: .9rem; }
.btn { border: 1px solid var(--accent); background: transparent; color: var(--text); border-radius: var(--radius); padding: 8px 14px; }
.btn.primary, .btn.add:hover { background: var(--accent); color: var(--accent-text); }
.btn.wide { width: 100%; padding: 14px; }
.empty { color: var(--muted); }
.error { color: var(--deal); }

/* Stories */
.stories { display: flex; gap: 16px; overflow-x: auto; max-width: var(--max); margin: 0 auto; padding: 8px 16px 16px; scrollbar-width: none; }
.story { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; flex: 0 0 auto; padding: 0; }
.ring { width: 72px; height: 72px; border-radius: 50%; padding: 3px; background: var(--story-ring, linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7)); display: block; }
.ring img, .ring video { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid var(--bg); }
.story-cap { font-size: .72rem; max-width: 76px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.story-viewer { padding: 0; border: 0; background: #000; color: #fff; width: min(420px, 100vw); height: min(760px, 100dvh); max-height: 100dvh; border-radius: var(--radius); overflow: hidden; }
.story-viewer::backdrop { background: rgba(0,0,0,.85); }
#storyBody { position: relative; width: 100%; height: 100%; }
#storyBody > img, #storyBody > video { width: 100%; height: 100%; object-fit: contain; }
.story-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.story-bars span { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; }
.story-bars .done, .story-bars .now { background: #fff; }
.story-text { position: absolute; left: 16px; right: 16px; bottom: 80px; font-size: 1.1rem; text-shadow: 0 1px 6px rgba(0,0,0,.7); z-index: 2; }
.story-link { position: absolute; left: 16px; right: 16px; bottom: 20px; z-index: 3; }
.story-nav { position: absolute; top: 0; bottom: 0; width: 35%; background: none; border: 0; z-index: 1; }
.story-nav.prev { left: 0; } .story-nav.next { right: 0; }
#storyBody .close { position: absolute; top: 20px; right: 10px; z-index: 4; color: #fff; }

/* News */
.news-list { display: grid; gap: var(--gap); }
.news-item { display: grid; grid-template-columns: 200px 1fr; gap: 20px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.news-item img { width: 100%; height: 100%; object-fit: cover; max-height: 220px; }
.news-item > div { padding: 16px 16px 16px 0; }
.news-item:not(:has(img)) { grid-template-columns: 1fr; } .news-item:not(:has(img)) > div { padding: 16px; }
.news-item time { color: var(--muted); font-size: .8rem; }
.news-item h3 { margin: 4px 0 8px; }

.site-footer { max-width: var(--max); margin: 64px auto 0; padding: 32px 16px; border-top: 1px solid var(--line); color: var(--muted); display: grid; gap: 8px; font-size: .9rem; }
.foot-name { font-family: var(--font-head); color: var(--text); font-size: 1.2rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* Produktdetail */
.modal { border: 0; padding: 0; border-radius: var(--radius); background: var(--bg); color: var(--text); width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.modal::backdrop { background: rgba(0,0,0,.55); }
.icon-btn { background: none; border: 0; font-size: 1.8rem; line-height: 1; padding: 4px 10px; }
.modal .close { position: absolute; right: 8px; top: 8px; z-index: 2; }
.pd { display: grid; grid-template-columns: 1fr 1fr; }
.pd-media { background: var(--surface); display: grid; gap: 2px; align-content: start; }
.pd-media img, .pd-media video { width: 100%; }
.pd-info { padding: 32px; display: flex; flex-direction: column; gap: 8px; }
.desc { color: var(--muted); }
.offer { border: 1px dashed var(--deal); border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; }
.offer ul, .offer p { margin: 4px 0 0; padding-left: 18px; } .offer p { padding: 0; }
.qty-row { display: flex; gap: 8px; margin-top: 8px; }
.qty-row input { width: 80px; }
.qty-row .btn { flex: 1; }
.stock { font-size: .85rem; color: var(--muted); }

/* Warenkorb */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--bg); color: var(--text); z-index: 20; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(0,0,0,.15); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px 20px 32px; overflow-y: auto; flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 19; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cart-lines li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: start; }
.cart-lines img, .cart-lines .noimg { width: 56px; height: 56px; object-fit: cover; border-radius: calc(var(--radius) / 2); }
.cl-name { font-weight: 600; }
.cl-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cl-total { text-align: right; font-weight: 600; display: grid; } .cl-total s { color: var(--muted); font-weight: 400; font-size: .8rem; }
.stepper { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); }
.stepper button { background: none; border: 0; width: 30px; height: 28px; }
.delivery { border: 1px solid var(--line); border-radius: var(--radius); margin: 20px 0; padding: 10px 14px; display: grid; gap: 8px; }
.delivery label { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; }
.delivery input { width: auto; }
.delivery small { grid-column: 2; color: var(--muted); }
.sums { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 20px; }
.sums dd { margin: 0; text-align: right; }
.sums .minus { color: var(--deal); }
.sums .total { font-weight: 700; font-size: 1.15rem; padding-top: 8px; border-top: 1px solid var(--line); }
.checkout { display: grid; gap: 8px; }
.checkout .row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.thanks { text-align: center; padding: 40px 0; }

@media (max-width: 900px) { :root { --cols: 2; --gap: 14px; } .pd { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .site-header { flex-wrap: wrap; }
  .main-nav { gap: 14px; width: 100%; justify-content: space-between; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .news-item { grid-template-columns: 1fr; } .news-item > div { padding: 0 16px 16px; }
  .pd-info { padding: 20px; }
}

/* Krypto-Kasse */
.coins { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 16px; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.coins legend { padding: 0 4px; }
.coin { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: grid; cursor: pointer; }
.coin input { position: absolute; opacity: 0; pointer-events: none; }
.coin small { color: var(--muted); font-size: .72rem; }
.coin.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.pay-box { display: grid; gap: 10px; text-align: left; border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.qr { width: 200px; height: 200px; justify-self: center; image-rendering: pixelated; background: #fff; padding: 6px; }
.pay-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.pay-row small { grid-column: 1 / -1; color: var(--muted); }
.pay-row code { font-size: .9rem; word-break: break-all; }
.copy { background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; font-size: .75rem; }
.order-status { display: inline-block; border: 1px solid var(--accent); color: var(--accent); padding: 4px 12px; margin: 8px 0 12px; border-radius: var(--radius); }
.order-status.storniert { color: var(--deal); border-color: var(--deal); }
.thanks .muted { color: var(--muted); font-size: .85rem; }
.warn { color: var(--deal); font-size: .85rem; }
.ok { color: var(--accent); }
#cgBox { margin: 4px 0; }

/* Zugangs-Captcha */
body.locked > :not(.gate):not(script) { display: none !important; }
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: var(--bg); z-index: 200; }
body:not(.locked) .gate { display: none; }
.gate-box { width: min(400px, 100%); display: grid; gap: 16px; }
.gate-title { font-family: var(--font-head); font-size: 2rem; text-align: center; color: var(--accent); }

/* Staffelpreise */
.tiers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: .88rem; }
.tiers li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); padding: 2px 0; }
.tiers li span { color: var(--muted); }
.tiers b { color: var(--accent); }
.tiers.big { font-size: 1.05rem; margin: 10px 0; }
.price.big { font-size: 1.6rem; margin: 8px 0; }
.deal-price { color: var(--accent); }
.cl-meta s { color: var(--muted); }

/* Abholung, QR, Tickets */
.pickup-note { grid-column: 1 / -1; border: 1px solid var(--accent); padding: 8px 10px; font-size: .88rem; border-radius: var(--radius); margin-top: 4px; }
.thanks .pickup-note { margin: 12px 0; text-align: left; }
.qr-tabs { display: flex; gap: 6px; justify-content: center; }
.qr-tabs button { background: none; border: 1px solid var(--line); padding: 4px 10px; font-size: .75rem; border-radius: var(--radius); }
.qr-tabs button.on { border-color: var(--accent); color: var(--accent); }
.tx-label { font-size: .85rem; text-align: left; }
.ticket { display: grid; gap: 10px; }
.msgs { display: grid; gap: 8px; }
.msg { border: 1px solid var(--line); padding: 8px 10px; border-radius: var(--radius); max-width: 90%; }
.msg small { color: var(--muted); display: block; margin-bottom: 2px; }
.msg.me { justify-self: end; border-color: var(--accent); }
.card-foot { padding-top: 12px; }

/* Highlights, Rabatt, Kombi-Aktionen, Versandart */
.story-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; flex: 0 0 auto; }
.story.highlight .ring { background: var(--line); }
.story.highlight .story-cap { color: var(--text); }
.sale-badge { position: absolute; left: 10px; top: 10px; background: var(--deal); color: var(--deal-text); font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: calc(var(--radius) / 2); text-transform: uppercase; }
s.old { color: var(--muted); font-weight: 400; margin-right: 4px; }
.deals-title { margin: 0 0 12px; font-family: var(--font-head); font-size: 1.5rem; color: var(--deal); }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: var(--gap); margin-bottom: 28px; }
.deal-card { display: grid; grid-template-columns: 180px 1fr; gap: 16px; border: 1px solid var(--deal); background: var(--surface); padding: 14px; border-radius: var(--radius); }
.deal-imgs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; }
.deal-imgs img, .deal-imgs .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--radius) / 2); }
.deal-imgs .plus { color: var(--deal); font-weight: 700; font-size: 1.2rem; }
.deal-info { display: grid; gap: 6px; align-content: start; }
.deal-info h4 { margin: 0; font-family: var(--font-head); font-size: 1.15rem; }
.deal-info p { margin: 0; color: var(--muted); font-size: .9rem; }
.deal-names { font-size: .9rem; }
.deal-price-row s { color: var(--muted); }
.deal-price-row b { color: var(--deal); font-size: 1.4rem; margin-left: 6px; }
.ship-type { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ship-type label { border: 1px solid var(--line); padding: 8px 10px; border-radius: var(--radius); display: flex; gap: 6px; align-items: center; cursor: pointer; font-size: .9rem; }
.ship-type label.on { border-color: var(--accent); }
.ship-type input { width: auto; }
@media (max-width: 560px) { .deal-card { grid-template-columns: 1fr; } }

/* Runde 5 */
#dealList { margin-top: 28px; }
.row-pack { grid-template-columns: minmax(0, 1fr) 110px !important; }
.pay-cash { border: 1px solid var(--accent); padding: 8px 10px; border-radius: var(--radius); }
.bundle .bundle-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 56px; }
.bundle .bundle-imgs img, .bundle .bundle-imgs .noimg { width: 27px; height: 56px; object-fit: cover; }
.cart-lines li.bundle { border: 1px dashed var(--deal); padding: 8px; border-radius: var(--radius); }
#supportBtn[data-badge]:not([data-badge=""])::after { content: attr(data-badge); background: var(--deal); color: var(--deal-text); border-radius: 99px; padding: 0 6px; margin-left: 4px; font-size: .75rem; }
.ticket-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.ticket-list button { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; border-radius: var(--radius); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ticket-list .order-status { margin: 0; padding: 0 8px; font-size: .75rem; }
h3.sub { margin: 18px 0 8px; font-size: 1rem; }
.ticket-code { border: 1px solid var(--accent); padding: 8px 10px; border-radius: var(--radius); font-size: .9rem; }
.ticket-code small { color: var(--muted); }
.min-note { font-size: .8rem; color: var(--deal); font-weight: 600; margin-top: 4px; }

/* Handy: nichts darf über den Bildschirmrand hinausragen */
html, body { max-width: 100%; overflow-x: clip; }
.main-nav { flex-wrap: wrap; row-gap: 8px; min-width: 0; }
.site-header > * { min-width: 0; }
.drawer-body { overflow-x: hidden; }
.drawer-body input, .drawer-body select, .drawer-body textarea { min-width: 0; max-width: 100%; }
.drawer-body .delivery, .drawer-body .coins, .drawer-body .ship-type { min-width: 0; }
.drawer-body .delivery label { min-width: 0; overflow-wrap: anywhere; }
.pay-row code, .addr { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .main-nav { gap: 10px 14px; }
  .main-nav a { font-size: .9rem; }
  .cart-btn { padding: 8px 12px; }
  .drawer { width: 100vw; }
  .drawer-head, .drawer-body { padding-left: 14px; padding-right: 14px; }
  .ship-type { grid-template-columns: 1fr; }
}

/* Geschlossener Warenkorb darf nicht (z.B. als Leuchten/Rand) am rechten Bildschirmrand hineinragen */
.drawer { transition: transform .25s ease, visibility 0s linear .25s; }
.drawer.open { transition: transform .25s ease, visibility 0s; }
.drawer:not(.open) { visibility: hidden; box-shadow: none !important; border-left-color: transparent; }
