/* PAW Spark Theme – Sales-Booster + Popups (frontend/js/spark-boost.js). Alles mit Präfix sp-.
   Farben/Formen aus den Theme-Variablen --sp-* (html.paw-spark), sonst eigene Standardwerte → sieht auch unter fremden Templates gut aus.
   Bewegung: nur transform/opacity, cubic-bezier(.23,1,.32,1), < 300 ms, Eingänge mit backwards, Hover nur mit Maus, reduced-motion = keine. */

.sp-b {
    --b-acc: var(--sp-accent, #4f46e5);
    --b-on-acc: var(--sp-on-accent, #ffffff);
    --b-pri: var(--sp-primary, #111111);
    --b-on-pri: var(--sp-on-primary, #ffffff);
    --b-text: var(--sp-text, #111111);
    --b-bg: var(--sp-bg, #ffffff);
    --b-surf: var(--sp-surface, #f3f4f6);
    --b-line: var(--sp-border, #e5e7eb);
    --b-muted: var(--sp-muted, #6b7280);
    --b-price: var(--sp-price, #c62828);
    --b-r: var(--sp-radius, 16px);
    --b-btn-r: var(--sp-btn-r, 999px);
    --b-ease: cubic-bezier(.23, 1, .32, 1);
    /* Töne aus Theme-Farben gemischt: Schrift ≥ 4,5:1 auf hellem wie dunklem Grund */
    --b-ok: color-mix(in srgb, #16a34a 72%, var(--b-text));
    --b-ok-bg: color-mix(in srgb, #16a34a 10%, var(--b-bg));
    --b-hot: color-mix(in srgb, var(--b-price) 72%, var(--b-text));
    --b-hot-bg: color-mix(in srgb, var(--b-price) 8%, var(--b-bg));
    --b-acc-ink: color-mix(in srgb, var(--b-acc) 58%, var(--b-text));
    --b-acc-bg: color-mix(in srgb, var(--b-acc) 9%, var(--b-bg));
    --b-track: color-mix(in srgb, var(--b-text) 9%, var(--b-bg));
    --b-soft: color-mix(in srgb, var(--b-text) 6%, var(--b-bg));
    box-sizing: border-box;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .sp-b {
        --b-ok: #15803d; --b-ok-bg: #ecfdf3; --b-hot: #a11d1d; --b-hot-bg: #fdf0f0;
        --b-acc-ink: #3730a3; --b-acc-bg: #eef0ff; --b-track: #e9eaee; --b-soft: #f1f2f4;
    }
}
.sp-b *, .sp-b *::before, .sp-b *::after { box-sizing: border-box; }
.sp-b p, .sp-b h2 { margin: 0; }
.sp-b button { font-family: inherit; letter-spacing: normal; text-transform: none; margin: 0; box-shadow: none; -webkit-appearance: none; appearance: none; }
.sp-b :focus-visible { outline: 3px solid color-mix(in srgb, var(--b-acc) 75%, transparent); outline-offset: 2px; }
.sp-i { display: inline-flex; flex: none; width: 1em; height: 1em; line-height: 1; }
.sp-i svg { display: block; width: 100%; height: 100%; }
.sp-v { font-weight: 800; }
.sp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sp-rel { position: relative; }
.sp-slot:empty, .sp-free[hidden] { display: none; }
.sp-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sp-dot-ok { width: 7px; height: 7px; background: #16a34a; }

/* ── Balken (Lager, Versandkostenfrei): Füllung per translateX, Ende bleibt rund ── */
.sp-bar { display: block; position: relative; height: 6px; border-radius: 999px; background: var(--b-track); overflow: hidden; }
.sp-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--b-price);
    transform: translateX(calc((var(--p, 0) - 1) * 100%)); transition: transform .28s var(--b-ease); }

/* ── Artikelseite ──────────────────────────────────────────── */
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.sp-chip { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; line-height: 1.35;
    font-weight: 600; color: var(--b-acc-ink); background: var(--b-acc-bg); }
.sp-chip-hot { color: var(--b-hot); background: var(--b-hot-bg); }

.sp-pricebox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.sp-save, .sp-cd { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 14px; line-height: 1.35; font-weight: 600; }
.sp-save { color: var(--b-ok); background: var(--b-ok-bg); }
.sp-cd { color: var(--b-hot); background: var(--b-hot-bg); }
.sp-cd .sp-i { font-size: 15px; }
.sp-cd-v { font-weight: 800; font-variant-numeric: tabular-nums; }

.sp-stock { max-width: 360px; margin: 10px 0 6px; }
.sp-stock-t { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.35; font-weight: 600; color: var(--b-hot); }
.sp-stock .sp-bar { margin-top: 8px; }

.sp-buybox { display: grid; gap: 14px; margin: 16px 0 4px; padding: 14px 16px; border: 1px solid var(--b-line); border-radius: var(--b-r);
    background: var(--b-bg); color: var(--b-text); }
.sp-buybox > * + * { padding-top: 14px; border-top: 1px solid var(--b-line); }
.sp-del { display: flex; align-items: flex-start; gap: 12px; }
.sp-del-i { font-size: 22px; color: var(--b-ok); }
.sp-del-c { display: grid; gap: 2px; min-width: 0; }
.sp-del-t { font-size: 15px; line-height: 1.4; font-weight: 700; }
.sp-del-cd { font-size: 13.5px; line-height: 1.4; color: var(--b-muted); }
.sp-del-cd .sp-v { color: var(--b-ok); font-variant-numeric: tabular-nums; }

/* ── Versandkostenfrei ─────────────────────────────────────── */
.sp-free { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; color: var(--b-text); }
.sp-free-i { font-size: 22px; color: var(--b-acc-ink); }
.sp-free-t { font-size: 14px; line-height: 1.4; font-weight: 600; }
.sp-free .sp-bar { grid-column: 1 / -1; height: 8px; margin-top: 10px; }
.sp-free .sp-bar i { background: var(--b-acc); }
.sp-free.is-done .sp-free-i, .sp-free.is-done .sp-free-t { color: var(--b-ok); }
.sp-free.is-done .sp-bar i { background: #16a34a; }
.sp-free-card { padding: 14px 16px; border: 1px solid var(--b-line); border-radius: var(--b-r); background: var(--b-bg); }
.sp-free-mini { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--sp-radius-sm, 10px); background: var(--b-acc-bg); }
.sp-free-mini .sp-free-t { font-size: 13px; }
.sp-free-mini .sp-free-i { font-size: 20px; }
.sp-free-mini .sp-bar { height: 6px; margin-top: 8px; background: color-mix(in srgb, var(--b-acc) 16%, var(--b-bg)); }

/* ── Warenkorb ─────────────────────────────────────────────── */
.sp-cartbox { display: grid; gap: 12px; margin: 0 0 16px; }
.sp-moti { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: var(--b-r); background: var(--b-text); color: var(--b-bg); }
.sp-moti-i { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: color-mix(in srgb, var(--b-bg) 14%, transparent); }
.sp-moti-c { flex: 1; min-width: 0; display: grid; gap: 12px; justify-items: start; }
.sp-moti-t { font-size: 15px; line-height: 1.45; font-weight: 500; }
.sp-moti-t [data-k="countdown"] { font-variant-numeric: tabular-nums; }
.sp-b .sp-moti-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border: 0; border-radius: var(--b-btn-r); background: var(--b-bg); color: var(--b-text);
    font-size: 14px; line-height: 1.3; font-weight: 700; cursor: pointer; transition: transform .16s var(--b-ease), opacity .16s var(--b-ease); }
.sp-moti-btn:disabled { opacity: .6; cursor: default; }
.sp-moti-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sp-b .sp-moti-v { padding: 8px 12px; border: 1.5px dashed color-mix(in srgb, var(--b-bg) 55%, transparent); border-radius: 10px; background: none; color: inherit;
    font: 700 15px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }

/* ── Artikellisten ─────────────────────────────────────────── */
/* oben rechts: oben links sitzen die Theme-Etiketten (NOVA-Ribbons), unten Plugin-Plaketten/Schnellansicht;
   NOVA blendet oben rechts beim Überfahren Merkzettel/Vergleich ein → dann weichen die Badges */
.sp-badges { position: absolute; z-index: 3; right: 10px; top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none;
    transition: opacity .18s var(--b-ease); }
.sp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 12px; line-height: 1.3; font-weight: 800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12); white-space: nowrap; }
.sp-badge-save { background: var(--b-price); color: var(--b-on-price, #ffffff); }
.sp-badge-cd { background: rgba(17, 17, 17, .86); color: #ffffff; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-badge-cd .sp-i { font-size: 13px; }

/* ── Live-Verkäufe ─────────────────────────────────────────── */
.sp-toast { position: fixed; z-index: 99991; bottom: 16px; width: min(360px, calc(100vw - 32px)); background: var(--b-bg); color: var(--b-text);
    border: 1px solid color-mix(in srgb, var(--b-text) 7%, transparent); border-radius: calc(var(--b-r) + 2px);
    box-shadow: 0 12px 32px rgba(17, 17, 17, .16), 0 2px 6px rgba(17, 17, 17, .06); transition: opacity .2s var(--b-ease), transform .2s var(--b-ease); }
.sp-toast-bl { left: 16px; }
.sp-toast-br { right: 16px; }
.sp-toast.is-out { opacity: 0; transform: translateY(8px); }
.sp-b .sp-toast-a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 40px 10px 10px; color: inherit; text-decoration: none; }
.sp-toast-img { flex: none; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; overflow: hidden;
    border-radius: calc(var(--b-r) - 4px); background: #ffffff; border: 1px solid var(--b-line); color: var(--b-muted); font-size: 24px; }
.sp-toast-img img { width: 100%; height: 100%; object-fit: contain; }
.sp-toast-c { display: grid; gap: 3px; min-width: 0; }
.sp-toast-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.35; }
.sp-toast-n { font-weight: 700; }
.sp-toast-time { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--b-muted); }
.sp-b .sp-toast-x { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--b-muted); font-size: 15px; cursor: pointer; }

/* ── WhatsApp ──────────────────────────────────────────────── */
.sp-b.sp-wa { position: fixed; z-index: 99990; bottom: 20px; display: flex; align-items: center; gap: 10px; color: var(--b-text); text-decoration: none; }
.sp-wa-br { right: 20px; }
.sp-wa-bl { left: 20px; flex-direction: row-reverse; }
.sp-wa-i { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #1a9e4f;
    box-shadow: 0 8px 22px rgba(26, 158, 79, .34), 0 2px 6px rgba(0, 0, 0, .12); transition: transform .2s var(--b-ease); }
.sp-wa-l { padding: 9px 14px; border-radius: 999px; background: var(--b-bg); color: var(--b-text); font-size: 14px; line-height: 1.3; font-weight: 600; white-space: nowrap;
    box-shadow: 0 6px 20px rgba(17, 17, 17, .14), 0 0 0 1px color-mix(in srgb, var(--b-text) 6%, transparent); }
.sp-wa:focus-visible { outline: none; }
/* feste Knöpfe des Shops in derselben Ecke rücken über die Blase (NOVA „nach oben“, JTL-Cookie-Einstellungen), statt verdeckt zu werden */
body:has(.sp-wa-br) .smoothscroll-top.show { bottom: 88px; }
body:has(.sp-wa-bl) #consent-settings-btn { bottom: 88px; }
/* solange der JTL-Cookie-Banner offen ist (NOVA 5.2–5.8: .active ohne .mini, Banner nicht .consent-hidden), keine Blase über seinen Knöpfen */
body:has(#consent-manager.active:not(.mini) > #consent-banner:not(.consent-hidden)) .sp-b.sp-wa { opacity: 0; visibility: hidden; pointer-events: none; }
.sp-wa:focus-visible .sp-wa-i { outline: 3px solid var(--b-acc); outline-offset: 3px; }

/* ── Popups ────────────────────────────────────────────────── */
.sp-b.sp-pop-wrap { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px;
    color: var(--b-text); font-size: 16px; line-height: 1.5; text-align: center; }
.sp-pop-bg { position: absolute; inset: 0; background: rgba(10, 12, 16, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sp-pop { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
    background: var(--b-bg); color: var(--b-text); border-radius: calc(var(--b-r) + 10px); outline: none;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .28), 0 4px 14px rgba(0, 0, 0, .1); }
.sp-pop-body { display: grid; justify-items: center; gap: 14px; padding: 44px 32px 32px; }
.sp-pop-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.sp-pop-img + .sp-pop-body { padding-top: 26px; }
.sp-pop-badge { width: 64px; height: 64px; padding: 17px; margin-bottom: 2px; border-radius: 50%; color: var(--b-acc-ink); background: var(--b-acc-bg); }
.sp-pop .sp-pop-t { margin: 0; color: inherit; font-family: var(--sp-font-head, inherit); font-weight: var(--sp-head-weight, 800);
    font-size: clamp(22px, 5.4vw, 28px); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.sp-pop-x { max-width: 34ch; margin: -4px 0 0; color: var(--b-muted); font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.sp-pop-code { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 8px 8px 8px 20px;
    border: 2px dashed color-mix(in srgb, var(--b-acc) 45%, var(--b-line)); border-radius: calc(var(--b-r) - 2px); background: var(--b-acc-bg);
    transition: border-color .2s var(--b-ease); }
.sp-pop-code.is-copied { border-color: #16a34a; }
.sp-pop-code-v { flex: 1; min-width: 0; text-align: left; overflow-wrap: anywhere; font-family: var(--sp-font-head, inherit); font-weight: 800;
    font-size: clamp(20px, 6vw, 26px); line-height: 1.2; letter-spacing: .08em; }
.sp-b .sp-pop-copy { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 16px; border: 0;
    border-radius: calc(var(--b-r) - 6px); background: var(--b-acc); color: var(--b-on-acc); font-size: 14px; line-height: 1.2; font-weight: 700; cursor: pointer;
    transition: transform .16s var(--b-ease); }
.sp-b .sp-pop-btn, .sp-b .sp-pop-tel { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px 24px;
    margin-top: 4px; border: 0; border-radius: var(--b-btn-r); background: var(--b-pri); color: var(--b-on-pri); font-size: 16px; line-height: 1.3; font-weight: 700;
    text-decoration: none; cursor: pointer; transition: transform .16s var(--b-ease), opacity .16s var(--b-ease); }
.sp-b .sp-pop-tel { min-height: 58px; font-size: clamp(19px, 5vw, 22px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sp-pop-tel .sp-i { font-size: 20px; }
.sp-pop-hours { display: inline-flex; align-items: center; gap: 6px; margin-top: -2px; font-size: 14px; color: var(--b-muted); }
.sp-pop-av { position: relative; display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 50%;
    color: var(--b-acc-ink); background: var(--b-acc-bg); font-size: 36px; }
.sp-pop-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sp-pop-on { position: absolute; right: 5px; bottom: 5px; width: 20px; height: 20px; border-radius: 50%; background: #16a34a; border: 3px solid var(--b-bg); }
.sp-pop-person { margin: -4px 0 -6px; color: var(--b-muted); font-size: 14px; font-weight: 600; }
.sp-b .sp-pop-close { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: var(--b-soft); color: var(--b-text); font-size: 18px; cursor: pointer; transition: transform .16s var(--b-ease); }
.sp-pop-image { width: min(560px, 100%); }
.sp-pop-image .sp-pop-body { display: block; padding: 0; }
.sp-pop-pic { display: block; width: 100%; height: auto; }
.sp-b .sp-pop-image .sp-pop-close { background: color-mix(in srgb, var(--b-bg) 90%, transparent); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }

@media (max-width: 575.98px) {
    .sp-toast, .sp-toast-bl, .sp-toast-br { left: 12px; right: 12px; bottom: 12px; width: auto; }
    .sp-b.sp-pop-wrap { align-items: flex-end; padding: 0; }
    .sp-pop { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: calc(var(--b-r) + 10px) calc(var(--b-r) + 10px) 0 0; }
    .sp-pop-body { padding: 40px 22px calc(24px + env(safe-area-inset-bottom, 0px)); }
    .sp-pop-image .sp-pop-body { padding: 0 0 env(safe-area-inset-bottom, 0px); }
}
@media (max-width: 767.98px) {
    .sp-wa-l { display: none; }
    .sp-b.sp-wa { bottom: 16px; }
    .sp-wa-br { right: 16px; }
    .sp-wa-bl { left: 16px; }
}

/* ── Hover nur mit Maus ────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
    .sp-b .sp-toast-x:hover, .sp-b .sp-pop-close:hover { background: color-mix(in srgb, var(--b-text) 10%, var(--b-bg)); color: var(--b-text); }
    .sp-b .sp-pop-btn:hover, .sp-b .sp-pop-tel:hover, .sp-b .sp-pop-copy:hover, .sp-b .sp-moti-btn:hover { opacity: .9; }
    .sp-wa:hover .sp-wa-i { transform: translateY(-2px); }
    .productbox:hover:has(.productbox-quick-actions) .sp-badges { opacity: 0; }
    .sp-b .sp-toast-a:hover .sp-toast-n { text-decoration: underline; text-underline-offset: 2px; }
}

/* ── Bewegung ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .sp-in { animation: sp-in .24s var(--b-ease) backwards; }
    .sp-toast.sp-in { animation: sp-rise .28s var(--b-ease) backwards; }
    .sp-wa.sp-in { animation: sp-rise .28s var(--b-ease) .3s backwards; }
    .sp-b.sp-wa { transition: opacity .2s var(--b-ease), visibility .2s; }   /* nach dem Cookie-Banner weich einblenden */
    .sp-pop-wrap .sp-pop-bg { animation: sp-fade .2s var(--b-ease) backwards; }
    .sp-pop-wrap .sp-pop { animation: sp-pop .26s var(--b-ease) backwards; }
    .sp-pop-wrap.is-still .sp-pop-bg, .sp-pop-wrap.is-still .sp-pop { animation: none; }
    .sp-pop-wrap.is-out .sp-pop-bg { opacity: 0; transition: opacity .18s var(--b-ease); }
    .sp-pop-wrap.is-out .sp-pop { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .18s var(--b-ease), transform .18s var(--b-ease); }
    .sp-stock .sp-dot { animation: sp-pulse 1.6s ease-in-out infinite; }
    .sp-b .sp-pop-btn:active, .sp-b .sp-pop-tel:active, .sp-b .sp-pop-copy:active, .sp-b .sp-moti-btn:active, .sp-b .sp-pop-close:active { transform: scale(.97); }
    .sp-wa:active .sp-wa-i { transform: scale(.96); }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 575.98px) {
    .sp-pop-wrap .sp-pop { animation-name: sp-sheet; }
    .sp-pop-wrap.is-out .sp-pop { transform: translateY(24px); }
}
@media (prefers-reduced-motion: reduce) {
    .sp-bar i, .sp-toast, .sp-pop-code { transition: none; }
}
@keyframes sp-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes sp-fade { from { opacity: 0; } }
@keyframes sp-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes sp-sheet { from { opacity: 0; transform: translateY(40px); } }
@keyframes sp-pulse { 50% { opacity: .35; } }
