/* ==========================================================================
   Purenote — Designsystem "Private Boutique"
   Editorial-Luxus: Cormorant (Display) + Satoshi (UI) + General Sans (Text),
   warmes Schwarz, sparsam gesetztes Gold.
   ========================================================================== */

/* ---- Fonts (self-hosted, DSGVO-konform) --------------------------------- */
/* Cormorant ist eine Variable Font (300–700) — eine Datei für alle Schnitte. */
@font-face {
  font-family: 'Cormorant';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/satoshi-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/satoshi-700.woff2') format('woff2');
}
@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/general-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/general-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/general-sans-600.woff2') format('woff2');
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --bg:        #FAFAF9;
  --surface:   #FFFFFF;
  --ink:       #0C0A09;
  --ink-2:     #57534E;
  --ink-3:     #A8A29E;
  --primary:   #1C1917;
  --on-primary:#FFFFFF;
  --accent:    #A16207;
  --accent-2:  #D9A441;
  --danger:    #DC2626;
  --danger-bg: #FEF2F2;
  --ok:        #166534;
  --ok-bg:     #F0FDF4;
  --gold-bg:   #FDF6E9;
  --line:      #E7E5E4;
  --line-2:    #D6D3D1;

  /* Serif nur für Namen & Überschriften im Shop — Zahlen und Bedienelemente
     bleiben in der Grotesk, sonst leidet die Lesbarkeit im Admin. */
  --font-serif: 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-display: 'Satoshi', system-ui, -apple-system, sans-serif;
  --font-body: 'General Sans', system-ui, -apple-system, sans-serif;

  --radius: 2px;
  --radius-lg: 4px;

  --space-1: 8px;  --space-2: 16px; --space-3: 24px;
  --space-4: 40px; --space-5: 64px; --space-6: 96px;

  /* Eine Quelle für alle sticky-Abstände (Kopfzeile, Filter, Warenkorb). */
  --header-h: 72px;

  --shadow-1: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow-2: 0 10px 30px -12px rgba(28, 25, 23, .18);
  --shadow-3: 0 24px 60px -20px rgba(28, 25, 23, .28);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: 180ms;
  --t-med: 300ms;
}

/* ---- Reset & Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: .01em;
}
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--accent-2); color: var(--primary); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
}

.page { flex: 1 0 auto; padding-bottom: var(--space-6); }
.page--bare { padding-bottom: 0; }

.container { width: min(1200px, 100% - 2 * var(--space-3)); margin-inline: auto; }
.container--narrow { width: min(860px, 100% - 2 * var(--space-3)); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.icon { flex: none; vertical-align: -.18em; display: inline-block; }

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast) var(--ease);
}
.text-link:hover { border-bottom-color: var(--accent); }

/* ---- Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.brand__mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: var(--accent-2);
  font-family: var(--font-serif); font-size: 22px; font-weight: 600;
  line-height: 1; padding-top: 2px;
  border-radius: var(--radius);
  transition: transform var(--t-med) var(--ease);
}
.brand__mark--wide { font-size: 15px; letter-spacing: .06em; padding-top: 1px; }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.05); }
.brand__name {
  font-family: var(--font-serif);
  font-size: 25px; font-weight: 500; letter-spacing: .005em;
  white-space: nowrap;
}
.brand__tag {
  font-family: var(--font-body); font-style: normal;
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); vertical-align: .25em; margin-left: 2px;
}

.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.site-nav__spacer { flex: 1; }
.site-nav__link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 14px; min-height: 44px;
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--ink-2);
  background: none; border: 0; cursor: pointer;
  border-radius: var(--radius);
  position: relative;
  transition: color var(--t-fast) var(--ease);
}
.site-nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 7px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.site-nav__link:hover, .site-nav__link.is-active { color: var(--ink); }
.site-nav__link:hover::after, .site-nav__link.is-active::after { transform: scaleX(1); }
.site-nav__link--muted { color: var(--ink-3); }
.nav-badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
}
.nav-logout { display: flex; }
.nav-logout__label { display: none; }

.cart-link {
  position: relative;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  color: var(--ink);
  border-radius: var(--radius);
  transition: transform var(--t-fast) var(--ease);
}
.cart-link:hover { transform: translateY(-1px); }
.cart-link__badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
  animation: badge-pop .45s var(--ease);
}
@keyframes badge-pop {
  0% { transform: scale(.4); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  place-items: center;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}

/* ---- Footer ---------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-3) 0;
}
.site-footer__row {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 13px; color: var(--ink-2);
}
.site-footer__brand { font-family: var(--font-serif); font-size: 21px; font-weight: 500; color: var(--ink); }
.site-footer__note { flex: 1; min-width: 200px; }
.site-footer__links { display: flex; gap: var(--space-2); }
.site-footer__links a {
  color: var(--ink-2); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.site-footer__links a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.site-footer--bare { background: transparent; border-top: 0; }
.site-footer--bare .site-footer__row { justify-content: center; }

/* ---- Hero & Titel ------------------------------------------------------------ */
.hero { padding: var(--space-5) 0 var(--space-4); text-align: center; }
.hero__kicker, .auth__kicker, .auth__brand-kicker {
  font-size: 11px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent);
}
/* Cormorant baut optisch klein und zart — deshalb größer gesetzt, im leichten
   Schnitt und mit fast geschlossener Zeilenhöhe. */
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(52px, 8vw, 92px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.01em;
  margin-top: 14px;
}
.hero__sub { margin-top: var(--space-2); color: var(--ink-2); font-size: 15px; }
.hero .gold-rule { margin: var(--space-3) auto 0; }

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 400; letter-spacing: -.01em; line-height: 1.05;
  margin: var(--space-4) 0 var(--space-3);
}
.page-title--center { text-align: center; }
/* Im Admin zählt Kompaktheit mehr als Eleganz — dort bleibt die Grotesk. */
.is-admin .page-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 44px); font-weight: 700; letter-spacing: -.02em;
}
.page-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); flex-wrap: wrap;
}
.page-head-row .page-title { margin-bottom: var(--space-2); }
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 23px; font-weight: 700;
  margin-bottom: var(--space-2);
}
.section-title .icon { color: var(--accent); }

.breadcrumb { margin-top: var(--space-3); font-size: 14px; }
.breadcrumb a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); text-decoration: none;
  transition: color var(--t-fast);
}
.breadcrumb a:hover { color: var(--ink); }

.gold-rule {
  display: block; width: 56px; height: 1px;
  background: var(--accent-2);
  margin: var(--space-3) 0;
}

/* ---- Chips ---------------------------------------------------------------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: var(--space-4); justify-content: center; }
.is-admin .chips, .chips--left { justify-content: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; min-height: 44px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface);
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip__count { font-size: 12px; opacity: .65; }

/* ---- Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; min-height: 46px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; letter-spacing: .04em;
  text-decoration: none; cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: #000; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #B91C1C; }
.btn--danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-bg); }
.btn--small { padding: 8px 14px; min-height: 38px; font-size: 13px; }
.btn--large { padding: 15px 32px; min-height: 52px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--ghost.is-loading::after, .btn--danger-ghost.is-loading::after {
  border-color: rgba(28, 25, 23, .2); border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ink-3); cursor: pointer; text-decoration: none;
  transition: all var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--danger); border-color: var(--line); background: var(--surface); }
a.icon-btn:hover { color: var(--ink); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel + .btn-row { margin-top: var(--space-3); }
.btn-row--right { justify-content: flex-end; }
.btn-row--spread { justify-content: space-between; }

/* ---- Formulare ---------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: var(--space-2); }
.form--slim { max-width: 560px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.form__row--zip { grid-template-columns: 130px 1fr; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label {
  font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
}
.req { color: var(--accent); }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  padding: 12px 14px; min-height: 46px;
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(161, 98, 7, .14);
}
.field input:user-invalid { border-color: var(--danger); }
.field__hint { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 5px; align-items: center; }
.field__hint-inline { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-3); margin-left: 6px; }

.field--check {
  flex-direction: row; align-items: flex-start; gap: 10px;
}
.field--check input[type="checkbox"] {
  width: 20px; height: 20px; margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}
.field--check label {
  text-transform: none; letter-spacing: normal;
  font-size: 14px; font-weight: 400; color: var(--ink);
  cursor: pointer;
}
.field--check a { color: var(--accent); }
.field--check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

.fieldset {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-2) var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.fieldset legend {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  padding: 0 10px;
}

/* ---- Panels & Notices ----------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-1);
}
.panel + .panel, .checkout__main .panel + .panel { margin-top: var(--space-2); }
.dash-cols > .panel + .panel { margin-top: 0; } /* im Grid regelt `gap` den Abstand */
.panel__title {
  display: flex; align-items: center; gap: 9px;
  font-size: 21px; font-weight: 600;
  margin-bottom: var(--space-2);
}
.panel__title .icon { color: var(--accent); }
.panel__optional { font-family: var(--font-body); font-size: 12px; color: var(--ink-3); font-weight: 400; }
.panel__line { display: flex; align-items: center; gap: 9px; padding: 4px 0; }
.panel__line--muted { color: var(--ink-2); font-size: 14px; }
.panel__line .icon { color: var(--accent); flex: none; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid;
  font-size: 14px;
  margin-bottom: var(--space-2);
}
.notice .icon { flex: none; margin-top: 2px; }
.notice--error { background: var(--danger-bg); border-color: #FECACA; color: #991B1B; }
.notice--success { background: var(--ok-bg); border-color: #BBF7D0; color: var(--ok); }

/* ---- Produkt-Grid ---------------------------------------------------------------- */
/* Rahmenlose Kacheln: das Bild ist die Karte, die Zeile darunter steht frei auf
   dem Seitenhintergrund. Die vertikale Lücke ist größer als die horizontale,
   damit Bild und zugehöriger Text als Einheit gelesen werden. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: var(--space-5) var(--space-3);
  padding-bottom: var(--space-4);
}
.card {
  background: transparent;
  display: flex; flex-direction: column;
}
.card__media {
  position: relative; display: block;
  aspect-ratio: 5 / 6;
  background: #F1EFEC;
  border-radius: var(--radius);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 900ms var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }
/* Ausverkauftes bleibt erkennbar, ohne die ganze Seite grau zu färben. */
.card--out .card__media img { filter: grayscale(.45); opacity: .78; }
.card__placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.card__flag {
  position: absolute; top: 10px; left: 10px;
  padding: 6px 11px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(12, 10, 9, .09);
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  border-radius: var(--radius);
}
.card__flag--low { background: var(--accent-2); color: var(--primary); box-shadow: none; }
.card__body { padding: 15px 2px 0; display: flex; flex-direction: column; gap: 5px; flex: 1; }
/* Marke einzeilig halten: sie steht über dem Namen und darf die Reihe nicht
   verschieben — lange Häuser („Yves Saint Laurent“) werden gekürzt. */
.card__cat {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__name {
  font-family: var(--font-serif);
  font-size: 27px; font-weight: 500; line-height: 1.12; letter-spacing: 0;
}
.card__spec { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.card__name a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px; background-position: 0 92%; background-repeat: no-repeat;
  transition: background-size var(--t-med) var(--ease), color var(--t-fast) var(--ease);
}
.card:hover .card__name a, .card__name a:focus-visible { background-size: 100% 1px; }
.card__row {
  margin-top: auto; padding-top: 12px;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.card__price {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
/* Ein stiller Umriss, der beim Überfahren voll deckt — die Kachel bleibt ruhig,
   die Handlung ist trotzdem immer sichtbar (nicht nur bei :hover). */
.card__cta { width: 100%; }
.card__cta.btn--primary {
  background: transparent; color: var(--ink);
  border-color: var(--line-2);
  text-transform: uppercase; letter-spacing: .1em; font-size: 11px;
}
.card__cta.btn--primary:hover {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  transform: none; box-shadow: none;
}
.card__cta.btn--ghost { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }

/* ---- Produktdetail ---------------------------------------------------------------- */
.detail {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  align-items: start;
}
.detail__media {
  aspect-ratio: 5 / 6;
  background: #F1EFEC;
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky; top: calc(var(--header-h) + var(--space-3));
}
.detail__media img { width: 100%; height: 100%; object-fit: cover; }
.detail__name {
  font-family: var(--font-serif);
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 400; line-height: 1.02; letter-spacing: -.01em;
  margin: 10px 0 12px;
}
.detail__price {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-2);
}
.detail__stock { margin-bottom: var(--space-2); }
.detail__desc { color: var(--ink-2); margin-bottom: var(--space-3); max-width: 52ch; }
.detail__form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: var(--space-3); }
.detail__meta {
  list-style: none; padding: var(--space-2) 0 0; margin: 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
  font-size: 14px; color: var(--ink-2);
}
.detail__meta li { display: flex; align-items: center; gap: 10px; }
.detail__meta .icon { color: var(--accent); }

/* ---- Stepper ---------------------------------------------------------------- */
.stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface);
  height: 52px;
}
.stepper--small { height: 44px; }
.stepper__btn {
  width: 44px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.stepper__btn:hover { background: var(--bg); color: var(--ink); }
.stepper__btn:active { transform: scale(.92); }
.stepper__input {
  width: 56px; text-align: center;
  border: 0; border-inline: 1px solid var(--line);
  background: transparent;
  font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper__input:focus { outline: none; background: var(--gold-bg); }

/* ---- Badges ---------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  border-radius: 999px;
  border: 1px solid;
}
.badge--ok     { background: var(--ok-bg);    border-color: #BBF7D0; color: var(--ok); }
.badge--gold   { background: var(--gold-bg);  border-color: #F3D9A4; color: #854D0E; }
.badge--muted  { background: var(--bg);       border-color: var(--line-2); color: var(--ink-2); }
.badge--danger { background: var(--danger-bg);border-color: #FECACA; color: #991B1B; }
.badge--big { padding: 8px 16px; font-size: 13px; }

/* ---- Warenkorb ---------------------------------------------------------------- */
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}
.cart-item__media {
  width: 88px; height: 88px;
  background: #F5F5F4;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: block;
}
.cart-item__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__name { font-family: var(--font-serif); font-size: 25px; font-weight: 500; line-height: 1.15; }
.cart-item__name a { text-decoration: none; }
.cart-item__name a:hover { color: var(--accent); }
.cart-item__unit { font-size: 13px; color: var(--ink-2); }
.cart-item__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.cart-item__line { font-weight: 600; min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }

.cart-summary {
  margin-top: var(--space-3);
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3);
  flex-wrap: wrap;
}
.cart-summary__rows { display: flex; flex-direction: column; gap: 6px; min-width: 260px; flex: 1; }
.cart-summary__row {
  display: flex; justify-content: space-between; gap: var(--space-2);
  font-size: 15px; align-items: center;
}
.cart-summary__row--muted { color: var(--ink-2); font-size: 13px; }
.cart-summary__row--muted .icon { color: var(--accent); }
.cart-summary__row--total {
  font-size: 19px; font-weight: 600;
  border-top: 1px solid var(--line);
  padding-top: 10px; margin-top: 6px;
}
.cart-summary__cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Checkout ---------------------------------------------------------------- */
.checkout {
  display: grid; grid-template-columns: 1fr 400px;
  gap: var(--space-3);
  align-items: start;
  padding-bottom: var(--space-4);
}
.checkout__aside { position: sticky; top: calc(var(--header-h) + var(--space-3)); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.choice { position: relative; cursor: pointer; }
.choice input {
  position: absolute; opacity: 0; pointer-events: none;
}
.choice__card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  transition: all var(--t-fast) var(--ease);
}
.choice__card .icon { color: var(--ink-3); transition: color var(--t-fast); }
.choice__name { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.choice__hint { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.choice:hover .choice__card { border-color: var(--ink-3); transform: translateY(-2px); }
.choice input:checked + .choice__card {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-2);
  background: var(--gold-bg);
}
.choice input:checked + .choice__card .icon { color: var(--accent); }
.choice input:focus-visible + .choice__card { outline: 2px solid var(--accent); outline-offset: 2px; }

.summary-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.summary-list li { display: flex; justify-content: space-between; gap: var(--space-2); }
.summary-list li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-list--divided { border-top: 1px solid var(--line); padding-top: var(--space-2); margin-top: var(--space-2); }
.summary-totals { border-top: 1px solid var(--line); padding-top: var(--space-2); display: flex; flex-direction: column; gap: 6px; }
.summary-cash {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2);
  padding: 12px; margin: var(--space-2) 0;
  background: var(--gold-bg); border-radius: var(--radius-lg);
}
.summary-cash .icon { color: var(--accent); flex: none; }
[data-fee-row].is-hidden { display: none; }

/* ---- Bestellbestätigung ------------------------------------------------------- */
.success { text-align: center; padding-top: var(--space-4); }
.success .panel { text-align: left; margin-top: var(--space-3); }
.success__sub { color: var(--ink-2); margin-top: -6px; }
.success__cta { display: flex; gap: 10px; justify-content: center; margin-top: var(--space-3); flex-wrap: wrap; }
.success-mark { color: var(--ok); display: flex; justify-content: center; margin-bottom: var(--space-2); }
.success-mark--big { animation: success-pop .6s var(--ease); }
@keyframes success-pop {
  0% { transform: scale(.5); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---- Konto ---------------------------------------------------------------- */
.account-section {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-1);
}
.account-section--danger { border-color: #FECACA; }
.order-list { display: flex; flex-direction: column; gap: var(--space-2); }
.order-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-2); }
.order-card__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: 8px; }
.order-card__no { font-weight: 600; }
.order-card__date { color: var(--ink-2); font-size: 13px; margin-left: 10px; }
.order-card__fulfillment { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.order-card__fulfillment .icon { color: var(--accent); }

.data-list { display: flex; flex-direction: column; margin: var(--space-2) 0; }
.data-list > div {
  display: grid; grid-template-columns: 180px 1fr; gap: var(--space-2);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.data-list dt { color: var(--ink-2); font-weight: 500; }
.data-list dd { margin: 0; }

/* ---- Tabellen ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}
.table th.num { text-align: right; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg); }
.table a { text-decoration: none; color: var(--ink); }
.table a:hover { color: var(--accent); }
.table--compact td, .table--compact th { padding: 7px 10px; font-size: 13px; }
.row--inactive { opacity: .55; }
/* Feste Spaltenbreite: sonst quetscht die Tabellenberechnung die Bildspalte
   bei knappem Platz auf wenige Pixel zusammen — das Bild verschwindet. */
.cell-thumb { width: 48px; }
.cell-thumb img, .thumb-placeholder {
  display: block;
  width: 48px; height: 48px; min-width: 48px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--line);
}
.thumb-placeholder { display: grid; place-items: center; color: var(--ink-3); background: var(--bg); }
.cell-base { display: block; }

/* Produktliste im Adminbereich auf schmalen Bildschirmen: Die sieben Spalten
   passen auf ein Handy nicht nebeneinander — die Tabelle wird deshalb zur
   Kartenliste aus Bild, Name und Preis. Kategorie, Bestand, Status und der
   Bearbeiten-Knopf entfallen hier; der Name führt weiterhin zur Bearbeitung. */
@media (max-width: 768px) {
  .table--products, .table--products tbody, .table--products tr, .table--products td { display: block; }
  .table--products thead { display: none; }
  .table--products tr {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .table--products tr:last-child { border-bottom: 0; padding-bottom: 0; }
  /* Das Bild trägt hier die Übersicht — etwas größer als in der Tabelle. */
  .table--products .cell-thumb { width: 56px; }
  .table--products .cell-thumb img,
  .table--products .thumb-placeholder { width: 56px; height: 56px; min-width: 56px; }
  .table--products td { padding: 0; border: 0; }
  .table--products .col-cat,
  .table--products .col-stock,
  .table--products .col-status,
  .table--products .col-actions,
  .table--products .cell-base { display: none; }
  .table--products .cell-price { text-align: right; white-space: nowrap; font-weight: 600; }
}
.img-preview { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 8px; }
.img-preview img { border-radius: var(--radius-lg); border: 1px solid var(--line); object-fit: cover; }

/* ---- KPI-Kacheln ---------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.kpi {
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--space-2) var(--space-2) var(--space-2);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi__label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
}
.kpi__value {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi--attention { border-left: 3px solid var(--accent); }
.kpi--attention .kpi__value { color: var(--accent); }

.dash-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
  align-items: start;
}

.approve-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.approve-list__item {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.approve-list__item:last-child { border-bottom: 0; }

/* ---- Charts ---------------------------------------------------------------- */
.chart { width: 100%; height: auto; }
.chart text { font-family: var(--font-body); }
.chart-details { margin-top: var(--space-2); }
.chart-details summary {
  cursor: pointer;
  font-size: 13px; color: var(--ink-2);
  padding: 6px 0;
}
.chart-details summary:hover { color: var(--accent); }

/* ---- Toasts ---------------------------------------------------------------- */
.toasts {
  position: fixed; top: calc(var(--header-h) + var(--space-2)); right: var(--space-3); z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 2 * var(--space-3)));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  font-size: 14px;
  opacity: 0; transform: translateX(24px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(-8px); }
.toast .icon { flex: none; margin-top: 2px; }
.toast--success .icon { color: #86EFAC; }
.toast--error .icon { color: #FCA5A5; }
.toast--info .icon { color: var(--accent-2); }
.toast span { flex: 1; }
.toast__close {
  background: none; border: 0; color: rgba(255,255,255,.6);
  cursor: pointer; padding: 2px; border-radius: var(--radius);
  transition: color var(--t-fast);
}
.toast__close:hover { color: #fff; }
html:not(.js) .toast { opacity: 1; transform: none; }

/* ---- Auth (Login/Registrierung/Setup) ------------------------------------------ */
.auth { display: grid; min-height: calc(100vh - 120px); }
.auth--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.auth__brand {
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-5) var(--space-4);
  position: relative;
  overflow: hidden;
}
.auth__brand::after {
  content: "";
  position: absolute; inset: auto -80px -120px auto;
  width: 340px; height: 340px;
  border: 1px solid rgba(217, 164, 65, .35);
  border-radius: 50%;
}
.auth__brand::before {
  content: "";
  position: absolute; inset: auto -40px -180px auto;
  width: 460px; height: 460px;
  border: 1px solid rgba(217, 164, 65, .18);
  border-radius: 50%;
}
.auth__brand-inner { max-width: 380px; }
.auth__brand-kicker { color: var(--accent-2); }
.auth__brand-name {
  font-family: var(--font-serif);
  font-size: clamp(52px, 6vw, 76px);
  font-weight: 400; line-height: 1; letter-spacing: -.01em;
  margin-top: var(--space-2);
}
.auth__brand-tag { color: rgba(255,255,255,.75); font-size: 15px; line-height: 1.7; }
.auth__panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-5) clamp(var(--space-3), 6vw, var(--space-6));
  max-width: 620px;
  width: 100%;
  margin-inline: auto;
}
.auth__panel--wide { max-width: 760px; margin: var(--space-4) auto; }
.auth__title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 4.4vw, 54px);
  font-weight: 400; letter-spacing: -.01em; margin-bottom: 8px;
}
.auth__sub { color: var(--ink-2); font-size: 15px; margin-bottom: var(--space-3); max-width: 46ch; }
.auth__alt { margin-top: var(--space-3); font-size: 14px; color: var(--ink-2); }
.auth__alt a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth__alt a:hover { text-decoration: underline; }

/* ---- Empty States ---------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: var(--space-6) var(--space-3);
  color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .icon { color: var(--ink-3); }
.empty h1, .empty h2 {
  color: var(--ink); font-family: var(--font-serif);
  font-size: 36px; font-weight: 400; letter-spacing: -.005em;
}

/* ---- Rechtstexte ---------------------------------------------------------------- */
.legal { max-width: 760px; }
.legal h1 { margin: var(--space-4) 0 var(--space-2); }
.legal h2 { font-size: 24px; margin: var(--space-3) 0 var(--space-1); }
.legal p, .legal li { color: var(--ink-2); font-size: 15px; }
.legal ul { padding-left: 22px; }
.legal .placeholder {
  background: var(--gold-bg);
  border-bottom: 1px dashed var(--accent);
  padding: 0 4px;
}

/* ---- Reveal-Animationen ---------------------------------------------------------- */
/* Kurz, flach und ohne Nachfedern — bei 70 Kacheln fällt jede Übertreibung auf. */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px) scale(.994);
  transition: opacity .44s var(--ease), transform .44s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.js .reveal.in { opacity: 1; transform: none; will-change: auto; }

/* Sanfte Seitenübergänge (progressive enhancement) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: 140ms; }
::view-transition-new(root) { animation-duration: 220ms; }

/* ---- Reduced Motion ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ---- Responsive ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .checkout { grid-template-columns: 1fr; }
  .checkout__aside { position: static; }
  .detail { gap: var(--space-3); }
}

@media (max-width: 768px) {
  .dash-cols { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .detail__media { position: static; }
  .auth--split { grid-template-columns: 1fr; }
  .auth__brand { padding: var(--space-4) var(--space-3); min-height: 200px; }
  .auth__brand::before, .auth__brand::after { display: none; }
  .auth__panel { padding: var(--space-4) var(--space-3); }
  .form__row { grid-template-columns: 1fr; }
  .form__row--zip { grid-template-columns: 130px 1fr; }

  .nav-toggle { display: grid; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--space-2) var(--space-3) var(--space-3);
    box-shadow: var(--shadow-2);
    gap: 2px;
  }
  .site-nav.open { display: flex; animation: nav-drop .25s var(--ease); }
  @keyframes nav-drop {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
  }
  .site-nav__spacer { display: none; }
  .site-nav__link { min-height: 48px; }
  .cart-link { width: auto; justify-content: flex-start; padding: 10px 14px; }
  .nav-logout__label { display: inline; }

  .cart-item { grid-template-columns: 72px 1fr; }
  .cart-item__media { width: 72px; height: 72px; }
  .cart-item__actions { grid-column: 1 / -1; justify-content: space-between; }
  .choice-grid { grid-template-columns: 1fr; }
  .data-list > div { grid-template-columns: 1fr; gap: 2px; }
  .toasts { top: auto; bottom: var(--space-2); right: var(--space-2); }
}

@media (max-width: 480px) {
  .container, .container--narrow { width: calc(100% - 2 * var(--space-2)); }
  .hero { padding-top: var(--space-4); }
  .product-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-2); }
  .card__body { padding-top: 11px; }
  .card__name { font-size: 20px; }
  .card__cat { font-size: 9.5px; letter-spacing: .12em; }
  .card__cta.btn--primary, .card__cta.btn--ghost { font-size: 10px; letter-spacing: .06em; padding-inline: 8px; }
  .btn-row--spread { flex-direction: column-reverse; align-items: stretch; }
  .sort__label { display: none; }
}

/* ---- Duft-Datenblatt & Preisangaben ------------------------------------------ */
.detail__sub {
  color: var(--ink-2); font-size: 15px;
  margin: -4px 0 12px;
}
.detail__compare {
  margin-left: 10px;
  font-size: 18px; font-weight: 400;
  color: var(--ink-3); text-decoration: line-through;
}
.detail__base { color: var(--ink-3); font-size: 13px; margin: -10px 0 var(--space-2); }
.card__base {
  display: block; font-size: 11px; font-weight: 400; color: var(--ink-3);
  letter-spacing: 0; margin-top: 3px;
}
.card__flag--top { background: var(--primary); color: var(--accent-2); box-shadow: none; }

.specs { margin: 0 0 var(--space-3); border-top: 1px solid var(--line); max-width: 52ch; }
.specs__row {
  display: grid; grid-template-columns: 150px 1fr; gap: var(--space-2);
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; }

/* ---- CSV-Import ---------------------------------------------------------------- */
.import-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-3); align-items: start;
}
.notice--warn { background: var(--gold-bg); border-color: #F0DCB4; color: #7C4A03; }

.issue-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 3px;
  max-height: 360px; overflow-y: auto;
}
.issue {
  display: grid; grid-template-columns: 88px 1fr; gap: var(--space-2);
  padding: 8px 12px; font-size: 13px;
  border-left: 3px solid; border-radius: var(--radius);
}
.issue--error { border-color: var(--danger); background: var(--danger-bg); color: #7F1D1D; }
.issue--warn { border-color: var(--accent-2); background: var(--gold-bg); color: #7C4A03; }
.issue__line { font-weight: 600; letter-spacing: .04em; }
.issue__msg { display: block; }
.issue__msg + .issue__msg { margin-top: 4px; }

.rule-list {
  margin: var(--space-1) 0 0; padding-left: 18px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; color: var(--ink-2);
}
.rule-list code, .table code, .field__hint code {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1px 5px;
  font-size: 12.5px;
}
.import-log { list-style: none; margin: var(--space-1) 0 0; padding: 0; }
.import-log li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.btn-row--center { justify-content: center; }

@media (max-width: 860px) {
  .import-cols { grid-template-columns: 1fr; }
  .specs__row { grid-template-columns: 120px 1fr; gap: var(--space-1); }
  .issue { grid-template-columns: 1fr; gap: 2px; }
}

/* ---- Kollektion: Filter & Ergebnisse -------------------------------------- */
.shop-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  padding-bottom: var(--space-5);
}
/* Sticky, aber nie höher als der Bildschirm — sonst wäre der „Anzeigen“-Knopf
   am unteren Ende bei vielen Facetten nicht mehr erreichbar. */
.shop-filters {
  position: sticky; top: calc(var(--header-h) + var(--space-2));
  max-height: calc(100vh - var(--header-h) - 2 * var(--space-2));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
}
/* Kein Kasten: die Spalte steht auf dem Seitengrund, nur eine Haarlinie
   trennt sie vom Raster. */
.filters__body {
  background: transparent; border: 0; box-shadow: none;
  padding: 0 var(--space-3) var(--space-3) 0;
  display: flex; flex-direction: column; gap: 2px;
}
.filters__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-1);
  padding-bottom: var(--space-2);
}
.filters__title {
  font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink);
}

/* Dezente Bildlaufleisten — die Standardleisten von Windows zerschneiden die
   Spalte optisch (Firefox: scrollbar-width, alle anderen: ::-webkit). */
.shop-filters, .filter-group__scroll { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.shop-filters::-webkit-scrollbar, .filter-group__scroll::-webkit-scrollbar { width: 4px; }
.shop-filters::-webkit-scrollbar-track, .filter-group__scroll::-webkit-scrollbar-track { background: transparent; }
.shop-filters::-webkit-scrollbar-thumb, .filter-group__scroll::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 99px;
}

/* Auf- und zuklappbare Facette. Ohne JavaScript funktioniert <details> genauso. */
.filter-group {
  border: 0; border-top: 1px solid var(--line);
  margin: 0; padding: 0;
}
.filter-group__head {
  display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 12px 0;
  list-style: none; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--ease);
}
.filter-group__head::-webkit-details-marker { display: none; }
.filter-group__head:hover { color: var(--ink); }
.filter-group[open] > .filter-group__head { color: var(--ink); }
.filter-group__head .icon {
  margin-left: auto; color: var(--ink-3);
  transition: transform var(--t-med) var(--ease);
}
.filter-group[open] > .filter-group__head .icon { transform: rotate(180deg); }
/* Punkt statt Zahl: zeigt „hier ist etwas ausgewählt“, ohne die Zeile zu füllen. */
.filter-group__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.filter-group__panel { padding-bottom: var(--space-2); display: flex; flex-direction: column; gap: 2px; }
/* Lange Listen (Marke, Duftfamilie): auf volle Zeilen begrenzt, damit der
   Schnitt nicht mitten in einem Eintrag liegt. */
.filter-group__scroll {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 216px; overflow-y: auto;
  margin-right: -6px; padding-right: 6px;
  overscroll-behavior: contain;
}
.filter-opt {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  min-height: 40px; padding: 7px 6px; margin: 0 -6px;
  border-radius: var(--radius);
  font-size: 14px; color: var(--ink-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.filter-opt:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); }
.filter-opt:has(input:checked) { color: var(--ink); font-weight: 500; }
.filter-opt input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.filter-opt__count { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.filter-opt--solo {
  grid-template-columns: auto 1fr;
  border-top: 1px solid var(--line); padding-top: var(--space-2); margin-top: 0;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip input {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  clip-path: inset(50%); overflow: hidden;
}
.filter-chip span {
  display: inline-flex; align-items: center;
  min-height: 38px; padding: 8px 15px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.filter-chip span:hover { border-color: var(--ink); color: var(--ink); }
.filter-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.filter-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.filter-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.filter-range__dash { color: var(--ink-3); }
.filter-range .field input { padding-left: 12px; padding-right: 12px; }

.shop-main { min-width: 0; }

.filters__actions {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line); padding-top: var(--space-2); margin-top: var(--space-1);
}
.filters__toggle { display: none; }
.filters__badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
}

/* Zählwerk links, Sortierung rechts — beides über dem Raster, wo es gesucht
   wird. Steht bewusst außerhalb von [data-results], damit der Live-Filter die
   geöffnete Auswahlliste nicht unter der Hand austauscht. */
.results__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}
.results__count {
  font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2);
}
.results__count strong { color: var(--ink); }

.sort { display: flex; align-items: center; gap: 10px; }
.sort__label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
}
.sort__select {
  appearance: none; -webkit-appearance: none;
  background: transparent no-repeat right 0 center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A8A29E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  border: 0; border-bottom: 1px solid var(--line-2);
  padding: 8px 22px 8px 0; min-height: 40px;
  font-size: 14px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}
.sort__select:hover { border-bottom-color: var(--ink); }
.sort__select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.shop-results .chips { margin-bottom: var(--space-3); }
.chip--remove { padding: 8px 14px; min-height: 38px; gap: 6px; font-size: 13px; }
.chip--remove .icon { color: var(--ink-3); }
.chip--remove:hover .icon { color: var(--danger); }

@keyframes filters-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
  .shop-layout { grid-template-columns: 1fr; gap: var(--space-2); }
  .shop-filters {
    position: static; margin-bottom: var(--space-1);
    max-height: none; overflow: visible;
    border-right: 0;                        /* Spaltenlinie ergibt hier keinen Sinn */
  }
  /* Als aufklappendes Panel bekommt die Spalte ihre Kante zurück. */
  .filters__body {
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    padding: var(--space-1) var(--space-3) var(--space-3);
  }
  .filters__head { display: none; }
  .filters__toggle {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 50px; padding: 12px 20px;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
    font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--ink); cursor: pointer;
  }
  .filters__toggle .icon { color: var(--accent); }
  .filters__toggle[aria-expanded="true"] { border-color: var(--ink); }
  /* Ohne JavaScript bleibt das Formular sichtbar und voll benutzbar. */
  .js .shop-filters:not(.is-open) .filters__body { display: none; }
  .js .shop-filters.is-open .filters__body { margin-top: 10px; animation: filters-drop .25s var(--ease); }
  .filter-group__scroll { max-height: 200px; }
  /* „Anzeigen“ bleibt beim Durchscrollen des Panels erreichbar — die Leiste
     reicht dafür bis an die Panelkanten. */
  .filters__actions {
    position: sticky; bottom: 0;
    background: var(--surface);
    margin: 0 calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .results__head { padding-bottom: 12px; margin-bottom: var(--space-2); }
  .sort { flex: 1; justify-content: flex-end; }
}

/* ---- Live-Filter ----------------------------------------------------------- */
/* Muss die Klassenregeln von .btn & Co. schlagen, sonst bleibt ein per
   JavaScript ausgeblendetes Element sichtbar. */
[hidden] { display: none !important; }

/* Sichtbarkeit des Absendeknopfs steuert main.js über das hidden-Attribut:
   Desktop filtert sofort, auf dem Handy bleibt er als „N Artikel ansehen“.
   Ohne JavaScript ist er überall sichtbar und das Formular ganz normal. */
.shop-results { transition: opacity var(--t-fast) var(--ease); }
.shop-results.is-loading { opacity: .45; pointer-events: none; }
