/* ========================= */
/* CARRITO LATERAL PROFESIONAL */
/* ========================= */

#carritoOverlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    opacity:0;
    visibility:hidden;
    transition:.25s ease;
    z-index:99998;
}

#carritoOverlay.activo{
    opacity:1;
    visibility:visible;
}

#carritoLateral{
    position:fixed;
    top:0;
    right:-430px;
    width:420px;
    max-width:92%;
    height:100vh;
    background:#fff;
    z-index:99999;
    display:flex;
    flex-direction:column;
    box-shadow:-12px 0 35px rgba(0,0,0,.18);
    transition:right .28s ease;
    font-family:Arial, sans-serif;
}

#carritoLateral.activo{
    right:0;
}

.carrito-header{
    padding:20px;
    border-bottom:1px solid #eee;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.carrito-header h5{
    margin:0;
    font-size:22px;
    font-weight:800;
    color:#111;
}

#cerrarCarritoBtn{
    width:36px;
    height:36px;
    border:none;
    background:#f3f3f3;
    border-radius:50%;
    font-size:20px;
    line-height:1;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
}

#cerrarCarritoBtn:hover{
    background:#e8e8e8;
}

#carritoItems{
    flex:1;
    overflow-y:auto;
    padding:20px;
}

.carrito-vacio{
    margin:30px 0;
    text-align:center;
    color:#777;
    font-size:15px;
}

.carrito-footer{
    padding:20px;
    border-top:1px solid #eee;
    background:#fff;
}

.carrito-total{
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:18px;
    font-weight:800;
    margin-bottom:15px;
}

#carritoTotal{
    color:#b720eb;
}

.btn-finalizar,
.btn-finalizar:visited,
.btn-finalizar:focus,
.btn-finalizar:active{
    width:100%;
    min-height:54px;
    border:none;
    background:#b720eb;
    color:#fff !important;
    padding:15px;
    border-radius:14px;
    font-size:16px;
    font-weight:800;
    cursor:pointer;
    transition:.2s;
    text-decoration:none !important;
    text-align:center;
    display:flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
}

.btn-finalizar:hover{
    background:#9e19cf;
    color:#fff !important;
    text-decoration:none !important;
}

.item-carrito{
    display:flex;
    gap:14px;
    padding:14px 0;
    border-bottom:1px solid #eee;
}

.item-img{
    width:82px;
    height:82px;
    object-fit:contain;
    border-radius:12px;
    background:#f6f6f6;
    border:1px solid #eee;
}

.item-info{
    flex:1;
}

.item-nombre{
    font-size:14px;
    font-weight:800;
    color:#111;
    margin-bottom:6px;
    line-height:1.3;
}

.item-precio{
    font-size:15px;
    font-weight:800;
    color:#b720eb;
    margin-bottom:8px;
}

.item-cantidad{
    display:flex;
    align-items:center;
    gap:10px;
    margin:8px 0;
}

.btn-cantidad{
    width:30px;
    height:30px;
    border:none;
    border-radius:8px;
    background:#f1f1f1;
    font-size:18px;
    font-weight:700;
    cursor:pointer;
}

.btn-cantidad:hover{
    background:#e2e2e2;
}

.item-subtotal{
    font-size:13px;
    color:#555;
    margin-bottom:6px;
}

.btn-eliminar{
    border:none;
    background:none;
    color:#e53935;
    padding:0;
    cursor:pointer;
    font-size:13px;
    font-weight:700;
}

.carrito-bounce{
    animation:carritoBounce .4s ease;
}

@keyframes carritoBounce{
    0%{transform:scale(1);}
    50%{transform:scale(1.15);}
    100%{transform:scale(1);}
}

@media(max-width:576px){
    #carritoLateral{
        width:100%;
        max-width:100%;
        right:-100%;
    }

    #carritoLateral.activo{
        right:0;
    }
}