/* لودینگ سراسری — لینک، فرم، AJAX */
.teb20-global-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 2147483647 !important;
    pointer-events: none;
}

.teb20-global-loading.is-visible {
    display: block;
}

.teb20-global-loading__bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #4670CE 0%, #5a84e8 50%, #4670CE 100%);
    background-size: 200% 100%;
    transform: scaleX(0);
    transform-origin: right center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.teb20-global-loading.is-visible .teb20-global-loading__bar {
    opacity: 1;
    transform: scaleX(1);
    animation: teb20-global-bar-shimmer 1.1s linear infinite;
}

.teb20-global-loading__toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.28);
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.teb20-global-loading.is-visible .teb20-global-loading__toast {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.teb20-global-loading__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: teb20-global-spin 0.7s linear infinite;
    flex-shrink: 0;
}

html.teb20-global-loading-active {
    cursor: progress;
}

html.teb20-global-loading-active a,
html.teb20-global-loading-active button {
    cursor: progress;
}

.teb20-is-click-loading {
    opacity: 0.78;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

button.teb20-is-click-loading,
input[type="submit"].teb20-is-click-loading,
.btn.teb20-is-click-loading {
    position: relative;
}

button.teb20-is-click-loading::after,
input[type="submit"].teb20-is-click-loading::after,
.btn.teb20-is-click-loading::after {
    content: "";
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    margin-right: 0.4em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: teb20-global-spin 0.65s linear infinite;
    vertical-align: -0.12em;
}

@media only screen and (max-width: 991px) {
    body:has(.main-wrapper) .teb20-global-loading__toast {
        bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    }
}

@keyframes teb20-global-bar-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes teb20-global-spin {
    to {
        transform: rotate(360deg);
    }
}
