/* Shop über die Tebex Headless API. Aufbau angelehnt an große Server-Shops (Logo mittig, Login-Leiste mit Warenkorb,
   Kacheln mit Bonus-Band, Rang-Spalten über der Vergleichstabelle, schwebende Bereichsleiste), Farben und Schrift
   von FuxelSMP: Graphit, Orange als Akzent, Kristalle immer in --crystal (#00ffea). */

canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

main.spalte { padding-bottom: 96px; } /* Platz für die schwebende Leiste */
/* Sprünge aus der schwebenden Leiste landen unter der Login-Leiste, nicht dahinter */
.bereich { scroll-margin-top: 96px; }

/* ---------- Sale-Hinweis ---------- */
.sale {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 16px;
  background: linear-gradient(90deg, rgba(251, 112, 31, .28), rgba(251, 112, 31, .1));
  border: 1px solid var(--accent-line); border-radius: 8px; font-size: 15px;
}
.sale canvas { width: 18px; height: 16px; flex-shrink: 0; }
.sale strong { color: var(--accent-2); }

/* ---------- Login-Leiste ---------- */
.leiste {
  position: sticky; top: 10px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--bg-3); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px 12px 18px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
}
.login-knopf {
  display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer;
  font-weight: 600; font-size: 17px; padding: 6px 2px; color: var(--text);
}
.login-knopf svg { width: 16px; height: 16px; fill: var(--accent); }
.login-knopf:hover { color: var(--accent-2); }
.angemeldet { display: flex; align-items: center; gap: 12px; }
.kopf-bild { width: 40px; height: 40px; image-rendering: pixelated; }
.wer { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.wer small { display: block; color: var(--muted); font-size: 13px; line-height: 1.2; }
.wer strong { font-size: 18px; line-height: 1.2; }
.btn.klein { padding: 5px 10px; font-size: 14px; }
.warenkorb-knopf { border-radius: 8px; padding: 10px 18px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22); }
.anzahl {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--on-accent); color: var(--accent-2);
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.anzahl[data-zero="true"] { opacity: .6; }
@media (max-width: 560px) {
  .leiste { flex-wrap: nowrap; padding: 8px 8px 8px 12px; gap: 8px; }
  .konto { min-width: 0; }
  .angemeldet { gap: 8px; min-width: 0; }
  .kopf-bild { width: 32px; height: 32px; }
  .wer { min-width: 0; }
  .wer small { display: none; }
  #abmelden { display: none; }
  .wer strong { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .warenkorb-knopf { padding: 8px 12px; flex-shrink: 0; }
}

.laden { color: var(--muted); text-align: center; padding-block: 48px; margin: 0; }
.stoerung { border: 1px solid var(--accent-line); background: var(--bg-2); border-radius: 10px; padding: 18px; margin-top: 32px; display: grid; gap: 12px; justify-items: start; }
.stoerung p { margin: 0; color: var(--muted); max-width: 70ch; }
.stoerung strong { color: var(--text); }

/* ---------- Bereiche ---------- */
.bereich { padding-top: 64px; scroll-margin-top: 90px; }
.bereich-titel {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font: 700 40px/1.1 var(--pixel); text-transform: uppercase; text-align: center; text-shadow: 0 4px 0 rgba(0, 0, 0, .45);
}
@media (max-width: 560px) { .bereich-titel { font-size: 30px; } }
.bereich-titel canvas { width: 40px; height: auto; }
.bereich-text { color: var(--muted); text-align: center; max-width: 62ch; margin: 12px auto 28px; }

.karte { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }

/* ---------- Kacheln ---------- */
.kacheln { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.kachel {
  grid-column: span 2; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 24px 18px 18px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.kachel.gross { grid-column: span 3; }
.kachel.voll { grid-column: 1 / -1; }
.kachel.hervor { border-color: var(--crystal-line); background: linear-gradient(180deg, rgba(0, 255, 234, .13), var(--bg-2) 70%); }
.kachel .bild { width: 100%; max-width: 200px; padding: 6px 0 10px; }
.kachel.gross .bild { max-width: 260px; }
.kachel .bild canvas { width: 100%; height: auto; aspect-ratio: 40 / 24; filter: drop-shadow(0 6px 10px rgba(0, 255, 234, .18)); }
.kachel h3 { font-size: 21px; font-weight: 900; }
.kachel .menge { color: var(--crystal); font-variant-numeric: tabular-nums; }
.kachel .preis { font-size: 19px; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.kachel .preis s { color: var(--dim); font-weight: 400; font-size: 15px; margin-right: 6px; }
.kachel .btn { width: 100%; margin-top: 12px; }
/* Schräges Band oben links */
.band {
  position: absolute; top: 20px; left: -46px; width: 170px; transform: rotate(-45deg);
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 900; text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 0; text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
/* Abzeichen oben rechts */
.abzeichen {
  position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
  background: var(--crystal); color: #04201e; padding: 4px 9px; border-radius: 6px; box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
@media (max-width: 760px) {
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kachel, .kachel.gross { grid-column: span 1; }
  .kachel.voll { grid-column: 1 / -1; }
  .kachel h3 { font-size: 18px; }
}
@media (max-width: 420px) { .kacheln { grid-template-columns: minmax(0, 1fr); } }

/* Großer Kaufknopf mit Kante unten */
.btn.gross, .kachel .btn, .rang .btn {
  border-radius: 8px; padding: 12px 16px; text-transform: uppercase; letter-spacing: .04em; font-weight: 900; font-size: 15px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22);
}

/* Wofür es Kristalle gibt: sechs kleine Felder, je mit einem Kristall-Pixel davor */
.unter-titel { font: 700 20px/1.2 var(--pixel); text-align: center; margin: 40px 0 16px; }
.verwendung { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.verwendung li {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; font-weight: 600;
}
.verwendung li::before { content: ""; width: 10px; height: 10px; flex: none; background: var(--crystal); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .25); }
@media (max-width: 760px) { .verwendung { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .verwendung { grid-template-columns: minmax(0, 1fr); } }

/* Premium-Befehle als Raster unter der Tabelle */
.befehle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.befehle li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; color: var(--muted); font-size: 15px; }
.befehle li b { display: block; color: var(--text); font-weight: 600; }
.befehle code { background: none; padding: 0; color: var(--accent-2); font-size: 15px; }
@media (max-width: 560px) { .befehle { grid-template-columns: repeat(2, minmax(0, 1fr)); } .befehle li { font-size: 14px; padding: 9px 11px; } }

/* ---------- Premium: Spalten je Laufzeit über der Tabelle ---------- */
.raenge { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; border-radius: 12px 12px 0 0; overflow: hidden; }
.rang {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 20px 16px 18px; background: #7a3a12;
}
.rang:nth-child(2) { background: #b4521a; }
.rang:nth-child(3) { background: var(--accent); }
.rang .dauer { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.rang h3 { font: 700 30px/1.1 var(--pixel); text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.rang .preis-pille {
  margin-top: 6px; background: rgba(0, 0, 0, .28); border-radius: 999px; padding: 4px 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rang .preis-pille s { opacity: .65; font-weight: 400; margin-right: 6px; }
.rang small { font-size: 13px; opacity: .85; }
.rang .spare { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 900; text-transform: uppercase; background: var(--on-accent); color: var(--accent-2); padding: 3px 7px; border-radius: 5px; }
.rang .btn { width: 100%; margin-top: 10px; background: var(--text); border-color: var(--text); color: var(--on-accent); }
.rang .btn:hover { background: #fff; border-color: #fff; color: var(--on-accent); }
.rang, .rang h3, .rang small { color: #fff; }

.vergleich { background: var(--bg-2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; overflow-x: auto; }
.vergleich table { font-size: 15px; }
.vergleich th, .vergleich td { padding: 12px 16px; vertical-align: middle; }
.vergleich thead th { background: var(--bg-3); color: var(--text); font-family: var(--sans); font-weight: 900; font-size: 14px; letter-spacing: .04em; }
.vergleich tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, .02); }
.vergleich td:not(:first-child), .vergleich th:not(:first-child) { text-align: center; }
td.p { color: var(--text); font-weight: 600; }
td.n { color: var(--muted); }
th.p { color: var(--accent) !important; }
.ja { color: var(--ok); font-weight: 900; }
.nein { color: #ff8f85; font-weight: 900; }
.stapel { font-size: 14px; color: var(--muted); border: 1px dashed var(--line-strong); padding: 10px 14px; margin: 12px 0 0; border-radius: 8px; }

.verkaeufer { margin: 48px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; text-align: center; }
.verkaeufer a { color: var(--muted); }

/* ---------- Ablauf und Fragen ---------- */
.ablauf { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.ablauf li { counter-increment: s; }
.ablauf li::before {
  content: counter(s); display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: 18px; margin-bottom: 12px;
}
.ablauf h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.ablauf p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .ablauf { grid-template-columns: minmax(0, 1fr); } }

.fragen { display: grid; gap: 10px; margin-top: 28px; }
.fragen details { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; }
.fragen summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.fragen summary::-webkit-details-marker { display: none; }
.fragen summary::after { content: "+"; color: var(--accent); font-weight: 900; }
.fragen details[open] summary::after { content: "−"; }
.fragen details p { color: var(--muted); margin: 0 0 16px; max-width: 72ch; }

/* ---------- Schwebende Bereichsleiste ---------- */
.pille {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 4px; padding: 5px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none;
  background: rgba(31, 33, 37, .92); border: 1px solid var(--line-strong); border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); backdrop-filter: blur(6px);
}
.pille a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.pille a:hover { background: var(--bg-4); color: var(--text); }
.pille a.aktiv { background: var(--accent); color: var(--on-accent); }

/* ---------- Warenkorb ---------- */
.schleier { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.schleier.offen { opacity: 1; pointer-events: auto; }
.schublade {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 50;
  background: var(--bg-2); border-left: 1px solid var(--line-strong); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease; visibility: hidden;
}
.schublade.offen { transform: none; visibility: visible; }
.schublade header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.schublade header h2 { font: 700 20px/1.2 var(--pixel); text-transform: uppercase; }
.posten { flex: 1; overflow-y: auto; padding: 4px 18px; }
.posten-zeile { display: flex; gap: 12px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.posten-zeile canvas { width: 44px; height: auto; flex-shrink: 0; background: var(--bg); padding: 4px; border-radius: 6px; }
.posten-zeile .t { flex: 1; min-width: 0; }
.posten-zeile .t strong { display: block; }
.posten-zeile .t small { color: var(--muted); }
.posten-zeile .r { display: grid; justify-items: end; gap: 4px; }
.posten-zeile .preis { font-weight: 600; font-variant-numeric: tabular-nums; }
.menge-wahl { display: flex; align-items: center; gap: 2px; }
.menge-wahl:empty { display: none; }
.menge-wahl button {
  width: 26px; height: 26px; background: var(--bg); border: 1px solid var(--line-strong); color: var(--text);
  cursor: pointer; font-weight: 600; line-height: 1; padding: 0; border-radius: 6px;
}
.menge-wahl button:hover { border-color: var(--accent); }
.menge-wahl span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.entfernen { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 4px; text-decoration: underline; text-underline-offset: .18em; }
.entfernen:hover { color: var(--text); }
.leer { color: var(--muted); text-align: center; padding-block: 48px; }
.summe { border-top: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 12px; }
.zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.zeile .preis { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.zeile.abzug { color: var(--muted); font-size: 15px; }
.summe .stapel { margin: 0; background: var(--bg); }
.summe .fehler, .login .fehler { color: #ff8f85; font-size: 14px; margin: 0; }
.summe .klein, .login .klein { color: var(--dim); font-size: 13px; margin: 0; }
.gutschein { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.gutschein label, .login label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.codes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.codes li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.feld { display: flex; gap: 8px; }
.feld input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-strong); padding: 9px 12px; border-radius: 6px; }
.feld input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.feld .btn { border-radius: 6px; }

/* ---------- Dialoge ---------- */
dialog {
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text);
  width: min(560px, calc(100% - 32px)); padding: 0; border-radius: 12px;
}
dialog::backdrop { background: var(--scrim); }
.login-kopf {
  display: flex; align-items: center; justify-content: center; position: relative; padding: 22px 56px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: var(--on-accent);
}
.login-kopf h2 { font: 700 20px/1.2 var(--pixel); text-transform: uppercase; }
.login-kopf .x {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: rgba(0, 0, 0, .2); color: var(--on-accent); cursor: pointer; font-weight: 900;
}
.login-form { padding: 22px; display: grid; gap: 12px; }
.dlg-kopf { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dlg-kopf h2 { font-size: 24px; font-weight: 900; margin-top: 6px; }
.dlg-inhalt { padding: 18px 20px; }
.dlg-inhalt p { margin: 0; color: var(--muted); }
.dlg-fuss { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: end; }

.meldung {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; transition: opacity .2s, transform .2s;
  background: var(--bg-4); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 16px;
  font-weight: 600; pointer-events: none; max-width: calc(100% - 32px);
}
.meldung.zeigen { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .schublade, .schleier, .meldung { transition: none; }
}
