/* ==========================================================================
   ESTILOS DEL CARRITO SIDEBAR (OFF-CANVAS)
   ========================================================================== */

/* Fondo oscuro (Backdrop) */
.cart-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}
.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Panel Lateral */
.cart-sidebar {
    position: fixed;
    top: 0; right: -450px; /* Oculto a la derecha */
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #ffffff;
    z-index: 1002;
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Efecto slide suave */
    display: flex;
    flex-direction: column;
    font-family: 'Lexend', sans-serif;
}
.cart-sidebar.open {
    right: 0;
}

/* Header */
.cart-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}
.cart-header h2 { font-size: 20px; color: #333; margin: 0; }
.close-cart {
    background: none; border: none; font-size: 28px; color: #999; cursor: pointer; line-height: 1;
}
.close-cart:hover { color: #333; }

/* Body (Scrollable) */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f9f9;
}

/* Tarjeta de Producto Mini */
.cart-item {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    position: relative;
    transition: transform 0.2s;
}
.cart-item:hover { transform: translateY(-2px); }

.cart-item-img {
    width: 70px; height: 70px;
    border-radius: 8px;
    background: #f4f4f4;
    padding: 5px;
    object-fit: contain;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item-ref { font-size: 11px; color: #999; }

.cart-item-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.cart-item-qty { font-size: 13px; color: #666; background: #f0f0f0; padding: 2px 8px; border-radius: 4px; }
.cart-item-price { font-size: 15px; font-weight: 700; color: #007bff; }

/* Badge de Calibración */
.cart-calib-badge {
    font-size: 10px;
    color: #fff;
    background-color: #28a745;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
    width: fit-content;
}

/* Botón Eliminar */
.cart-item-remove {
    background: none; border: none;
    color: #ff6b6b; cursor: pointer;
    position: absolute;
    top: 10px; right: 10px;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.cart-item-remove:hover { opacity: 1; }
.cart-item-remove svg { width: 16px; height: 16px; }

/* Footer */
.cart-footer {
    padding: 25px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}
.cart-tax-note { font-size: 12px; color: #888; text-align: right; margin-bottom: 20px; }

.btn-checkout {
    display: block;
    width: calc(100% - 28px);
    background-color: #007bff;
    color: #fff;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.3s;
}
.btn-checkout:hover { background-color: #0056b3; }

.cart-empty-state { text-align: center; padding: 40px 0; color: #888; }
.btn-continue { color: #007bff; text-decoration: underline; font-weight: 600; }