/* ======================================================================
   aob-warenkorb-fx.css — Rueckmeldung beim „In den Warenkorb“ (Paket D, 21.11.2026)
   Gehoert zu assets/js/aob-warenkorb-fx.js.
   - .aob-cfx-note  Hinweis, der oben in Optik der schwarzen Leiste (.header-top)
                    herunterfaehrt, wenn der Warenkorb-Link der Kopfzeile weg ist
   - .aob-cfx-fly   fliegende Produkt-Miniatur (position:fixed, nur transform/opacity)
   - .aob-cfx-take  „Annahme“ am Ziel (dezent, max. scale 1.12)
   Die Leiste bleibt auch im Dunkelmodus schwarz (site.css .header-top, kein Dark-Override),
   deshalb ist der Hinweis in beiden Modi dunkel; im Dunkelmodus bekommt er einen hellen
   Rand, damit er sich vom dunklen Seitenhintergrund (#14171a) abhebt.
   z-index: unter dem Dunkel/Hell-Knopf (9990), Flug darueber.
   ====================================================================== */

.aob-cfx-note {
    --cfx-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --cfx-bg: linear-gradient(180deg, #050505 0%, #1a1a1a 100%);
    --cfx-text: rgba(255, 255, 255, .92);
    --cfx-muted: rgba(255, 255, 255, .74);
    --cfx-accent: var(--primary, #90a7ac);
    --cfx-border: rgba(255, 255, 255, .08);
    position: fixed;
    top: 0;
    right: 88px;                      /* JS setzt die genaue Lage des Warenkorb-Links */
    z-index: 9989;
    width: min(480px, calc(100vw - 32px));
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--cfx-bg);
    color: var(--cfx-text);
    border: 1px solid var(--cfx-border);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 36px rgba(0, 0, 0, .28);
    font-family: inherit;
    font-size: 13px;                  /* feste Groesse wie die Leiste, unabhaengig von rem-Skalierung */
    line-height: 1.3;
    letter-spacing: .02em;
    transform: translateY(calc(-100% - 16px));
    opacity: 0;
    transition: transform 160ms cubic-bezier(0.4, 0, 1, 1), opacity 160ms cubic-bezier(0.4, 0, 1, 1);
    pointer-events: none;
}
.aob-cfx-note[hidden] { display: none; }
.aob-cfx-note.is-open {
    transform: translateY(0);
    opacity: 1;
    transition: transform 230ms var(--cfx-ease-out), opacity 230ms var(--cfx-ease-out);
    pointer-events: auto;
}
/* feine Markenlinie unten wie an der Leiste */
.aob-cfx-note::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(144, 167, 172, .45), transparent);
    pointer-events: none;
}
/* aob-premium-ux.css (Z. ~3766) zwingt im Dunkelmodus JEDE Schrift per
   `-webkit-text-fill-color:#e9eae6 !important` (Links #aecbd1, Spezifitaet 0,6,2) — auf der
   hellen Markenflaeche von „Zum Warenkorb“ waere die Schrift dann fast unsichtbar.
   Hier die eigenen Farben zurueckgeben (Spezifitaet 0,7,1). */
[data-theme="dark"] body:not(.is-admin):not(.acc-bs-page) .aob-cfx-note.aob-cfx-note.aob-cfx-note.aob-cfx-note * {
    -webkit-text-fill-color: currentColor !important;
}
[data-theme="dark"] .aob-cfx-note {
    /* Markenfarbe als Rand: gemessen >= 3:1 gegen den Dunkel-Hintergrund #14171a */
    --cfx-border: rgba(168, 192, 198, .55);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
}

.aob-cfx-note__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 6px 6px 6px 14px;
}
[dir="rtl"] .aob-cfx-note__inner { padding: 6px 14px 6px 6px; }

.aob-cfx-note__icon {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}
.aob-cfx-note__icon svg { width: 20px; height: 20px; }
.aob-cfx-note__badge {
    position: absolute;
    top: -3px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--cfx-accent);
    color: #0b0d0e;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    letter-spacing: 0;
}
[dir="rtl"] .aob-cfx-note__badge { right: auto; left: -5px; }

.aob-cfx-note__text { flex: 1 1 auto; min-width: 0; }
.aob-cfx-note__title,
.aob-cfx-note__line { margin: 0; }
.aob-cfx-note__title { font-weight: 600; color: var(--cfx-text); }
.aob-cfx-note__count { font-style: normal; color: var(--cfx-accent); font-weight: 600; }
.aob-cfx-note__line {
    color: var(--cfx-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aob-cfx-note__line.is-wrap {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.aob-cfx-note__link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--cfx-accent);
    color: #0b0d0e !important;
    font-weight: 600;
    font-size: 12.5px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform 160ms var(--cfx-ease-out), background-color 160ms ease;
}
.aob-cfx-note__link[hidden] { display: none; }
.aob-cfx-note__link:active { transform: scale(.97); }

.aob-cfx-note__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cfx-muted);
    cursor: pointer;
    transition: transform 160ms var(--cfx-ease-out), background-color 160ms ease, color 160ms ease;
}
.aob-cfx-note__close svg { width: 18px; height: 18px; }
.aob-cfx-note__close:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
    .aob-cfx-note__link:hover { background: #a8bdc1; }
    .aob-cfx-note__close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
}
.aob-cfx-note__link:focus-visible,
.aob-cfx-note__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Fehler: dieselbe Leiste, Warnoptik */
.aob-cfx-note.is-error {
    --cfx-border: rgba(242, 166, 90, .55);
}
.aob-cfx-note.is-error .aob-cfx-note__icon { background: rgba(242, 166, 90, .16); color: #f2a65a; }
.aob-cfx-note.is-error .aob-cfx-note__title { color: #f6b878; }
.aob-cfx-note.is-error .aob-cfx-note__line { color: var(--cfx-text); }
.aob-cfx-note.is-error::after { background: linear-gradient(90deg, transparent, rgba(242, 166, 90, .7), transparent); }

/* Handy: volle Breite unter der sicheren Zone. Zwei Zeilen: oben Icon + Text, unten
   „Zum Warenkorb“ + Schliessen. Rechts 60 px frei fuer den Dunkel/Hell-Knopf (fest rechts,
   40 px + 12 px Rand) — er sitzt auch bei dir="rtl" physisch rechts (aob-premium-ux.css). */
@media (max-width: 720px) {
    .aob-cfx-note {
        left: 0 !important;
        right: 0 !important;
        width: auto;
        border-left: 0;
        border-right: 0;
        border-radius: 0 0 12px 12px;
    }
    .aob-cfx-note__inner,
    [dir="rtl"] .aob-cfx-note__inner {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas: "icon text text" "icon link close";
        column-gap: 10px;
        row-gap: 4px;
        align-items: center;
        padding: 8px 60px 6px 12px;
    }
    .aob-cfx-note__icon  { grid-area: icon; align-self: start; margin-top: 2px; }
    .aob-cfx-note__text  { grid-area: text; }
    .aob-cfx-note__link  { grid-area: link; justify-self: start; padding: 0 14px; }
    .aob-cfx-note__close { grid-area: close; }
    .aob-cfx-note__link[hidden] + .aob-cfx-note__close { grid-column: 3; }
}

/* Screenreader-Ansage */
.aob-cfx-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
}

/* ---------- Flug ---------- */
.aob-cfx-fly {
    position: fixed;
    z-index: 9996;
    width: 52px;
    height: 52px;
    pointer-events: none;
    will-change: transform;
}
.aob-cfx-fly__y { width: 100%; height: 100%; will-change: transform; }
.aob-cfx-fly__dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 2px solid #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .06);
    opacity: 0;
    will-change: transform, opacity;
}
.aob-cfx-fly__dot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aob-cfx-fly__dot.is-plain {
    width: 60%; height: 60%; margin: 20%;
    background: var(--primary, #90a7ac);
    border-color: rgba(255, 255, 255, .9);
}
[data-theme="dark"] .aob-cfx-fly__dot { border-color: #2c3338; background: #1c2024; }
[data-theme="dark"] .aob-cfx-fly__dot.is-plain { background: var(--primary, #90a7ac); }

/* ---------- Annahme am Ziel ---------- */
@keyframes aob-cfx-take {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}
.basket-link.aob-cfx-take svg,
.aob-cfx-note__icon.aob-cfx-take {
    animation: aob-cfx-take 360ms cubic-bezier(0.23, 1, 0.32, 1);
}
.basket-link.aob-cfx-take em,
.aob-cfx-note__icon.aob-cfx-take .aob-cfx-note__badge {
    display: inline-block;
    animation: aob-cfx-take 360ms cubic-bezier(0.23, 1, 0.32, 1) 40ms;
}

/* ---------- Bestaetigter Knopf (footer.php setzt den Text „Im Warenkorb“) ---------- */
.aob-cfx-btn-ok::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-inline-end: .45em;
    vertical-align: -.14em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Weniger Bewegung: nur ein-/ausblenden ---------- */
@media (prefers-reduced-motion: reduce) {
    .aob-cfx-note,
    .aob-cfx-note.is-open {
        transform: none;
        transition: opacity 180ms linear;
    }
    .basket-link.aob-cfx-take svg,
    .basket-link.aob-cfx-take em,
    .aob-cfx-note__icon.aob-cfx-take,
    .aob-cfx-note__icon.aob-cfx-take .aob-cfx-note__badge { animation: none; }
    .aob-cfx-fly { display: none; }
}
