/* ==========================================================================
   Animations "Ajout au panier" — toast + badge pulse + fly-to-cart
   ========================================================================== */

/* ── Toast bas-droite (desktop) / bas plein-largeur (mobile) ────────────── */
.cart-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #d4cfc4;
    border-left: 4px solid #b8960c;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.22);
    padding: 14px 18px;
    min-width: 320px;
    max-width: 460px;
    color: #1a1a1a;
    font-family: Georgia, 'Times New Roman', serif;
    /* Animation d'entrée */
    transform: translate(0, 30px);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.32s ease;
}
.cart-toast--visible {
    transform: translate(0, 0);
    opacity: 1;
}

.cart-toast__img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid #ede8df;
    flex-shrink: 0;
    background: #faf8f5;
}
.cart-toast__img--placeholder {
    background: linear-gradient(135deg, #faf8f5 25%, #ede8df 25%, #ede8df 50%, #faf8f5 50%, #faf8f5 75%, #ede8df 75%);
    background-size: 16px 16px;
}

.cart-toast__body {
    flex: 1;
    min-width: 0;
}
.cart-toast__title {
    font-family: 'Linux Libertine', Georgia, serif;
    font-size: 0.78rem;
    font-style: italic;
    color: #b8960c;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.cart-toast__name {
    font-size: 0.95rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.cart-toast__cta {
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.cart-toast__cta:hover {
    background: #b8960c;
}

.cart-toast__close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}
.cart-toast__close:hover {
    color: #1a1a1a;
}

/* Mobile : toast plein largeur en bas, CTA dessous le contenu */
@media (max-width: 600px) {
    .cart-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        min-width: 0;
        max-width: none;
        flex-wrap: wrap;
        padding: 12px 14px;
    }
    .cart-toast__body {
        flex-basis: calc(100% - 80px);
    }
    .cart-toast__cta {
        order: 10;
        flex-basis: 100%;
        text-align: center;
        padding: 11px 16px;
        margin-top: 4px;
    }
}

/* ── Bulle de quantité sur l'icône panier de la page produit ───────────── */
/* La product-topbar utilise des `.product-topbar-btn` rond, on ajoute la
   bulle en position absolute comme sur la navbar standard. */
.product-topbar-cart {
    position: relative;
}
.product-topbar-cart .cart-count {
    position: absolute;
    top: -2px; right: -2px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Pulse sur le badge panier de la navbar ────────────────────────────── */
@keyframes cart-pulse-anim {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.25); }
    65%  { transform: scale(0.92); }
    100% { transform: scale(1); }
}
@keyframes cart-pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184, 150, 12, 0); }
    50%      { box-shadow: 0 0 0 10px rgba(184, 150, 12, 0.18); }
}
.cart-pulse {
    animation: cart-pulse-anim 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               cart-pulse-glow 0.6s ease both;
    border-radius: 50%;
}

/* ── Image volante vers le panier ──────────────────────────────────────── */
.cart-fly-img {
    position: fixed;
    z-index: 9997;
    pointer-events: none;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(184, 150, 12, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: #fff;
    will-change: transform, opacity;
    /* Position et taille de départ calculées par cart.js (flyImageToCart) */
    left: var(--fly-x);
    top: var(--fly-y);
    width: var(--fly-size);
    height: var(--fly-size);
}

/* Respect des préférences "prefers-reduced-motion" : on désactive
   les animations lourdes et on garde uniquement le toast (info essentielle). */
@media (prefers-reduced-motion: reduce) {
    .cart-toast {
        transition: opacity 0.2s ease;
        transform: none;
    }
    .cart-pulse {
        animation: none;
    }
    .cart-fly-img {
        display: none;
    }
}
