/* Phone-first. Base rules = 360-430 px phones; min-width queries add desktop. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
  display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0 0 var(--s3); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.grundpreis { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--container); margin: 0 auto; padding: 0 var(--s4); height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
}
.wordmark {
  display: inline-flex; align-items: center; gap: var(--s3);
  text-decoration: none; color: var(--ink); white-space: nowrap; line-height: 1; min-height: 44px;
}
.wordmark__logo { display: block; height: 24px; width: auto; }
.wordmark__sub {
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); padding-top: 2px;
}
.wordmark--big { display: flex; flex-direction: column; gap: var(--s3); margin: 0 0 var(--s4); min-height: 0; }
.wordmark--big .wordmark__logo { height: auto; width: min(220px, 70%); }
.wordmark--big .wordmark__sub { padding: 0; font-size: 12px; }
.cartlink {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-right: -8px; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.cartlink:active { background: var(--tile); }
.cartlink__badge {
  position: absolute; top: 5px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600;
  line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  transition: transform .25s var(--ease);
}
.cartlink__badge.is-empty { display: none; }
.cartlink__badge.is-bump { transform: scale(1.3); }

/* ---------------------------------------------------------------- layout */
.main { flex: 1; width: 100%; max-width: var(--container); margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.page-title {
  font-family: var(--font-display); font-size: clamp(30px, 7vw, 44px); font-weight: 500;
  letter-spacing: -.01em; line-height: 1.1; margin-bottom: var(--s4);
}
.section-title { font-family: var(--font-display); font-size: 24px; margin: var(--s6) 0 var(--s3); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-pill);
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; }
.btn--block { width: 100%; }
.btn--lg { min-height: 52px; font-size: 16px; }
.btn--sm { min-height: 44px; padding: 0 var(--s4); font-size: 14px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger); }
@media (hover: hover) {
  .btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
  .btn--ghost:hover { border-color: var(--ink); }
}
.linkbtn { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--muted); font-size: inherit; min-height: 44px; }
.btnrow { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }

/* ---------------------------------------------------------------- fields */
.field { margin-bottom: var(--s4); }
.field__label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s2);
}
.field__input {
  width: 100%; min-height: 48px; padding: var(--s3) var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; /* 16px prevents iOS auto-zoom */
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.field__input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
textarea.field__input { min-height: 96px; resize: vertical; line-height: 1.5; }
.field.has-error .field__input { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 13px; margin: var(--s2) 0 0; }
.field__help { color: var(--muted); font-size: 13px; margin: var(--s2) 0 0; }
.field__help code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--tile); padding: 1px 5px; border-radius: 4px; }
.field-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s3); }
.field__pw { position: relative; }
.field__pw .field__input { padding-right: 56px; }
.field__eye {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border: 0; background: none; color: var(--muted); border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.field__eye .field__eye-off { display: none; }
.field__eye[aria-pressed="true"] .field__eye-on { display: none; }
.field__eye[aria-pressed="true"] .field__eye-off { display: block; }
.field__input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #fff inset; -webkit-text-fill-color: var(--ink); transition: background-color 9999s; }
.select {
  min-height: 48px; padding: 0 40px 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A847C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  font: inherit; font-size: 16px; appearance: none; -webkit-appearance: none; color: var(--ink);
}

/* ------------------------------------------------------- panels, notices */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s5) var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow-1);
}
.panel__title { font-family: var(--font-display); font-size: 22px; margin-bottom: var(--s3); }
.panel--danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.notice { border-radius: var(--r-md); padding: var(--s4); margin-bottom: var(--s4); border: 1px solid transparent; font-size: 14px; }
.notice p:last-child { margin-bottom: 0; }
.notice--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: #33512F; }
.notice--error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: #7A2E2E; }
.notice--warn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink); }
.notice__list { margin: var(--s2) 0 var(--s2) var(--s4); padding: 0; }
.notice__list li { margin-bottom: 2px; }

/* ---------------------------------------------------------------- toasts */
.toasts {
  position: fixed; left: 0; right: 0; bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: 0 var(--s4); pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 520px; width: 100%; padding: var(--s3) var(--s4); border-radius: var(--r-md);
  box-sizing: border-box;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2);
  animation: toast-in .25s var(--ease); text-align: center;
}
.toast--error { background: var(--danger); }
.toast--ok { background: #2F4A2C; }
.toast--warn { background: var(--accent-ink); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--muted); }
.footer__inner { max-width: var(--container); margin: 0 auto; display: flex; justify-content: flex-end; align-items: center; }
.footer__logout { margin: 0; }
/* shop footer: short Impressum, contact + register next to the address (2 columns on phones, 3 on desktop);
   .footer__inner stays for the admin footer */
.footer__grid {
  max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "postal contact" "postal register" "postal nav"; column-gap: var(--s4); align-items: start;
}
.footer__address { display: contents; font-style: normal; }
.footer__address p { margin: 0; line-height: 1.6; }
.footer__postal { grid-area: postal; }
.footer__contact { grid-area: contact; }
.footer__register { grid-area: register; }
.footer__name { color: var(--ink-2); font-weight: 600; }
.footer__address a, .legal a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.footer__nav { grid-area: nav; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); align-self: end; }
.footer__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: underline; }

/* ------------------------------------------------------- radio cards */
.radios { border: 0; padding: 0; margin: 0 0 var(--s5); min-width: 0; }
.radios legend { padding: 0; }
.radio { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); margin-bottom: var(--s2); cursor: pointer; background: #fff; }
.radio input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); flex-shrink: 0; }
.radio strong { display: block; font-weight: 600; }
.radio small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.radio:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* --------------------------------------------------------- empty & error */
.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--muted); }
.empty[hidden] { display: none; }
.empty__title { font-family: var(--font-display); font-size: 24px; color: var(--ink); }
.empty .btn { margin-top: var(--s4); }
.errorpage { text-align: center; padding: var(--s8) var(--s4); }
.errorpage__code { font-family: var(--font-display); font-size: 72px; line-height: 1; color: var(--accent); margin-bottom: var(--s3); }
.errorpage__title { font-family: var(--font-display); font-size: 28px; margin-bottom: var(--s3); }
.errorpage__text { color: var(--muted); margin-bottom: var(--s5); }

/* ------------------------------------------------------------------ gate */
body.is-gate .main { display: flex; align-items: center; justify-content: center; padding-top: var(--s6); }
.gate { width: 100%; max-width: 420px; margin: 0 auto; }
.gate__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: var(--s6) var(--s5); box-shadow: var(--shadow-2); animation: rise .6s var(--ease);
}
.gate__hint { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: var(--s5); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------- summary rows (shared) */
.summary__rows { margin: 0; }
.summary__rows > div { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.summary__rows dt { color: var(--muted); }
.summary__rows dd { margin: 0; font-weight: 500; }
.summary__rows .summary__total { border-bottom: 0; padding-top: var(--s3); font-size: 17px; }
.summary__total dt { color: var(--ink); font-weight: 600; }
.summary__total dd { font-weight: 600; }
.summary__tba { color: var(--accent-ink); font-size: 13px; font-weight: 500; }
.backlink { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: var(--s2); min-height: 44px; line-height: 44px; }

/* ------------------------------------------------------- legal (Impressum) */
.legal { max-width: 640px; }
.legal__label { font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--muted); margin: var(--s5) 0 var(--s1); }
.legal__label:first-of-type { margin-top: 0; }
.legal__block { font-style: normal; font-size: 17px; line-height: 1.5; color: var(--ink); margin: 0 0 var(--s5); }
.legal__text { margin: 0; line-height: 1.6; }
.legal__h2 { font-family: var(--font-display); font-size: 22px; margin: var(--s6) 0 var(--s3); }
.legal__h2:first-of-type { margin-top: 0; }
.legal__list { margin: 0 0 var(--s3) var(--s4); padding: 0; line-height: 1.6; }
.legal__list li { margin-bottom: 2px; }
.legal__stand { color: var(--muted); font-size: 13px; margin: var(--s6) 0 0; }

/* --------------------------------------------------------------- desktop */
@media (min-width: 900px) {
  .toasts { left: auto; right: var(--s5); bottom: auto; top: calc(var(--topbar-h) + var(--s4)); align-items: flex-end; padding: 0; width: 280px; }
  .toast { font-size: 13px; padding: 10px 14px; }
  .main { padding: var(--s6) var(--s5) var(--s8); }
  .footer__grid { grid-template-columns: auto auto 1fr; grid-template-areas: "postal contact nav" "postal register nav"; column-gap: var(--s7); }
  .footer__nav { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
