/* Panel lateral y contador del carrito. */
.carrito-flotante {
    position: fixed;
    z-index: 40;
    top: 82px;
    right: 24px;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    background: #e51e2a;
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 8px 20px #450b0b44;
    cursor: pointer
}

.carrito-flotante span {
    position: absolute;
    right: -4px;
    top: -5px;
    min-width: 22px;
    height: 22px;
    padding: 2px 5px;
    border-radius: 99px;
    background: #fff;
    color: #e51e2a;
    font-size: .75rem;
    font-weight: 900
}

.carrito-flotante em {
    position: absolute;
    right: 58px;
    top: 12px;
    padding: 5px 9px;
    border-radius: 7px;
    background: #2fa66b;
    color: #fff;
    font-size: .75rem;
    font-style: normal;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transform: translateX(8px);
    transition: opacity .15s, transform .15s
}

.carrito-flotante em.visible {
    opacity: 1;
    transform: translateX(0)
}

.carrito-agregado {
    animation: carrito-vibra .5s ease-in-out 2
}

@keyframes carrito-vibra {

    0%,
    100% {
        transform: translateX(0) rotate(0)
    }

    25% {
        transform: translateX(-4px) rotate(-8deg)
    }

    75% {
        transform: translateX(4px) rotate(8deg)
    }
}

.panel-carrito {
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    width: min(410px, 92vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -10px 0 30px #1a0b0b30;
    transform: translateX(105%);
    transition: transform .25s
}

.panel-carrito.abierto {
    transform: translateX(0)
}

.panel-carrito-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 22px;
    border-bottom: 1px solid #eee4de;
    background: #fffaf7
}

.panel-carrito-header h2 {
    margin: 3px 0 0;
    font-size: 1.6rem
}

.panel-carrito-header button {
    border: 0;
    background: none;
    color: #8d2923;
    font-size: 2rem;
    cursor: pointer
}

.items-carrito {
    flex: 1;
    overflow-y: auto;
    padding: 18px
}

.carrito-vacio {
    padding: 30px 8px;
    text-align: center;
    color: #718096
}

.carrito-item {
    padding: 14px 0;
    border-bottom: 1px solid #eee4de
}

.carrito-item-top {
    display: flex;
    flex-direction: column;
    gap: 9px
}

.carrito-item-imagen {
    width: 100%;
    height: 115px;
    border-radius: 9px;
    object-fit: cover;
    order: 2
}

.carrito-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.carrito-item-info small {
    color: #a52d25;
    font-weight: 800
}

.carrito-descripcion {
    margin: 8px 0
}

.carrito-descripcion summary {
    color: #8d2923;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700
}

.carrito-descripcion p {
    margin: 5px 0;
    color: #718096;
    font-size: .8rem
}

.carrito-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0
}

.carrito-item-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #e3d5cf;
    border-radius: 7px;
    background: #fff;
    color: #a52d25;
    font-weight: 900;
    cursor: pointer
}

.carrito-item-controls .carrito-eliminar {
    margin-left: auto;
    color: #d8322b
}

.carrito-observacion {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #eee4de;
    border-radius: 7px;
    font-size: .82rem
}

.panel-carrito-footer {
    padding: 18px 22px;
    border-top: 1px solid #eee4de;
    background: #fffaf7
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1.15rem
}

.carrito-total strong {
    color: #a52d25
}

.panel-carrito-footer textarea {
    width: 100%;
    min-height: 70px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #eaded8;
    border-radius: 8px;
    resize: vertical
}

.btn-confirmar-pedido {
    width: 100%;
    padding: 13px
}

.carrito-fondo {
    position: fixed;
    z-index: 50;
    inset: 0;
    background: #18090966;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s
}

.carrito-fondo.visible {
    opacity: 1;
    pointer-events: auto
}