/* =========================================================
   Shop auf der Speisekarte: „+“-Buttons, Auswahl-Dialog, Warenkorb (Drawer, Leiste, Button), Hinweise.
   Wird nur bei aktivem Shop geladen. Nutzt die Tokens aus /css/style.css und die sk-*-Variablen der Speisekarte.
   ========================================================= */

.sk-btn[hidden], .sk-toast__undo[hidden], .sk-cart__empty[hidden]{ display: none !important; }
.sk-btn:disabled, .sk-btn[aria-disabled="true"]{ opacity: .55; cursor: not-allowed; box-shadow: none; }
.sk-btn--primary:disabled:hover{ background: var(--accent); border-color: var(--accent); }

/* ---------- „+“-Buttons ---------- */
.sk-add{
  flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  display: inline-grid; place-items: center;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
  box-shadow: 0 8px 22px rgba(222,10,23,.28);
}
.sk-add svg{ grid-area: 1 / 1; width: 20px; height: 20px; }
.sk-add:hover{ background: #c40913; border-color: #c40913; }
.sk-add:active{ transform: scale(.92); }
.sk-add:focus-visible{ outline: 2px solid #fff; outline-offset: 3px; }
.sk-add[aria-disabled="true"]{
  cursor: not-allowed; color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); box-shadow: none;
}

/* Hinzugefügt: „+“ dreht/schrumpft weg, Häkchen wird gezeichnet und ploppt auf (Rot → Grün), danach zurück zum „+“.
   Neustart per JS (Klasse entfernen, Reflow, neu setzen) – Animationen stapeln sich nicht. */
.sk-add__check{ opacity: 0; transform: scale(.6); }
/* Häkchen etwas größer als das „+“ (22 statt 20 px): wirkt im 44-px-Kreis gleich schwer */
.sk-add svg.sk-add__check{ width: 22px; height: 22px; }
.sk-add__check path{ stroke-dasharray: 1; stroke-dashoffset: 1; }
.sk-add.is-added,
.sk-add.is-added:hover{ background: #1f9d61; border-color: #1f9d61; box-shadow: 0 8px 22px rgba(31,157,97,.32); }
.sk-add.is-added .sk-add__plus{ opacity: 0; }
.sk-add.is-added .sk-add__check{ opacity: 1; transform: none; }
.sk-add.is-added .sk-add__check path{ stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference){
  .sk-add{ transition: background .3s var(--sk-ease), border-color .3s var(--sk-ease), box-shadow .3s var(--sk-ease), transform .2s var(--sk-ease); }
  .sk-add__plus{ transition: transform .35s var(--sk-ease), opacity .25s ease; }
  .sk-add__check{ transition: transform .3s var(--sk-ease), opacity .2s ease; }
  .sk-add.is-added .sk-add__plus{ transform: rotate(90deg) scale(.3); }
  .sk-add.is-added .sk-add__check{ animation: sk-check-pop .42s var(--sk-ease) both; }
  .sk-add.is-added .sk-add__check path{ animation: sk-check-draw .32s .1s ease-out both; }
}
@keyframes sk-check-pop{ 0%{ opacity: 0; transform: scale(.6); } 60%{ opacity: 1; transform: scale(1.1); } 100%{ opacity: 1; transform: scale(1); } }
@keyframes sk-check-draw{ from{ stroke-dashoffset: 1; } to{ stroke-dashoffset: 0; } }

/* Listen-Eintrag: Button neben dem Preis */
.sk-item:has(> .sk-add--item){ grid-template-columns: 1fr auto 44px; }
.sk-add--item{ grid-column: 3; grid-row: 1 / span 2; align-self: start; margin-top: -10px; }
@media (max-width: 767px){ .sk-item:has(> .sk-add--item){ gap: 4px 12px; } }

/* Bestseller-Karte: Button liegt als Geschwister über der Bildecke (nicht im Link verschachtelt) */
.sk-cardwrap{ position: relative; display: flex; min-width: 0; scroll-snap-align: start; }
.sk-cardwrap[hidden], .sk-cardwrap:has(> .sk-card[hidden]){ display: none !important; }
.sk-cardwrap > .sk-card{ flex: 1; min-width: 0; }
.sk-add--card{ position: absolute; top: 10px; right: 10px; z-index: 2; transition: background .2s var(--sk-ease), transform .35s var(--sk-ease); }
.sk-cardwrap:hover > .sk-card{ transform: translateY(-3px); border-color: rgba(255,255,255,.18); background: var(--sk-card-hover); }
.sk-cardwrap:hover > .sk-add--card{ transform: translateY(-3px); }
.sk-cardwrap:hover > .sk-add--card:active{ transform: translateY(-3px) scale(.92); }

/* ---------- Hinweis „pausiert“ / Shop-Hinweis ---------- */
.sk-shopnote{
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 clamp(16px, 2.5vw, 24px); padding: 14px 16px; border-radius: 18px;
  background: rgba(255,255,255,.05); border: 1px solid var(--sk-line); color: var(--muted);
  font-size: 14px; line-height: 1.55;
}
.sk-shopnote.is-paused{ background: rgba(222,10,23,.12); border-color: rgba(222,10,23,.45); color: #ffe3e5; }
.sk-shopnote__icon{ flex: none; width: 20px; height: 20px; margin-top: 1px; color: #ff8a92; }
.sk-shopnote p{ margin: 0; }
.sk-shopnote p + p{ margin-top: 4px; }
.sk-shopnote strong{ color: #fff; font-weight: 500; }
.sk-shopnote a{ color: #fff; text-underline-offset: 3px; }
.sk-shopnote a:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* ---------- Warenkorb-Leiste (mobil) ---------- */
.sk-cartbar__text{ font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-cartbar{ gap: 8px; }
.sk-cartbar__text{ overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: no-preference){
  .sk-cartbar.is-bump{ animation: sk-bump .4s var(--sk-ease); }
}
@keyframes sk-bump{ 0%,100%{ transform: none; } 40%{ transform: scale(1.06); } }

/* ---------- Dialoge (Auswahl & Warenkorb) ---------- */
/* Scroll-Sperre über body (html hat height:100%; overflow am html würde body zum Scroller machen und die Position verlieren) */
html.sk-modal-open body{ overflow: hidden; }
.sk-dlg{
  padding: 0; border: 1px solid rgba(255,255,255,.12); color: var(--text, #fff);
  background: #141416; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  max-width: none; max-height: none; overflow: hidden;
}
.sk-dlg::backdrop{ background: rgba(0,0,0,.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sk-dlg__inner{ position: relative; display: flex; flex-direction: column; max-height: inherit; min-height: 0; }
.sk-dlg__head{ display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 12px; }
.sk-dlg__title{ margin: 0; font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
.sk-dlg__close{
  flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.sk-dlg__close:hover{ background: rgba(255,255,255,.12); }
.sk-dlg__close svg{ width: 18px; height: 18px; }
.sk-dlg__body{ flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 16px; }
.sk-dlg__foot{ flex: none; display: grid; gap: 10px; padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sk-line); background: rgba(20,20,22,.96); }
.sk-dlg :focus-visible{ outline: 2px solid #fff; outline-offset: 3px; }
.sk-dlg .sk-btn{ width: 100%; color: #fff; text-decoration: none; }

/* Auswahl-Dialog: Desktop mittig, mobil als Sheet von unten */
.sk-opt{ width: min(520px, calc(100vw - 32px)); max-height: min(88dvh, 760px); border-radius: 24px; margin: auto; }
.sk-opt__desc{ margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.sk-opt__allergens{ margin: 0 0 14px; color: var(--sk-faint); font-size: 12px; line-height: 1.5; }
.sk-opt__base{ margin: 0 0 6px; font-size: 15px; font-variant-numeric: tabular-nums; color: #fff; }
.sk-group{ margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.sk-group__legend{ display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 0; margin: 0 0 8px; font-size: 16px; font-weight: 500; color: #fff; }
.sk-group__meta{ font-size: 12px; font-weight: 400; color: var(--sk-faint); }
.sk-group__badge{ display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #ffd7d9; background: var(--accent-soft); border: 1px solid rgba(222,10,23,.45); }
.sk-group__badge.is-ok{ color: #b6f0d3; background: rgba(48,195,124,.14); border-color: rgba(48,195,124,.4); }
.sk-group__help{ margin: -4px 0 10px; font-size: 13px; line-height: 1.45; color: var(--sk-faint); }
/* Zutaten (Salat): abgewählte Standard-Zutaten durchgestrichen, damit „ohne …“ auf einen Blick sichtbar ist */
.sk-group--removal .sk-choice.is-default:has(input:not(:checked)) .sk-choice__name{ text-decoration: line-through; color: var(--sk-faint); }
.sk-choice{
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; margin: 0 0 6px;
  border-radius: 14px; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--sk-line);
  transition: background .2s var(--sk-ease), border-color .2s var(--sk-ease);
}
.sk-choice:hover{ background: rgba(255,255,255,.07); }
.sk-choice:has(input:checked){ border-color: rgba(222,10,23,.65); background: rgba(222,10,23,.1); }
.sk-choice:has(input:focus-visible){ outline: 2px solid #fff; outline-offset: 2px; }
.sk-choice.is-disabled{ cursor: not-allowed; opacity: .5; }
.sk-choice input{ flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.sk-choice input:focus-visible{ outline: none; }
.sk-choice__name{ flex: 1; min-width: 0; font-size: 15px; }
.sk-choice__delta{ flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sk-opt__row{ display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* Ändern einer Zeile mit Menge > 1: „Alle N · Nur 1 · Anzahl wählen“ */
.sk-scope{ margin: 0 0 14px; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--sk-line); min-width: 0; }
.sk-seg{ display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--sk-line); }
.sk-seg__opt{ flex: 1; position: relative; display: grid; place-items: center; min-height: 40px; padding: 0 10px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--muted); text-align: center; transition: background .2s var(--sk-ease), color .2s var(--sk-ease); }
.sk-seg__opt[hidden]{ display: none; }
.sk-seg__opt input{ position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sk-seg__opt:has(input:checked){ background: var(--accent); color: #fff; }
.sk-seg__opt:has(input:focus-visible){ outline: 2px solid #fff; outline-offset: 2px; }
.sk-scope__count{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.sk-scope__count[hidden], .sk-opt__row[hidden]{ display: none; }
.sk-opt__qtylabel{ font-size: 14px; color: var(--muted); }
.sk-opt__hint{ margin: 0; font-size: 13px; color: #ff9ca3; }
.sk-opt__hint:empty{ display: none; }

/* Mengen-Stepper */
.sk-stepper{ display: inline-flex; align-items: center; gap: 4px; padding: 2px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--sk-line); }
.sk-stepper__btn{
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: transparent; border: 0; font: inherit;
}
.sk-stepper__btn:hover{ background: rgba(255,255,255,.08); }
.sk-stepper__btn[aria-disabled="true"]{ opacity: .35; cursor: not-allowed; }
.sk-stepper__btn svg{ width: 16px; height: 16px; }
.sk-stepper__val{ min-width: 2ch; text-align: center; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Warenkorb: Desktop rechts, mobil als Sheet von unten */
.sk-cart{ margin: 0 0 0 auto; width: min(440px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 24px 0 0 24px; border-right: 0; }
@media (min-width: 768px){ .sk-cart .sk-dlg__inner{ height: 100%; } }
.sk-cart__count{ display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--sk-faint); }
.sk-cart__lines{ list-style: none; margin: 0; padding: 0; }
.sk-line{ display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--sk-line); }
.sk-line:first-child{ border-top: 0; padding-top: 4px; }
.sk-line__top{ display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sk-line__name{ margin: 0; font-size: 16px; font-weight: 500; line-height: 1.35; }
.sk-line__total{ font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-line__opts{ margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.sk-line__row{ display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sk-line__remove{
  min-height: 44px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.sk-line__remove:hover, .sk-line__edit:hover{ color: #fff; }
.sk-line__actions{ display: flex; align-items: center; gap: 2px; }
.sk-line__edit{
  min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.sk-cart__empty{ margin: 24px 0; text-align: center; color: var(--muted); }
.sk-cart__sum{ display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 16px; }
.sk-cart__sum strong{ font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
/* Pfand: eigene Zeilen im Warenkorb, Hinweis „zzgl. … Pfand“ an Preisen */
.sk-cart__row{ display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sk-cart__row[hidden]{ display: none; }
.sk-line__deposit, .sk-deposit{ font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sk-cart__note{ margin: -4px 0 2px; font-size: 12px; color: var(--sk-faint); }
.sk-cart .sk-shopnote{ margin: 0 0 14px; }

@media (max-width: 767px){
  .sk-opt, .sk-cart{
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0;
    border-bottom: 0; border-right: 1px solid rgba(255,255,255,.12);
  }
  .sk-opt{ max-height: 92dvh; }
  .sk-cart{ height: fit-content; max-height: 88dvh; }
  .sk-cart .sk-dlg__inner{ max-height: 88dvh; }
  .sk-opt .sk-dlg__inner{ max-height: 92dvh; }
  .sk-dlg__head{ padding-top: 22px; }
  .sk-dlg__head::before{ content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(255,255,255,.2); }
}

@media (prefers-reduced-motion: no-preference){
  .sk-opt[open]{ animation: sk-dlg-in .28s var(--sk-ease); }
  .sk-cart[open]{ animation: sk-cart-in .32s var(--sk-ease); }
  .sk-dlg[open]::backdrop{ animation: sk-fade .28s ease; }
  @media (max-width: 767px){
    .sk-opt[open], .sk-cart[open]{ animation: sk-sheet-in .32s var(--sk-ease); }
  }
}
@keyframes sk-dlg-in{ from{ opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes sk-cart-in{ from{ transform: translateX(100%); } }
@keyframes sk-sheet-in{ from{ transform: translateY(100%); } }
@keyframes sk-fade{ from{ opacity: 0; } }

/* ---------- Kurze Bestätigung (Toast) ---------- */
.sk-toast{
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 12px; max-width: min(92vw, 460px);
  padding: 10px 10px 10px 16px; border-radius: 16px;
  color: #fff; background: rgba(28,28,31,.96); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  transform: translate(-50%, 0); opacity: 1; transition: opacity .25s ease, transform .25s var(--sk-ease);
}
.sk-toast.is-idle{ opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.sk-toast.is-idle .sk-toast__undo{ visibility: hidden; }
@media (min-width: 768px){ .sk-toast{ bottom: calc(32px + env(safe-area-inset-bottom)); } }
.sk-dlg .sk-toast{ position: absolute; bottom: calc(190px + env(safe-area-inset-bottom)); }
.sk-toast__msg{ margin: 0; font-size: 14px; line-height: 1.4; min-height: 1.4em; padding: 4px 0; }
.sk-toast__undo{
  flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: #fff;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
}
.sk-toast__undo:hover{ background: rgba(255,255,255,.16); }
.sk-toast__undo:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){
  .sk-toast, .sk-add--card{ transition: none; }
}
.sk-cart__total{ display: grid; gap: 10px; }
.sk-cart__total[hidden]{ display: none; }
.sk-cart__sum{ margin: 0; }
