/* =========================================================
   AJAX: پیام‌های موقت (toast) و حالت بارگذاری
   ========================================================= */

.moj-toasts {
    position: fixed;
    inset-block-end: 20px;
    inset-inline-start: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(92vw, 380px);
    pointer-events: none;
}

.moj-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #24372F;
    color: #F5F1E8;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
}

.moj-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.moj-toast--error {
    background: #8E3B2A;
}

.moj-toast__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #D9E84A;
    color: #24372F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.moj-toast--error .moj-toast__icon {
    background: #F5F1E8;
    color: #8E3B2A;
}

.moj-toast__link {
    margin-inline-start: auto;
    color: #D9E84A;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.moj-toast__link:hover {
    text-decoration: underline;
}

/* نشان سبد خرید: انیمیشن کوتاه هنگام تغییر */
.site-header__cart-badge.is-bump {
    animation: moj-bump .45s ease;
}

@keyframes moj-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* دکمه افزودن به سبد در حال ارسال */
form[data-ajax-cart] button.is-busy {
    opacity: .7;
    cursor: progress;
}

/* نتایج محصولات در حال بارگذاری */
.catalog-results {
    transition: opacity .2s ease;
}

.catalog-results.is-loading {
    opacity: .45;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .moj-toast,
    .catalog-results {
        transition: none;
    }

    .site-header__cart-badge.is-bump {
        animation: none;
    }
}
