/* ============================================
   Rosario Ya - Cart layer
   Floating cart, checkout fields and cart item controls.
   ============================================ */

.carrito-flotante {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 8500;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-weight: 850;
    white-space: nowrap;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
    transform: none;
    margin-inline: auto;
    cursor: pointer;
    width: fit-content;
    max-width: calc(100% - 32px);
}

.carrito-flotante.visible {
    display: inline-flex;
}

.carrito-flotante .icon {
    width: 1.08em;
    height: 1.08em;
}

.carrito-badge {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #22c55e;
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.direccion-section,
.pago-section {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    background: #f8fafc;
}

.direccion-label,
.pago-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #475569;
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
}

.direccion-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.direccion-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font: inherit;
}

.direccion-input:focus {
    outline: none;
    border-color: #ff5a00;
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.12);
}

.direccion-guardada {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #111827;
    font-size: .9rem;
}

.pago-opciones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-pago {
    flex: 1 1 120px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-weight: 800;
    cursor: pointer;
}

.btn-pago.seleccionado {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.btn-pago .icon {
    width: 1em;
    height: 1em;
    margin-right: 5px;
    vertical-align: -2px;
}

.entrega-detalle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.35;
}

.entrega-detalle .icon {
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    margin-top: 2px;
    color: #ff5a00;
}

.carrito-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    background: #fff;
}

.carrito-item-info {
    min-width: 0;
}

.carrito-item-nombre {
    color: #111827;
    font-size: .9rem;
    font-weight: 850;
    line-height: 1.2;
}

.carrito-item-opciones,
.carrito-item-precio-unit {
    margin-top: 3px;
    color: #64748b;
    font-size: .76rem;
}

.carrito-item-opciones {
    color: #047857;
    font-style: italic;
}

.carrito-item-controles {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-qty {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #111827;
    font-weight: 900;
    cursor: pointer;
}

.carrito-item-qty {
    min-width: 20px;
    text-align: center;
    color: #111827;
    font-weight: 850;
}

.carrito-item-total {
    min-width: 58px;
    text-align: right;
    color: #111827;
    font-weight: 900;
}

.carrito-vacio {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.modal-footer .resumen-total,
.resumen-total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.resumen-total .label,
.costo-envio-info {
    color: #64748b;
    font-size: .78rem;
}

.resumen-total .valor {
    color: #111827;
    font-size: 1.18rem;
    font-weight: 950;
}

.btn-pedir-wsp {
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    background: #22c55e;
    color: #fff;
    font-size: .98rem;
    font-weight: 900;
    cursor: pointer;
}

.btn-pedir-wsp:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-pedir-whatsapp {
    margin-top: 10px;
    background: #128c7e;
}


@media (max-width: 768px) {
    .carrito-flotante.visible {
        width: min(420px, calc(100% - 32px));
        bottom: calc(88px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 520px) {
    .carrito-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .carrito-item-controles,
    .carrito-item-total {
        justify-self: end;
    }
}
