﻿/* ---------- Backdrop ---------- */
.mini-cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1049; /* under drawer */
}

    .mini-cart-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

/* ---------- Drawer ---------- */
.mini-cart {
    position: fixed;
    top: 0;
    right: -420px; /* hidden offscreen */
    width: 420px;
    max-width: 100%;
    height: 100vh;
    background: var(--tblr-bg-surface, #111827);
    color: var(--tblr-body-color, #e5e7eb);
    box-shadow: -8px 0 24px rgba(0,0,0,.35);
    z-index: 1050; /* above backdrop */
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
    will-change: right;
    overflow: hidden;
}

    .mini-cart.open { /* shown state */
        right: 0;
    }

/* ---------- Header / Body / Footer ---------- */
.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .mini-cart-header .title {
        font-weight: 600;
        color: #fff;
    }

.mini-cart-body {
    padding: 12px;
    overflow-y: auto; /* scrollable */
    flex: 1;
    scrollbar-width: thin;
}

    .mini-cart-body::-webkit-scrollbar {
        width: 8px;
    }

    .mini-cart-body::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.15);
        border-radius: 6px;
    }

.mini-cart-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
}

/* ---------- Items ---------- */
.mini-cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255,255,255,.08);
    color: #e5e7eb;
}

    .mini-cart-item:last-child {
        border-bottom: 0;
    }

    .mini-cart-item .name {
        font-weight: 600;
    }

    .mini-cart-item .meta {
        font-size: .85rem;
        color: #9ca3af;
    }

    .mini-cart-item .qty {
        display: flex;
        gap: 6px;
        align-items: center;
    }

        .mini-cart-item .qty input {
            width: 60px;
        }

    .mini-cart-item .price {
        font-weight: 700;
        text-align: right;
    }

/* ---------- Optional hover preview (unchanged) ---------- */
.cart-preview {
    position: absolute;
    right: 10px;
    top: 56px;
    width: 360px;
    max-width: 90vw;
    background: var(--tblr-bg-surface,#111827);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 10px;
    z-index: 1051;
}

    .cart-preview .row {
        display: flex;
        justify-content: space-between;
        font-size: .9rem;
        padding: 6px 0;
        border-bottom: 1px dashed rgba(255,255,255,.08);
    }

        .cart-preview .row:last-child {
            border-bottom: 0;
        }

    .cart-preview .total {
        text-align: right;
        font-weight: 700;
        margin-top: 6px;
    }

/* ---------- Toasts (as you had) ---------- */
.toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #1f2937;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
    animation: toast-in .18s ease both;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}