/* Basis-Layer: nutzt NUR Tokens aus theme-*.css. Komponenten-Details in storefront.css / admin.css */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: var(--fs-base, 17px); line-height: 1.6; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--display-weight, 500); line-height: 1.12; margin: 0 0 .5em; letter-spacing: var(--display-tracking, 0); }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.container { width: min(100% - 2.5rem, var(--container, 1160px)); margin-inline: auto; }
.container.narrow { max-width: 680px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.5rem; border-radius: var(--radius-btn, 999px); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s, color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover, var(--primary)); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem 1rem; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }

/* Formulare */
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=date], select, textarea {
  width: 100%; padding: .7rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-input, 10px); background: var(--surface); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
textarea { min-height: 120px; resize: vertical; }
.field { margin-bottom: 1.1rem; }
.field .hint { font-size: .85rem; color: var(--ink-soft); margin-top: .3rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.checkbox input { width: auto; margin-top: .35rem; }

/* Meldungen */
.flashes { width: min(100% - 2.5rem, var(--container, 1160px)); margin: 1rem auto 0; }
.flash { padding: .8rem 1.1rem; border-radius: var(--radius, 14px); margin-bottom: .6rem; border: 1px solid var(--line); background: var(--surface); }
.flash-success { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.flash-error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.flash-info { border-color: var(--primary); }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; background: var(--line); color: var(--ink); }
.badge-pending { background: color-mix(in srgb, var(--warning) 25%, var(--surface)); color: var(--ink); }
.badge-paid { background: color-mix(in srgb, var(--primary) 20%, var(--surface)); color: var(--ink); }
.badge-shipped { background: color-mix(in srgb, var(--success) 22%, var(--surface)); color: var(--ink); }
.badge-cancelled, .badge-refunded { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--ink); }
.badge-draft { background: var(--line); }
.badge-active { background: color-mix(in srgb, var(--success) 22%, var(--surface)); }
.badge-archived { background: color-mix(in srgb, var(--ink) 10%, var(--surface)); }

/* Tabellen */
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.table tr:hover td { background: color-mix(in srgb, var(--line) 35%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Karten/Flaechen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 1.25rem; }
.stack > * + * { margin-top: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.between { justify-content: space-between; }
.error-detail { white-space: pre-wrap; text-align: left; font-size: .8rem; background: var(--surface); padding: 1rem; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
