/* ══════════════════════════════════════════════════════════════════
 * ss-cart-fx.css — Site-wide cart FX (toast, fly, and icons)
 * ──────────────────────────────────────────────────────────────
 * Loaded on every page (inline from functions.php).
 * - .ss-toast → bottom-center spring-bounce notification
 * - .ss-fly → green orb that flies from the source to the header cart
 * - SVG icon inside the single-product ATC button
 * ══════════════════════════════════════════════════════════════════ */

/* ─── TOAST (bottom-center, springy effect) ─────────────────────────────── */
.ss-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(140%);
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px 12px 14px;
    background: var(--ss-ink);
    color: var(--ss-cream);
    border-radius: 16px;
    box-shadow: 0 18px 44px color-mix(in srgb, var(--ss-ink) 32%, transparent);
    font: 500 14px/1.35 var(--ss-font-sans);
    letter-spacing: .01em;
    opacity: 0;
    pointer-events: none;
    transition: transform .48s cubic-bezier(.34,1.4,.6,1), opacity .25s ease;
    white-space: nowrap;
}
.ss-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.ss-toast.is-error { background: var(--ss-brand); }
.ss-toast-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--ss-ink);
    color: var(--ss-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ss-toast.is-error .ss-toast-icon {
    background: color-mix(in srgb, var(--ss-cream) 20%, transparent);
    color: var(--ss-white);
}
.ss-toast-icon svg { width: 14px; height: 14px; }
.ss-toast-text {
    line-height: 1.35;
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
}
.ss-toast-title { font-weight: 500; font-size: 14px; }
.ss-toast-sub { font-weight: 500; font-size: 14px; opacity: .72; margin-top: 1px; }
.ss-toast-link {
    margin-left: 10px;
    padding: 6px 10px;
    color: var(--ss-brand);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border-left: 1px solid color-mix(in srgb, var(--ss-cream) 14%, transparent);
    padding-left: 14px;
    transition: color .15s ease, transform .18s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.ss-toast-link:hover { color: var(--ss-brand); transform: translateX(2px); }

@media (max-width: 640px) {
    .ss-toast {
        left: 12px; right: 12px; bottom: 16px;
        transform: translateY(140%);
        max-width: calc(100vw - 24px);
        padding: 11px 14px 11px 12px;
        font-size: 14px;
        white-space: normal;
    }
    .ss-toast.is-visible { transform: translateY(0); }
    .ss-toast-link { margin-left: auto; padding-left: 10px; font-size: 14px; }
}

/* ─── FLY-TO-CART PARTICLE (flying-to-cart effect) ──────────────────────────────────────── */
.ss-fly {
    position: fixed;
    z-index: 2147482999;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--ss-ink);
    color: var(--ss-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--ss-ink) 55%, transparent);
    transition: transform .85s cubic-bezier(.55,-.1,.55,1.1), opacity .85s ease;
    will-change: transform, opacity;
}
.ss-fly svg { width: 15px; height: 15px; }

/* Header cart bump animation */
@keyframes ss-cart-bump {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.15); }
    60%  { transform: scale(.94); }
    100% { transform: scale(1); }
}
.ss-cart-bump { animation: ss-cart-bump .5s cubic-bezier(.34,1.56,.64,1); }

/* ─── SINGLE PRODUCT ATC BUTTON — compact, with icon ────────────────── */
body.single-product .fm-info .single_add_to_cart_button,
body.single-product form.cart .single_add_to_cart_button {
    width: auto !important;
    max-width: 20rem !important;
    min-width: 12rem !important;
    padding: 13px 26px !important;
    font-size: .9375rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .55rem !important;
    line-height: 1 !important;
}
body.single-product .fm-info .single_add_to_cart_button .ss-atc-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
}
body.single-product .fm-info .single_add_to_cart_button .ss-atc-ico svg {
    width: 18px; height: 18px; display: block;
}
body.single-product .fm-info .single_add_to_cart_button .ss-atc-spin {
    display: inline-block;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2.5px solid color-mix(in srgb, var(--ss-cream) 30%, transparent);
    border-top-color: var(--ss-white);
    animation: ss-spin .65s linear infinite;
}
@keyframes ss-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    body.single-product .fm-info .single_add_to_cart_button,
    body.single-product form.cart .single_add_to_cart_button {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 22px !important;
    }
}

/* Kam harkat (Reduced motion) */
@media (prefers-reduced-motion: reduce) {
    .ss-toast, .ss-fly { transition: opacity .2s ease !important; }
    .ss-fly { transform: none !important; }
}
