/* ==================================================
   CART DRAWER & OVERLAY (POSICIONAMIENTO FIX)
================================================== */

/* Fondo oscuro flotante */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Panel lateral del carrito */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%); /* Oculto fuera de la pantalla a la derecha */
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.active {
    transform: translateX(0); /* Deslizar hacia adentro */
}

/* Evitar scroll horizontal si el drawer sale del borde */
body {
    overflow-x: hidden;
}