/* ==========================================================================
   Spinner global, barra de progreso, botón cancelar y toasts.
   Color base: gris NRFM. Cada style-<marca>.css redefine --spinner-color.
   ========================================================================== */
:root {
    --spinner-color: #555555;
    --spinner-bg: rgba(0, 0, 0, 0.35);
    --toast-info: #2f6fdb;
    --toast-warn: #d39e00;
    --toast-error: #c0392b;
}

/* -------- Overlay + spinner -------- */
#globalAjaxOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--spinner-bg);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

#globalAjaxOverlay.is-visible {
    display: flex;
}

#globalAjaxOverlay .spinner-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 28px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    font-family: Verdana, Arial, sans-serif;
    font-size: 13px;
    color: #333;
    min-width: 220px;
}

#globalAjaxOverlay .spinner-circle {
    width: 48px;
    height: 48px;
    border: 5px solid #e6e6e6;
    border-top-color: var(--spinner-color);
    border-radius: 50%;
    animation: globalSpinnerRotate 0.9s linear infinite;
}

#globalAjaxOverlay .spinner-text {
    font-weight: bold;
    letter-spacing: 0.3px;
}

#globalAjaxOverlay .spinner-progress {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

#globalAjaxOverlay .spinner-progress[hidden] {
    display: none;
}

#globalAjaxOverlay .spinner-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--spinner-color);
    transition: width 0.15s ease-out;
}

#globalAjaxOverlay .spinner-cancel {
    margin-top: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

#globalAjaxOverlay .spinner-cancel:hover {
    background: #e8e8e8;
}

#globalAjaxOverlay .spinner-cancel[hidden] {
    display: none;
}

@keyframes globalSpinnerRotate {
    to { transform: rotate(360deg); }
}

/* -------- Toasts -------- */
#globalToastHost {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.global-toast {
    pointer-events: auto;
    min-width: 260px;
    max-width: 380px;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: Verdana, Arial, sans-serif;
    font-size: 13px;
    color: #fff;
    background: var(--toast-info);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.global-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.global-toast--warn  { background: var(--toast-warn); color: #2a2a2a; }
.global-toast--error { background: var(--toast-error); }
