/* --- DISEÑO COMPLETO OFF-CANVAS DEL CARRITO --- */

:root {
    --primary-color: #2563eb;       /* Azul moderno para botones clave */
    --primary-hover: #1d4ed8;
    --bg-card: #ffffff;
    --bg-body: #f8fafc;
    --text-title: #0f172a;
    --border-color: #e2e8f0;
}

/* Contenedor general */
.custom-cart-body {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

#offcanvasExample > .offcanvas-body {
    display: flex;
    min-height: 0;
    overflow: hidden;
}
/* Contenedor con scroll para productos */
.cart-items-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

/* Barra de scroll estilizada */
.cart-items-container::-webkit-scrollbar {
    width: 5px;
}
.cart-items-container::-webkit-scrollbar-track {
    background: transparent;
}
.cart-items-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Tarjeta individual de Producto */
.cart-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.cart-item-title {
    font-size: 14pt;
    font-weight: 600;
    color: var(--text-title);
    line-height: 1.3;
}

.cart-item-img {
    object-fit: contain;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.cart-item-img:hover {
    transform: scale(1.05);
}

/* Botón eliminar (X) */
.btn-remove-item {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10pt;
    transition: all 0.2s ease;
}

.btn-remove-item:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* Selector de cantidad compacto y limpio */
.quantity-selector {
    max-width: 110px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px;
    border: 1px solid var(--border-color);
}

.btn-qty {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 2px 8px;
    font-size: 11pt;
    transition: color 0.2s;
}

.btn-qty:hover {
    color: var(--primary-color);
    background-color: transparent;
}

.qty-input {
    background: transparent !important;
    border: none !important;
    text-align: center;
    font-weight: 600;
    font-size: 10.5pt;
    color: var(--text-title);
    padding: 0;
}

/* Remover flechas del input number nativo */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item-subtotal {
    font-size: 12pt;
    font-weight: 700;
    color: var(--primary-color);
}

/* --- SECCIÓN RESUMEN INFERIOR --- */
.cart-summary-section {
    background: var(--bg-card);
    margin: 0 -0.5rem 0 -0.5rem; /* Full bleed a los lados inferiores */
    padding: 0rem 1rem;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.08);

}

.summary-title {
    font-size: 13pt;
    font-weight: 700;
    color: var(--text-title);
}

.fw-extrabold {
    font-weight: 800;
}

/* Botón Realizar Pedido (Llamativo e Interactivo) */
.btn-checkout {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11pt;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
}

.btn-checkout:active {
    transform: translateY(1px);
}

/* Botón Continuar Comprando */
.btn-continue {
    background: transparent;
    color: #64748b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 500;
    font-size: 10pt;
    transition: all 0.2s ease;
}

.btn-continue:hover {
    background: #f8fafc;
    color: var(--text-title);
    border-color: #94a3b8;
}


/* --- SECCIÓN EXTRA EXPANDIBLE --- */
/* Cláusula de descargo pequeña */
.custom-disclaimer {
    font-size: 7.5pt;
    line-height: 1.4;
    color: #94a3b8;
}

/* El cierre del carrito aparece cuando el usuario llega al final de los productos. */
[data-cart-end-section] {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

[data-cart-end-section].cart-end-section-visible {
    max-height: 180px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-cart-end-section] {
        transition: none;
    }
}


