/**
 * Overlay de carregamento global — NutriX (todas as telas)
 */

body.nutrix-global-loading-active {
    overflow: hidden;
}

#nutrix-global-loading {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--apple-sp-6, 24px);
    background: color-mix(in srgb, var(--apple-bg-system-primary, #fff) 72%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: all;
}

#nutrix-global-loading.is-active {
    display: flex;
}

#nutrix-global-loading .nutrix-global-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--apple-sp-4, 16px);
    max-width: 320px;
    text-align: center;
}

#nutrix-global-loading .nutrix-global-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--apple-gray-200, #e5e5ea);
    border-top-color: var(--apple-tint-blue, #007aff);
    border-radius: var(--apple-radius-full, 50%);
    animation: nutrix-global-spin 0.75s linear infinite;
}

#nutrix-global-loading .nutrix-global-loading-title {
    margin: 0;
    font-size: var(--apple-text-headline, 17px);
    font-weight: 600;
    color: var(--apple-label, #000);
}

#nutrix-global-loading .nutrix-global-loading-subtitle {
    margin: 0;
    font-size: var(--apple-text-footnote, 13px);
    color: var(--apple-label-secondary, #3c3c43);
}

@keyframes nutrix-global-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    #nutrix-global-loading .nutrix-global-loading-spinner {
        animation: none;
        border-top-color: var(--apple-tint-blue, #007aff);
    }
}
