/*
 * nav-progress.css - see assets/nav-progress.js
 *
 * Both elements are inert until the script adds .is-active, so including this
 * on a page costs nothing visually until a navigation starts.
 */

.nav-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    /* Above everything. The payment modals and SweetAlert both sit at 1060,
       and navigation is often triggered from inside one of them - the bar has
       to stay visible when it is. */
    z-index: 2147483000;
    background: linear-gradient(90deg, #ff9200, #ffc061);
    box-shadow: 0 0 8px rgba(255, 146, 0, .7);
    opacity: 0;
    pointer-events: none;
    transition: width .18s ease-out, opacity .2s ease;
}

.nav-progress-bar.is-active {
    opacity: 1;
}

/* The veil is nearly invisible: its job is to swallow a second tap on the
   button just pressed, not to hide the page. Staff on a slow connection tap
   twice, and the second tap can land on whatever the next screen puts there. */
.nav-progress-veil {
    position: fixed;
    inset: 0;
    /* One below the bar: the veil must cover the modals too, since the button
       that started the navigation is frequently inside one. */
    z-index: 2147482999;
    background: rgba(0, 0, 0, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.nav-progress-veil.is-active {
    opacity: 1;
    pointer-events: auto;
    cursor: progress;
}

/* `inset` is recent enough that an older tablet browser may ignore it, which
   would leave a 0x0 veil that blocks nothing. */
@supports not (inset: 0) {
    .nav-progress-veil { top: 0; right: 0; bottom: 0; left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-progress-bar { transition: opacity .2s ease; }
}
