/* ══════════════════════════════════════
   CART DRAWER + CHECKOUT STYLES
   DIESEL SOLUCIONES
══════════════════════════════════════ */

/* ── Overlay ── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Drawer ── */
.cart-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 420px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    color: white;
}

.cart-drawer-header h2 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: white;
}

.cart-drawer-header h2 i { color: #D4AF37; }

.cart-drawer-close {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: 0.2s;
    line-height: 1;
}

.cart-drawer-close:hover { color: white; }

/* ── Items list ── */
.cart-drawer-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-drawer-items::-webkit-scrollbar { width: 4px; }
.cart-drawer-items::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 4px; }

.cart-item-row {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.9rem;
    border: 1px solid #F3F4F6;
    border-radius: 10px;
    background: #FAFAFA;
    transition: 0.2s;
}

.cart-item-row:hover { border-color: #D4AF37; }

.cart-item-icon {
    width: 46px; height: 46px;
    background: #F3F4F6;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #9CA3AF;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cart-item-info { flex-grow: 1; min-width: 0; }

.cart-item-code {
    font-size: 0.68rem;
    color: #6B7280;
    font-family: monospace;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.cart-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #B8962E;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.qty-buttons {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #F3F4F6;
    border-radius: 8px;
    padding: 2px;
}

.qty-btn {
    width: 26px; height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.15s;
    color: #374151;
    font-weight: 700;
}

.qty-btn:hover { background: #D4AF37; color: #111; }
.qty-display { font-size: 0.82rem; font-weight: 700; min-width: 18px; text-align: center; }

.remove-item-btn {
    background: none;
    border: none;
    color: #D1D5DB;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    padding: 0;
    line-height: 1;
}

.remove-item-btn:hover { color: #EF4444; }

/* ── Empty cart ── */
.cart-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #9CA3AF;
}

.cart-empty-state i { font-size: 3rem; margin-bottom: 1rem; color: #E5E7EB; }
.cart-empty-state h3 { font-size: 1rem; font-weight: 600; color: #374151; margin-bottom: 0.4rem; }
.cart-empty-state p  { font-size: 0.82rem; }

/* ── Footer (summary + checkout) ── */
.cart-drawer-footer {
    border-top: 1px solid #E5E7EB;
    padding: 1.25rem 1.5rem;
    background: white;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6B7280;
    padding: 0.3rem 0;
}

.cart-summary-row.total {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E5E7EB;
}

.cart-summary-row.total .total-amount { color: #B8962E; }

.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem;
    background: #D4AF37;
    color: #111;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    margin-top: 1rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-checkout:hover { background: #B8962E; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,175,55,0.35); }

/* ── Cart badge on header button ── */
.cart-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-header-badge {
    position: absolute;
    top: -8px; right: -8px;
    background: #EF4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
    pointer-events: none;
}

/* ── Cart button animations ── */
@keyframes cartBounce {
    0%   { transform: scale(1); }
    20%  { transform: scale(1.35) rotate(-8deg); }
    40%  { transform: scale(0.9) rotate(5deg); }
    60%  { transform: scale(1.2) rotate(-4deg); }
    80%  { transform: scale(0.95) rotate(2deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes badgePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.8); background: #D4AF37; color: #111; }
    70%  { transform: scale(0.85); }
    100% { transform: scale(1); background: #EF4444; color: white; }
}

@keyframes flyToBadge {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

.cart-btn-bounce {
    animation: cartBounce 0.55s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.cart-badge-pop {
    animation: badgePop 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fly-dot {
    position: fixed;
    width: 18px;
    height: 18px;
    background: #D4AF37;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #111;
    font-weight: 900;
    pointer-events: none;
    z-index: 9999;
    animation: flyToBadge 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 2px 8px rgba(212,175,55,0.6);
}

/* ── Toast ── */
.ds-toast {
    position: fixed;
    bottom: 2rem; right: 2rem;
    background: #111;
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    z-index: 9999;
    border-left: 4px solid #D4AF37;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: slideInToast 0.3s ease;
    max-width: 320px;
}

@keyframes slideInToast {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}
