/* Schorschi Lift – Gutschein-Shop
   Farben von schorschi.at: Blau #007BB8, Rot #D73323, Dunkel #1C1C1C, Hell #F9F9F9
   Hell/Dunkel folgt automatisch der Einstellung am Handy. */

:root {
  --blue: #007bb8;
  --blue-strong: #00649a;
  --blue-soft: #e3f2fb;
  --red: #d73323;
  --red-soft: #fde8e5;
  --green: #1f9d55;
  --green-soft: #e3f6ea;
  --amber: #c27803;
  --amber-soft: #fff4d6;
  --bg: #f2f8fc;
  --bg-2: #ffffff;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #5d6b78;
  --line: #d8e4ec;
  --shadow: 0 6px 24px rgba(0, 72, 110, .10);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Lexend", ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #3aa6dd;
    --blue-strong: #62bce9;
    --blue-soft: #0e2c3d;
    --red: #ff6b5a;
    --red-soft: #3a1914;
    --green: #4cd087;
    --green-soft: #12301f;
    --amber: #ffbf47;
    --amber-soft: #3a2c0c;
    --bg: #0d1419;
    --bg-2: #121b22;
    --card: #17222b;
    --text: #f1f5f8;
    --muted: #9fb0bd;
    --line: #26343f;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
body.snow {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0,123,184,.10) 0 3px, transparent 4px),
    radial-gradient(circle at 78% 9%, rgba(0,123,184,.08) 0 2px, transparent 3px),
    radial-gradient(circle at 40% 70%, rgba(0,123,184,.07) 0 3px, transparent 4px),
    radial-gradient(circle at 90% 55%, rgba(215,51,35,.06) 0 2px, transparent 3px);
  background-size: 180px 180px, 230px 230px, 260px 260px, 210px 210px;
}
a { color: var(--blue); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
small, .muted { color: var(--muted); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 16px; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }

/* ---------- Kopf ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue) 0%, #0590d4 60%, #2bb0ea 100%);
  color: #fff;
  border-radius: 0 0 34px 34px;
  padding: 20px 18px 26px;
  box-shadow: var(--shadow);
}
.hero::after { /* Berge */
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px; height: 46px;
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,.18) 50%) 0 0 / 60px 46px,
    linear-gradient(225deg, transparent 50%, rgba(255,255,255,.18) 50%) 30px 0 / 60px 46px;
  opacity: .8;
  pointer-events: none;
}
.hero-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.hero .mascot {
  width: 86px; height: 86px; flex-shrink: 0;
  background: #fff; border-radius: 28px; padding: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  animation: wiggle 4s ease-in-out infinite;
}
.hero h1 { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: .01em; }
.hero p { margin: 0; opacity: .95; font-size: .95rem; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .82rem; font-weight: 700;
  background: rgba(255,255,255,.22); color: #fff;
  margin-top: 8px;
}
.pill.red { background: var(--red); }
@keyframes wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .hero .mascot { animation: none; } * { scroll-behavior: auto !important; } }

.embed .hero { border-radius: 26px; margin: 8px; }

/* ---------- Karten / Boxen ---------- */
.box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.box.tight { padding: 12px 14px; }
/* Aufklappbarer Bereich (Geschenk-Gutscheine) */
details.fold > summary { list-style: none; cursor: pointer; user-select: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; margin-left: 2px; transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold .fold-hint { margin-left: auto; font-size: .8rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; border: 2px solid currentColor; opacity: .85; }
details.fold[open] .fold-hint { display: none; }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 800; color: var(--blue);
  margin: 22px 4px 10px;
}
.product {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 12px 10px;
  margin-bottom: 12px;
  transition: border-color .15s, transform .15s, background .15s;
}
.product.selected { border-color: var(--blue); background: var(--blue-soft); }
.product .emoji {
  width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 30px; background: var(--blue-soft);
}
.product.selected .emoji { background: var(--card); }
.product .name { font-weight: 800; font-size: 1rem; }
.product .desc { color: var(--muted); font-size: .85rem; }
.price { font-weight: 800; color: var(--blue); }
.price-old { text-decoration: line-through; color: var(--muted); font-size: .85rem; margin-left: 6px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  background: var(--blue-soft); color: var(--blue);
}
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.grey { background: var(--line); color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 14px; border: 0;
  font-size: 1.4rem; font-weight: 800; line-height: 1;
  background: var(--blue-soft); color: var(--blue); cursor: pointer;
}
.stepper button.plus { background: var(--blue); color: #fff; }
.stepper button:active { transform: scale(.92); }
.stepper input {
  width: 34px; text-align: center; border: 0; background: transparent;
  font: inherit; font-weight: 800; font-size: 1.1rem; color: var(--text);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

@media (max-width: 420px) {
  .product { grid-template-columns: 46px 1fr; }
  .product .emoji { width: 46px; height: 46px; font-size: 26px; }
  .product .stepper { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Formulare ---------- */
label { display: block; font-weight: 700; font-size: .9rem; margin: 12px 0 6px; }
.field, input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%;
  font: inherit; font-size: 16px;
  color: var(--text);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,123,184,.15); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.check input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; accent-color: var(--blue); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 1rem;
  padding: 12px 20px; border-radius: 16px; border: 0;
  background: var(--blue); color: #fff; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--blue-strong);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-strong); }
.btn.big { width: 100%; padding: 16px 20px; font-size: 1.1rem; border-radius: 20px; }
.btn.red { background: var(--red); box-shadow: 0 4px 0 #a92619; }
.btn.green { background: var(--green); box-shadow: 0 4px 0 #157a40; }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: none; border: 2px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: .85rem; border-radius: 12px; box-shadow: none; }
.btn.small.ghost { border-width: 1px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Warenkorb-Leiste ---------- */
.cartbar {
  position: sticky; bottom: 0; z-index: 10;
  margin: 18px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.cartbar .sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 800; }
.cartbar .sum .total { font-size: 1.35rem; color: var(--blue); }

/* ---------- Meldungen ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.alert.error { background: var(--red-soft); color: var(--red); }
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.info { background: var(--blue-soft); color: var(--blue); }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Danke / Bankdaten ---------- */
.big-emoji { font-size: 56px; line-height: 1; }
.bankrow {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.bankrow:last-child { border-bottom: 0; }
.bankrow .k { color: var(--muted); font-size: .85rem; }
.bankrow .v { font-weight: 800; word-break: break-all; }
.copy { flex-shrink: 0; }
.qr { background: #fff; padding: 10px; border-radius: 18px; width: 200px; height: 200px; display: block; margin: 8px auto; }
.code-chip {
  display: inline-block; font-weight: 800; letter-spacing: .12em;
  background: var(--blue-soft); color: var(--blue); padding: 4px 10px; border-radius: 10px;
}

/* ---------- Footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 18px 16px 30px; }
.footer a { color: var(--muted); }

/* ---------- Status-Ampel (Kasse & öffentlich) ---------- */
.status-hero { border-radius: var(--radius); padding: 22px 18px; text-align: center; color: #fff; margin: 14px 0; }
.status-hero .icon { font-size: 52px; line-height: 1; }
.status-hero .title { font-size: 1.5rem; font-weight: 800; margin-top: 6px; }
.status-hero.ok { background: var(--green); }
.status-hero.bad { background: var(--red); }
.status-hero.warn { background: var(--amber); }
.status-hero.grey { background: #66727c; }
.code-big { font-size: 2.2rem; font-weight: 900; letter-spacing: .14em; color: var(--blue); }

/* ---------- Kasse ---------- */
.topbar {
  background: var(--blue); color: #fff;
  padding: 10px 16px calc(10px); position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar img { width: 38px; height: 38px; background: #fff; border-radius: 12px; padding: 2px; }
.topbar .brand { font-weight: 800; color: #fff; text-decoration: none; margin-right: auto; display: flex; gap: 10px; align-items: center; }
.topbar a, .topbar button.linklike { color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 6px 10px; border-radius: 10px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.2); }
button.linklike { background: none; border: 0; cursor: pointer; font: inherit; padding: 6px 10px; }
.searchbar { display: flex; gap: 8px; }
.searchbar input { text-transform: uppercase; font-weight: 800; letter-spacing: .1em; text-align: center; font-size: 1.2rem; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); margin-bottom: 8px; text-decoration: none; color: var(--text);
}
.list-item:hover { border-color: var(--blue); }
.list-item .code { font-weight: 900; letter-spacing: .1em; color: var(--blue); }
#scanner-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; margin: 12px 0; }
#scanner-wrap video { width: 100%; display: block; max-height: 60vh; object-fit: cover; }
#scanner-wrap .frame { position: absolute; inset: 18%; border: 4px solid rgba(255,255,255,.85); border-radius: 22px; pointer-events: none; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.6rem; font-weight: 800; color: var(--blue); }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.warn .n { color: var(--amber); }
.stat.bad .n { color: var(--red); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tbl tr:hover td { background: var(--blue-soft); }
.tbl td.r, .tbl th.r { text-align: right; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tabs a { padding: 7px 14px; border-radius: 999px; text-decoration: none; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .9rem; }
.tabs a.active { background: var(--blue); border-color: var(--blue); color: #fff; }
details.box summary { cursor: pointer; font-weight: 800; }
details.inline summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: .85rem; }
.inline-form { display: inline; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
pre.code { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
