/* ═══════════════════════════════════════
   cart.css — Widget panier & toast
   Utilisé par : produits.php
   ═══════════════════════════════════════ */

/* ── Bouton panier flottant ── */
.cart-widget {
    position: fixed;
    top: calc(var(--nav-h) + 16px);
    right: 20px;
    z-index: 99;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.15s;
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cart-btn:hover {
    border-color: rgba(244, 143, 177, 0.5);
    transform: translateY(-1px);
}

.cart-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Badge compteur ── */
.cart-badge {
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-badge.bump {
    transform: scale(1.5);
}

/* ── Toast notification ── */
.toast {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: 20px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 0.88rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════
   MOBILE — bouton panier en bas,
   dans la zone du pouce
   ══════════════════════════════════ */
@media (max-width: 768px) {

    .cart-widget {
        top: auto;
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: 16px;
    }

    .cart-btn {
        min-height: 54px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    /* Le toast passe au-dessus du bouton panier */
    .toast {
        left: 16px;
        right: 16px;
        bottom: calc(88px + env(safe-area-inset-bottom));
        text-align: center;
    }
}
