/* 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);
}

/* Demande de réservation v2 */
body.ab-cart-open { overflow: hidden; }
#ab-cart-drawer { right: -760px; width: 720px; max-width: min(96vw, 720px); background: #fff; color: #152033; }
#ab-cart-drawer .ab-cart-header { padding: 18px 24px; background: linear-gradient(135deg, #102653, #214b9b); color: #fff; }
#ab-cart-drawer .ab-cart-header h2 { font-size: 21px; margin-top: 2px; color: inherit; }
.ab-cart-kicker { font-size: 10px; font-weight: 800; letter-spacing: .15em; opacity: .72; }
#ab-cart-drawer .ab-cart-close { color: #fff; font-size: 28px; }
.ab-cart-scroll { flex: 1; overflow-y: auto; padding: 8px 24px 28px; }
#ab-cart-drawer .ab-cart-items { overflow: visible; padding: 0; }
.ab-cart-item { position: relative; gap: 14px; padding: 18px 34px 18px 0; }
.ab-cart-item img,.ab-cart-image-placeholder { width: 92px; height: 78px; border-radius: 8px; object-fit: cover; background: #edf2fa; flex: none; }
.ab-cart-image-placeholder { display: grid; place-items: center; color: #214b9b; font-weight: 800; }
.ab-cart-item-info h3 { margin: 0 0 5px; font-size: 14px; line-height: 1.35; color: #152033; }
.ab-cart-item-info p { margin: 2px 0; font-size: 12px; color: #61708a; }
.ab-cart-item-info a { display: inline-block; margin-top: 3px; color: #214b9b; font-size: 12px; font-weight: 700; }
.ab-cart-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; }
.ab-cart-qty { gap: 0; }
.ab-cart-qty button,.ab-cart-qty input { width: 32px; height: 30px; border: 1px solid #d8e0ec; background: #fff; text-align: center; }
.ab-cart-qty button:first-child { border-radius: 6px 0 0 6px; }.ab-cart-qty button:last-child { border-radius: 0 6px 6px 0; }
.ab-cart-qty input { border-left: 0; border-right: 0; appearance: textfield; padding: 0; }
.ab-cart-qty input::-webkit-inner-spin-button { appearance: none; }
.ab-cart-item-remove { position: absolute; right: 0; top: 16px; }
.ab-order-form,.ab-order-summary,.ab-order-success { margin-top: 18px; border-top: 1px solid #e2e8f2; padding-top: 18px; }
.ab-order-form h3,.ab-order-summary h3 { margin: 16px 0 12px; font-size: 17px; color: #102653; }
.ab-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ab-field { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: #394962; }
.ab-field-wide { grid-column: 1 / -1; }
.ab-field input,.ab-field textarea { width: 100%; border: 1px solid #ccd6e5; border-radius: 7px; padding: 10px 11px; background: #fff; color: #152033; font: inherit; font-weight: 500; box-sizing: border-box; }
.ab-field input:focus,.ab-field textarea:focus { border-color: #2f63c4; outline: 3px solid rgba(47,99,196,.12); }
.ab-mode-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.ab-mode-options label { border: 1px solid #d6dfed; border-radius: 7px; padding: 10px; font-size: 12px; cursor: pointer; }
.ab-availability { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0; padding: 12px; border-radius: 8px; background: #eef5ff; color: #173f84; font-size: 13px; font-weight: 700; }
.ab-form-error { min-height: 20px; color: #b42318; font-size: 12px; font-weight: 700; }
.ab-review-btn,.ab-send-actions button { width: 100%; border: 0; border-radius: 7px; padding: 13px 16px; color: #fff; background: #214b9b; font-weight: 800; cursor: pointer; }
.ab-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px; border-radius: 8px; background: #eef5ff; }
.ab-summary-head span,.ab-summary-head strong { display: block; }.ab-summary-head span { font-size: 11px; color: #61708a; }.ab-summary-head strong { color: #173f84; }
.ab-edit-btn { border: 1px solid #a9bddf; border-radius: 6px; padding: 7px 9px; background: #fff; color: #173f84; cursor: pointer; }
.ab-summary-product { display: grid; gap: 3px; padding: 13px 0; border-bottom: 1px solid #e2e8f2; font-size: 12px; }
.ab-summary-product a { overflow-wrap: anywhere; color: #214b9b; }
.ab-summary-total { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; padding: 16px; border-radius: 8px; background: #102653; color: #fff; font-weight: 800; }
.ab-summary-total strong { font-size: 22px; }
.ab-summary-customer { font-size: 13px; line-height: 1.6; }.ab-summary-customer h4 { margin-bottom: 4px; }
.ab-send-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ab-send-actions .ab-send-whatsapp { background: #128c4b; }.ab-send-actions .ab-send-email { background: #214b9b; }
.ab-order-success { text-align: center; padding: 34px 14px; }.ab-order-success h3 { color: #102653; }.ab-success-icon { width: 54px; height: 54px; margin: auto; border-radius: 50%; display: grid; place-items: center; background: #daf5e6; color: #08783d; font-size: 28px; font-weight: 800; }
#ab-cart-drawer .ab-cart-footer { padding: 14px 24px 18px; background: #f8fafc; }
#ab-cart-drawer .ab-cart-total { margin-bottom: 7px; color: #102653; }.ab-cart-total-amount { font-size: 20px; }
.ab-cart-trust-note { margin: 0; }

@media (max-width: 640px) {
  #ab-cart-drawer { width: 100%; max-width: 100vw; }
  .ab-cart-scroll { padding-left: 15px; padding-right: 15px; }
  #ab-cart-drawer .ab-cart-header,#ab-cart-drawer .ab-cart-footer { padding-left: 15px; padding-right: 15px; }
  .ab-cart-item img,.ab-cart-image-placeholder { width: 72px; height: 68px; }
  .ab-cart-row-actions { align-items: flex-start; flex-direction: column; }
  .ab-form-grid,.ab-mode-options,.ab-send-actions { grid-template-columns: 1fr; }
  .ab-summary-total { align-items: flex-start; flex-direction: column; gap: 5px; }
}
