/* carrito.css */

.carrito_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.carrito_overlay.is_visible {
    opacity: 1;
    visibility: visible;
}

.carrito_drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100%);
    height: 100vh;
    background: #fff;
    z-index: 9991;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 18px rgba(0, 0, 0, 0.18);
}

.carrito_drawer.is_open {
    transform: translateX(0);
}

body.carrito_drawer_abierto {
    overflow: hidden;
}

.carrito_drawer_header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
}

.carrito_drawer_header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.carrito_drawer_header p {
    margin: 4px 0 0;
    font-size: .9rem;
    color: #666;
}

.carrito_drawer_cerrar {
    border: 0;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    color: #333;
}

.carrito_drawer_body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
}

.carrito_vacio {
    padding: 30px 0;
    text-align: center;
    color: #777;
}

.carrito_item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.carrito_item_img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #f4f4f4;
}

.carrito_item_info {
    min-width: 0;
}

.carrito_item_nombre {
    margin: 0 0 6px;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
}

.carrito_item_precio {
    margin: 0 0 8px;
    font-size: .9rem;
    color: #666;
}

.carrito_item_promo {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f7eded;
    color: #9b1c1f;
    font-size: .75rem;
    font-weight: 600;
}

.carrito_item_acciones {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.carrito_qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 999px;
    overflow: hidden;
}

.carrito_qty button {
    width: 30px;
    height: 30px;
    border: 0;
    background: #f7f7f7;
    font-weight: 700;
}

.carrito_qty input {
    width: 42px;
    height: 30px;
    border: 0;
    text-align: center;
    font-weight: 600;
}

.carrito_item_subtotal {
    font-weight: 700;
    white-space: nowrap;
}

.carrito_item_eliminar {
    margin-top: 8px;
    border: 0;
    background: transparent;
    padding: 0;
    color: #999;
    font-size: .82rem;
}

.carrito_item_eliminar:hover {
    color: #9b1c1f;
}

.carrito_drawer_footer {
    padding: 16px 20px 20px;
    border-top: 1px solid #eee;
    background: #fff;
}

.carrito_totales_linea {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: .95rem;
}

.carrito_descuento {
    color: #14883e;
}

.carrito_total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 1.12rem;
}

.btn_carrito_checkout {
    width: 100%;
    margin-top: 14px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--rojo);
    color: #fff;
    font-weight: 700;
}

.btn_carrito_checkout:hover {
    /* filter: brightness(.95); */
    background: #b0252a;

}

@media (max-width: 575px) {
    .carrito_drawer {
        width: 100%;
    }

    .carrito_drawer_header,
    .carrito_drawer_body,
    .carrito_drawer_footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.carrito_pagina_body {
    padding: 1rem;
}

.carrito_pagina_body .carrito_item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.carrito_pagina_body .carrito_item:first-child {
    padding-top: 0;
}

.carrito_pagina_body .carrito_item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.carrito_pagina_resumen {
    position: sticky;
    top: 1rem;
}

@media (max-width: 991.98px) {
    .carrito_pagina_resumen {
        position: static;
    }
}

.carrito_vacio_completo {
    text-align: center;
    padding: 3rem 1rem;
}

.carrito_vacio_icono {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #f3f3f3;
    color: #777;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.carrito_vacio_completo h3 {
    font-size: 1.25rem;
    margin-bottom: .35rem;
}

.carrito_vacio_completo p {
    color: #777;
    margin-bottom: 1.25rem;
}

.carrito_item_descuento_detalle {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .78rem;
    color: #777;
    margin-top: .35rem;
}

.carrito_item_descuento_detalle strong {
    color: #198754;
}

.checkout_entrega_opciones {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.checkout_entrega_opciones .btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.checkout_domicilio_box {
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 1rem;
    background: #fafafa;
}

.checkout_items {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-height: 320px;
    overflow: auto;
    padding-right: .25rem;
}

.checkout_item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #eee;
}

.checkout_item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.checkout_item_nombre {
    font-size: .9rem;
    font-weight: 600;
}

.checkout_item_cantidad {
    font-size: .8rem;
    color: #777;
}

.checkout_item_promo {
    display: inline-flex;
    margin-top: .25rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: #eaf7ef;
    color: #198754;
    font-size: .72rem;
    font-weight: 600;
}