/* ============================================================================
   warenkorb.css — Korb-Knopf in der Nav und Schublade (js/warenkorb.js)
   Farben, Radien und Schatten aus den Tokens in style.css (CI «Papier und Tinte»).
   ========================================================================== */

/* ── Schwebender Knopf unten rechts (Levin, 06.10.: nicht in der Navbar) ── */
.wk-fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 1200;
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 14px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-pill); background: var(--ink); color: var(--on-ink);
  font: inherit; font-size: .95rem; font-weight: 600; letter-spacing: -0.01em; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 18px 40px -16px rgba(0, 0, 0, .55);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, opacity .3s var(--ease);
  animation: wk-fab-rein .6s cubic-bezier(.22, 1, .36, 1) .3s both;
}
.wk-fab:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .2), 0 24px 50px -18px rgba(0, 0, 0, .6); }
.wk-fab:active { transform: scale(.96); }
.wk-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.wk-fab__icon { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
.wk-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wk-fab__count {
  position: absolute; top: -7px; right: -9px; min-width: 19px; height: 19px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: var(--radius-pill);
  font-size: .68rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--on-ink); color: var(--text); box-shadow: 0 0 0 2px var(--ink);
  transform: scale(0); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.wk-fab.has-items .wk-fab__count { transform: scale(1); }
.wk-fab.is-bump { animation: wk-bump .55s cubic-bezier(.34, 1.56, .64, 1); }
.wk-fab.is-bump .wk-fab__count { animation: wk-zahl .55s cubic-bezier(.34, 1.56, .64, 1); }
.wk-fab.is-hinzu { background: var(--accent-hover); }
html.wk-offen .wk-fab { opacity: 0; pointer-events: none; transform: translateY(12px); }
@keyframes wk-fab-rein { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes wk-bump { 0% { transform: scale(1); } 35% { transform: scale(1.12) rotate(-3deg); } 70% { transform: scale(.97) rotate(1deg); } 100% { transform: none; } }
@keyframes wk-zahl { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
@media (max-width: 480px) {
  .wk-fab { height: 50px; padding: 0 18px 0 13px; font-size: .9rem; }
}

/* Flugbild beim Hinzufügen */
.wk-flug { position: fixed; z-index: 3000; object-fit: cover; pointer-events: none; box-shadow: var(--shadow-hover); will-change: transform, opacity; }

/* ── Schublade ── */
html.wk-sperre, html.wk-sperre body { overflow: hidden; }
.wk { position: fixed; inset: 0; z-index: 2500; }
.wk[hidden] { display: none; }
.wk__scrim { position: absolute; inset: 0; background: rgba(10, 10, 10, .42); opacity: 0; transition: opacity .4s var(--ease);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.wk.is-offen .wk__scrim { opacity: 1; }
.wk__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .45);
  transform: translateX(104%); transition: transform .45s cubic-bezier(.22, 1, .36, 1);
  outline: none;
}
.wk.is-offen .wk__panel { transform: none; }

.wk__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.wk__title { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; }
.wk__count { color: var(--text-dim); font-weight: 500; font-variant-numeric: tabular-nums; }
.wk__close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer; color: var(--text); transition: background-color .2s; }
.wk__close:hover { background: var(--surface-2); }
.wk__close:focus-visible, .wk-item__weg:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.wk__close svg, .wk-item__weg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.wk__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 8px 24px 18px; }
.wk__list { list-style: none; margin: 0; padding: 0; }

/* Artikel */
.wk-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 34px; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line); overflow: hidden; border-radius: 0; }
.wk-item.is-neu { animation: wk-rein .5s cubic-bezier(.22, 1, .36, 1) both; }
.wk-item.is-hervor { animation: wk-rein .5s cubic-bezier(.22, 1, .36, 1) both, wk-leucht 1.4s ease .1s; }
.wk-item.is-weg { transition: height .28s var(--ease), opacity .2s ease, transform .28s var(--ease), padding .28s var(--ease);
  height: 0 !important; opacity: 0; transform: translateX(30px); padding-top: 0; padding-bottom: 0; }
@keyframes wk-rein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wk-leucht { 0%, 100% { background: transparent; } 30% { background: var(--surface-2); } }
.wk-item__img { display: block; width: 64px; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.wk-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wk-item__txt { min-width: 0; display: grid; gap: 3px; }
.wk-item__name { font-weight: 600; font-size: .98rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.wk-item__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.wk-item__sub { font-size: .8rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-item__preis { display: grid; justify-items: end; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-item__preis s { font-size: .78rem; font-weight: 400; color: var(--text-dim); }
.wk-item__weg { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-dim); cursor: pointer; transition: background-color .2s, color .2s; }
.wk-item__weg:hover { background: var(--surface-2); color: var(--text); }
.wk-item__weg svg { width: 15px; height: 15px; }

/* Leer */
.wk__empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 48px 12px 28px; animation: wk-rein .4s var(--ease) both; }
.wk__empty[hidden] { display: none; }
.wk__empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); margin-bottom: 8px; }
.wk__empty-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wk__empty-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.wk__empty-sub { margin: 0 0 10px; color: var(--text-dim); font-size: .9rem; }
.wk__empty-link { font-size: .9rem; font-weight: 600; color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* Fuss: Rabatt, Summen, Kasse */
.wk__foot { border-top: 1px solid var(--line); padding: 16px 24px calc(18px + env(safe-area-inset-bottom)); background: var(--surface); display: grid; gap: 10px; }
.wk__foot.is-leer .wk__code, .wk__foot.is-leer .wk__code-msg, .wk__foot.is-leer .wk__sum,
.wk__foot.is-leer .wk__checkout, .wk__foot.is-leer .wk__secure, .wk__foot.is-leer .wk__legal { display: none; }
.wk__foot.is-leer:not(:has(.wk__undo:not([hidden]))):not(:has(#promoWheel:not([hidden]))) { display: none; }
.wk__undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--on-ink); font-size: .86rem; animation: wk-rein .3s var(--ease) both; }
.wk__undo[hidden] { display: none; }
.wk__undo button { border: 0; background: transparent; color: var(--on-ink); font-weight: 700; font-size: .86rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.wk__undo button:focus-visible { outline: 2px solid var(--on-ink); outline-offset: 2px; }
.wk__wheel:empty { display: none; }
.wk__wheel .promo-widget__wheel { width: 100%; margin: 0; }
.wk__wheel .promo-widget__timer { margin: 6px 0 0; }

.wk__code { display: flex; gap: 8px; }
.wk__code-input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; letter-spacing: .04em; text-transform: uppercase; transition: border-color .2s, box-shadow .2s; }
.wk__code-input::placeholder { text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.wk__code-input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.wk__code-input[readonly] { background: var(--surface-2); border-color: transparent; }
.wk__code-btn { flex: 0 0 auto; height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: background-color .2s, border-color .2s; }
.wk__code-btn:hover { background: var(--surface-2); }
.wk__code-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.wk__code-btn:disabled { opacity: .5; cursor: wait; }
.wk__code-msg { margin: -2px 0 0; min-height: 0; font-size: .8rem; color: var(--text-dim); }
.wk__code-msg:empty { display: none; }
.wk__code-msg.is-ok { color: var(--ok); }
.wk__code-msg.is-err { color: var(--danger); }

.wk__sum { margin: 4px 0 0; display: grid; gap: 6px; font-size: .9rem; }
.wk__sum > div { display: flex; justify-content: space-between; gap: 12px; }
.wk__sum > div[hidden] { display: none; }
.wk__sum dt { color: var(--text-dim); }
.wk__sum dd { margin: 0; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.wk__sum-disc dd { color: var(--ok); font-weight: 600; }
.wk__sum-total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 1.05rem; }
.wk__sum-total dt { color: var(--text); font-weight: 600; }
.wk__sum-total dd { font-weight: 700; }
.wk.is-rechnet .wk__sum dd, .wk.is-rechnet .wk-item__preis { opacity: .45; }

.wk__err { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(194, 56, 47, .08); color: var(--danger); font-size: .85rem; }
.wk__err[hidden] { display: none; }

.wk__checkout { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; margin-top: 4px;
  border: 0; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-ink); font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; box-shadow: var(--shadow-btn); transition: background-color .2s, transform .2s var(--ease), box-shadow .2s; font-variant-numeric: tabular-nums; }
.wk__checkout:hover { background: var(--accent-hover); box-shadow: var(--shadow-btn-dark); }
.wk__checkout:active { transform: scale(.985); }
.wk__checkout:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.wk__checkout:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.wk__checkout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.wk__checkout:hover svg { transform: translateX(3px); }
.wk__secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 0; font-size: .78rem; color: var(--text-dim); }
.wk__secure svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wk__legal { margin: 0; text-align: center; font-size: .74rem; color: var(--text-dim); }
.wk__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── Knöpfe auf den Seiten: «In den Warenkorb» ── */
.cart-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 26px;
  border: 1px solid var(--accent); border-radius: var(--radius-pill); background: var(--accent); color: var(--on-ink);
  font: inherit; font-size: .95rem; font-weight: 500; letter-spacing: 0; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-btn); transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.cart-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-btn-dark); }
.cart-btn:active { transform: scale(.97); }
.cart-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.cart-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cart-btn .cart-btn__check { display: none; }
.cart-btn.is-drin { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: none; }
.cart-btn.is-drin .cart-btn__plus { display: none; }
.cart-btn.is-drin .cart-btn__check { display: block; }
.cart-btn:disabled, .cart-btn.is-soon { opacity: .55; cursor: not-allowed; box-shadow: none; background: var(--surface-2); color: var(--text-dim); border-color: transparent; }
.cart-btn--light { background: var(--on-ink); color: var(--text); border-color: var(--on-ink); }
.cart-btn--light:hover { background: rgba(255, 255, 255, .88); }
.cart-btn--light.is-drin { background: rgba(255, 255, 255, .14); color: var(--on-ink); border-color: rgba(255, 255, 255, .4); }
.cart-btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); box-shadow: none; }
.cart-btn--ghost:hover { background: var(--surface-2); box-shadow: none; }
.cart-btn--ghost-light { background: transparent; color: var(--on-ink); border-color: rgba(255, 255, 255, .45); box-shadow: none; }
.cart-btn--ghost-light:hover { background: rgba(255, 255, 255, .12); box-shadow: none; }
.cart-btn--sm { min-height: 42px; padding: 0 18px; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  .wk__panel, .wk__scrim { transition: none; }
  .wk-item.is-neu, .wk-item.is-hervor, .wk__empty, .wk__undo { animation: none; }
  .wk-fab, .wk-fab.is-bump, .wk-fab.is-bump .wk-fab__count { animation: none; }
}
