/* CartDrawer reutilizable — se abre al agregar al carrito (card o PDP). */

.vm-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .38);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 20000;   /* por encima del widget del asistente y todo lo demás */
}
.vm-cart-overlay.open { opacity: 1; }

.vm-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 92vw);
    background: #fff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.22, .61, .36, 1);
    z-index: 20010;   /* por encima del overlay y del widget del asistente */
    display: flex;
    flex-direction: column;
}
.vm-cart-drawer.open { transform: translateX(0); }

.vm-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
    font-size: 1.05rem;
}
.vm-cart-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 0 4px;
}

.vm-cart-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 14px;
}
.vm-cart-loading, .vm-cart-empty {
    color: #888;
    text-align: center;
    padding: 40px 10px;
    font-size: .92rem;
}

.vm-cart-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}
.vm-cart-thumb {
    width: 60px;
    height: 80px;
    flex: 0 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #f4f3f1;
}
.vm-cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vm-cart-info { min-width: 0; flex: 1; }
.vm-cart-name { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-cart-meta { font-size: .78rem; color: #888; margin: 2px 0; }
.vm-cart-price { font-size: .9rem; font-weight: 700; }

.vm-cart-foot {
    border-top: 1px solid #eee;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
}
.vm-cart-subtotal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.vm-cart-subtotal strong { font-size: 1.15rem; }
.vm-cart-actions { display: flex; gap: 10px; }
.vm-cart-keep, .vm-cart-pay {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    text-decoration: none;
}
.vm-cart-keep { background: #f1f1f1; color: #1c1a18; border: none; }
.vm-cart-pay { background: #1c1a18; color: #fff; }
.vm-cart-pay:hover { color: #fff; opacity: .92; }

/* Mientras el drawer está abierto, ocultamos el botón flotante del asistente
   para que no se solape con el drawer (no movemos nada: el body no se bloquea). */
body.vm-cart-open .vm-chat-toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
