/* ============================================
   Mini Cart — Toast Notification + Drawer
   ============================================ */

/* --- Toast Notification --- */
.mini-cart-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-left: 4px solid var(--mint);
    padding: 16px;
    z-index: 1040;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.mini-cart-toast.visible {
    transform: translateX(0);
}

.mini-cart-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mini-cart-toast-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.mini-cart-toast-title i {
    color: var(--mint);
    font-size: 16px;
}

.mini-cart-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

.mini-cart-toast-close:hover {
    color: var(--text-primary);
}

.mini-cart-toast-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: var(--bg-warm);
    border-radius: 8px;
}

.mini-cart-toast-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.mini-cart-toast-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-cart-toast-item-qty {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mini-cart-toast-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 2px;
}

.mini-cart-toast-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
}

.mini-cart-toast-total-amount {
    font-weight: 700;
    color: var(--text-primary);
}

.mini-cart-toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.mini-cart-toast-actions a {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.mini-cart-toast-actions .btn-checkout {
    background: var(--mint);
    color: #fff;
}

.mini-cart-toast-actions .btn-checkout:hover {
    background: var(--mint-hover);
}

.mini-cart-toast-actions .btn-view-cart {
    background: #fff;
    border: 1.5px solid #dfe6e9;
    color: var(--text-secondary);
}

.mini-cart-toast-actions .btn-view-cart:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* --- Drawer Backdrop --- */
.mini-cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.mini-cart-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* --- Drawer --- */
.mini-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: #fff;
    z-index: 1051;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}

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

.mini-cart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.mini-cart-drawer-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 400;
}

.mini-cart-drawer-count {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mini-cart-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f2f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.mini-cart-drawer-close:hover {
    background: #dfe6e9;
    color: var(--text-primary);
}

/* --- Drawer Item List --- */
.mini-cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.mini-cart-drawer-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f2f6;
    transition: opacity 0.2s ease, max-height 0.3s ease;
    overflow: hidden;
}

.mini-cart-drawer-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mini-cart-drawer-item.removing {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
}

.mini-cart-drawer-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.mini-cart-drawer-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.mini-cart-drawer-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-cart-drawer-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
    flex-shrink: 0;
}

.mini-cart-drawer-item-delete:hover {
    color: #d63031;
}

.mini-cart-drawer-item-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.mini-cart-drawer-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* Quantity stepper */
.mini-cart-qty {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

.mini-cart-qty button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.mini-cart-qty button:hover {
    background: #eee;
    color: var(--text-primary);
}

.mini-cart-qty span {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
}

.mini-cart-drawer-item-price {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

/* --- Drawer Footer --- */
.mini-cart-drawer-footer {
    padding: 16px 20px 20px;
    border-top: 2px solid var(--text-primary);
    flex-shrink: 0;
}

.mini-cart-drawer-promo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-warm);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.mini-cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mini-cart-drawer-subtotal-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-cart-drawer-subtotal-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.mini-cart-drawer-shipping {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.mini-cart-drawer-checkout {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--mint);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.mini-cart-drawer-checkout:hover {
    background: var(--mint-hover);
    color: #fff;
}

.mini-cart-drawer-viewcart {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: underline;
}

.mini-cart-drawer-viewcart:hover {
    color: var(--text-primary);
}

/* --- Empty State --- */
.mini-cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    text-align: center;
}

.mini-cart-drawer-empty i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.mini-cart-drawer-empty p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 15px;
}

.mini-cart-drawer-empty a {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.mini-cart-drawer-empty a:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* --- Cart badge pulse --- */
@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-badge.pulse {
    animation: badge-pulse 0.3s ease;
}

/* --- Body scroll lock --- */
body.mini-cart-open {
    overflow: hidden;
}

/* --- Mobile --- */
@media (max-width: 767px) {
    .mini-cart-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .mini-cart-drawer {
        width: 100%;
    }
}
