/* ── Overlay ── */
#cart-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    z-index: 9000;
    opacity: 0; pointer-events: none;
    transition: opacity .35s ease;
}
#cart-overlay.open { opacity: 1; pointer-events: all; }

/* ── Panneau ── */
#cart-drawer {
    position: fixed; top: 0; right: 0;
    width: min(428px, 100vw);
    height: 100%;
    background: var(--secondary-color);
    border: solid 1px var(--light-grey);
    box-shadow: -8px 0 40px rgba(0,0,0,.18);
    z-index: 9001;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .38s cubic-bezier(.4,0,.2,1);
}
#cart-drawer.open { transform: translateX(0); }

/* ── En-tête ── */
#cart-drawer .cart-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
#cart-drawer .cart-head h2 {
    font-size: 1.15rem; font-weight: 700;
    margin: 0; letter-spacing: .5px;
}
#cart-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.5rem; line-height: 1; color: #555;
    padding: 4px 8px; border-radius: 6px;
    transition: background .2s;
}
#cart-close:hover { background: #f3f3f3; color: #111; }

/* ── Corps (articles) ── */
#cart-drawer .cart-body {
    flex: 1; overflow-y: auto;
    padding: 16px 24px;
}

/* ── Article individuel ── */
.cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: .92rem;
}
.cart-line:last-child { border-bottom: none; }
.cart-line .cl-name { font-weight: 600; line-height: 1.35; }
.cart-line .cl-sub  { color: #888; font-size: .82rem; }
.cart-line .cl-qty  {
    background_: #f4f4f4; border-radius: 10px;
    padding: 3px 10px; font-size: .83rem; white-space: nowrap; border: solid 1px white
}
.cart-line .cl-price { font-weight: 700; text-align: right; white-space: nowrap; }
.cart-line .cl-remove {
    grid-column: 3; align-self: start; margin-top: 2px;
    background: none; border: none; cursor: pointer;
    color: #aaa; font-size: 1rem; padding: 2px;
    transition: color .2s; line-height: 1; font-weight: bold;
}
.cart-line .cl-remove:hover { color: #e74c3c; }

/* ── Pied (totaux + actions) ── */
#cart-drawer .cart-foot {
    flex-shrink: 0;
    border-top: 1px solid #eee;
    padding: 18px 24px 24px;
}
.cart-foot .cf-row {
    display: flex; justify-content: space-between;
    font-size: .9rem; margin-bottom: 6px; color: #cfcfcf;
}
.cart-foot .cf-row.saving { color: #27ae60; font-weight: 600; }
.cart-foot .cf-row.total  {
    font-size: 1.15rem; font-weight: 700;
    color: #cfcfcf; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid #e8e8e8;
}
.cart-foot .cf-ship {
    font-size: .8rem; color: #27ae60;
    text-align: center; margin: 6px 0 14px;
}
.cart-foot .btn-checkout {
    display: block; width: 100%; text-align: center;
    background: #c0392b; color: #fff;
    padding: 14px; border-radius: 8px;
    font-weight: 700; font-size: 1rem; letter-spacing: .4px;
    text-decoration: none;
    transition: background .2s, transform .15s;
}
.cart-foot .btn-checkout:hover {
    background: #a93226; color: #fff; text-decoration: none;
    transform: translateY(-1px);
}
.cart-foot .btn-continue {
    display: block; text-align: center;
    color: #888; font-size: .83rem; margin-top: 10px;
    cursor: pointer; background: none; border: none; width: 100%;
    text-decoration: underline;
}
.cart-foot .btn-continue:hover { color: #333; }

/* ── Panier vide ── */
.cart-empty {
    text-align: center; padding: 60px 20px; color: #aaa;
}
.cart-empty i { font-size: 3rem; margin-bottom: 16px; display: block; }
.cart-empty p { font-size: .95rem; margin: 0; }

/* ── Badge sur l'icône nav ── */
.cart-nav-btn {
    background: none; border: none; cursor: pointer;
    position: relative; padding: 6px 8px;
    color: inherit; font-size: 1.35rem;
    display: inline-flex; align-items: center; line-height: 1;
}
.cart-badge {
    position: absolute; top: -4px; right: -6px;
    background: #c0392b; color: #fff;
    font-size: .65rem; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.cart-badge.pop { transform: scale(1.4); }