/* Panier client (localStorage) — widget flottant + tiroir latéral
   Couleurs/police pilotées par les tokens de css/theme.css (var(--color-*),
   var(--font-family)) : les deux fichiers s'appliquent au même document,
   donc les var() se résolvent correctement quel que soit l'ordre de
   chargement des <link>. Ne renomme jamais les IDs/classes ab-cart-* /
   #ab-cart-* (zone interdite, cf. MIGRATION_NOTES.md). */
#ab-cart-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

#ab-cart-fab:hover {
    background: var(--color-accent-dark);
}

#ab-cart-fab .ab-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 12px;
    line-height: 20px;
    font-weight: 700;
    display: none;
}

#ab-cart-fab .ab-cart-badge.is-visible {
    display: block;
}

#ab-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
    display: none;
}

#ab-cart-overlay.is-open {
    display: block;
}

#ab-cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 92vw;
    height: 100%;
    background: var(--color-white);
    z-index: 10000;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .3);
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
    font-family: var(--font-family);
    color: var(--color-text);
}

#ab-cart-drawer.is-open {
    right: 0;
}

#ab-cart-drawer .ab-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
}

#ab-cart-drawer .ab-cart-header h2 {
    font-size: 18px;
    margin: 0;
}

#ab-cart-drawer .ab-cart-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-secondary);
}

#ab-cart-drawer .ab-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 18px;
}

#ab-cart-drawer .ab-cart-empty {
    padding: 40px 0;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.ab-cart-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.ab-cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--color-bg-alt);
    flex-shrink: 0;
}

.ab-cart-item-info {
    flex: 1;
    min-width: 0;
}

.ab-cart-item-info .ab-cart-item-name {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ab-cart-item-info .ab-cart-item-price {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 6px;
}

.ab-cart-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ab-cart-qty button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.ab-cart-qty span {
    min-width: 18px;
    text-align: center;
    font-size: 13px;
}

.ab-cart-item-remove {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 18px;
    align-self: flex-start;
}

.ab-cart-item-remove:hover {
    color: var(--color-accent);
}

#ab-cart-drawer .ab-cart-footer {
    padding: 16px 18px 20px;
    border-top: 1px solid var(--color-border);
}

#ab-cart-drawer .ab-cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}

.ab-cart-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--color-white);
}

.ab-cart-order-btn.is-whatsapp {
    background: var(--color-whatsapp);
}

.ab-cart-order-btn.is-whatsapp:hover {
    background: var(--color-whatsapp-dark);
}

.ab-cart-order-btn.is-email {
    background: var(--color-primary);
}

.ab-cart-order-btn.is-email:hover {
    background: var(--color-primary-light);
}

.ab-cart-trust-note {
    font-size: 11px;
    line-height: 1.5;
    color: #8a5a00;
    background: #fff6e5;
    border: 1px solid #f0d99a;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 4px 0 0;
}

.ab-cart-toast {
    position: fixed;
    right: 20px;
    bottom: 86px;
    z-index: 10001;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.ab-cart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
