/* ==========================================================================
   page-loader.css (v3) - the "QR builds itself" loader shown while a storefront page loads.
   Pure CSS. It only shows while <html> has the attribute data-qrx (set by /js/page-loader.js the moment a customer taps something).
   THE RULE THAT MAKES IT WORK ON iPHONE: the moment a page starts to leave, Safari FREEZES the old page (animations and transitions stop
   after the very first frame). So nothing here fades in, grows in or waits: the FIRST frame after the tap is already the complete loader
   (full QR, bar, label). Everything that moves starts from that same picture and returns to it, so even if Safari freezes the page
   the person still sees a finished loader, and where the page keeps moving (Android, computers) it looks alive.
   Also: only transform and opacity move (smooth on the iPhone's graphics chip), no inset / flex gap (iOS before 14.5 ignores both),
   no blur, no animated shadows.
   ========================================================================== */

   html { --qrx-accent: var(--brand-accent, #fc8503); --qrx-dark: #12284a; }

   /* ---- the thin bar along the top edge: jumps forward at once, then keeps creeping ---- */
   html #qrxNavBar {
     position: fixed; top: 0; left: 0; width: 100%; height: 4px; opacity: 0; z-index: 100000; pointer-events: none;
     border-radius: 0 4px 4px 0; background: var(--qrx-accent); box-shadow: 0 0 8px var(--qrx-accent);
     -webkit-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: 0 50%; transform-origin: 0 50%;
     -webkit-transition: opacity .2s ease; transition: opacity .2s ease;
   }
   html[dir="rtl"] #qrxNavBar { left: auto; right: 0; border-radius: 4px 0 0 4px; -webkit-transform-origin: 100% 50%; transform-origin: 100% 50%; }
   html[data-qrx] #qrxNavBar { opacity: 1; -webkit-transform: scaleX(.3); transform: scaleX(.3); -webkit-transition: none; transition: none; -webkit-animation: qrxBarGrow 12s cubic-bezier(.1, .7, .2, 1) forwards; animation: qrxBarGrow 12s cubic-bezier(.1, .7, .2, 1) forwards; will-change: transform; }
   @-webkit-keyframes qrxBarGrow { 0% { -webkit-transform: scaleX(.3); } 100% { -webkit-transform: scaleX(.94); } }
   @keyframes qrxBarGrow { 0% { transform: scaleX(.3); } 100% { transform: scaleX(.94); } }
   
   /* ---- the veil: dims the page a little ---------------------------------- */
   html #qrxNavVeil {
     position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
     background: rgba(255, 255, 255, .6); opacity: 0; visibility: hidden; pointer-events: none;
     -webkit-transition: opacity .18s ease, visibility 0s linear .18s; transition: opacity .18s ease, visibility 0s linear .18s;
   }
   html[data-qrx] #qrxNavVeil { opacity: 1; visibility: visible; -webkit-transition: none; transition: none; }
   
   /* ---- the card (no flex "gap": spacing is done with margins) -------------- */
   html .qrx-card {
     display: flex; flex-direction: column; align-items: center; padding: 30px 34px 22px;
     padding-top: 45px;
     border-radius: 26px; background: #fff; box-shadow: 0 10px 30px -8px rgba(18, 40, 74, .35);
     -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
   }
   
   /* ---- the QR tile (7 x 7 modules) ----------------------------------------- */
   html .qrx-qr {
     position: relative; width: 96px; height: 96px; display: grid;
     grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); grid-gap: 2px; gap: 2px;
   }
   /* scanner frame: four corner brackets that breathe */
   html .qrx-qr::before {
     content: ""; position: absolute; top: -13px; right: -13px; bottom: -13px; left: -13px; pointer-events: none; background-repeat: no-repeat;
     background-image:
       linear-gradient(var(--qrx-accent), var(--qrx-accent)), linear-gradient(var(--qrx-accent), var(--qrx-accent)),
       linear-gradient(var(--qrx-accent), var(--qrx-accent)), linear-gradient(var(--qrx-accent), var(--qrx-accent)),
       linear-gradient(var(--qrx-accent), var(--qrx-accent)), linear-gradient(var(--qrx-accent), var(--qrx-accent)),
       linear-gradient(var(--qrx-accent), var(--qrx-accent)), linear-gradient(var(--qrx-accent), var(--qrx-accent));
     background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
     background-size: 18px 3px, 3px 18px, 18px 3px, 3px 18px, 18px 3px, 3px 18px, 18px 3px, 3px 18px;
   }
   html[data-qrx] .qrx-qr::before { -webkit-animation: qrxBreath 1.8s ease-in-out infinite; animation: qrxBreath 1.8s ease-in-out infinite; will-change: transform; }
   @-webkit-keyframes qrxBreath { 0%, 100% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(1.07); } }
   @keyframes qrxBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
   
   /* the three corner "finder" squares */
   html .qrx-qr b { position: relative; display: block; box-sizing: border-box; border: 3px solid var(--qrx-dark); border-radius: 6px; }
   html .qrx-qr b::after { content: ""; position: absolute; top: 5px; right: 5px; bottom: 5px; left: 5px; border-radius: 3px; background: var(--qrx-dark); }
   html .qrx-qr .f1 { grid-area: 1 / 1 / 4 / 4; --d: .00s; }
   html .qrx-qr .f2 { grid-area: 1 / 5 / 4 / 8; --d: .08s; }
   html .qrx-qr .f3 { grid-area: 5 / 1 / 8 / 4; --d: .16s; }
   
   /* the data modules (a few in the restaurant's accent colour: static, so nothing extra has to be redrawn) */
   html .qrx-qr span { display: block; border-radius: 3px; background: var(--qrx-dark); }
   html .qrx-qr span:nth-of-type(2), html .qrx-qr span:nth-of-type(6), html .qrx-qr span:nth-of-type(9), html .qrx-qr span:nth-of-type(13) { background: var(--qrx-accent); }
   html .qrx-qr span:nth-of-type(1)  { grid-area: 1 / 4; --d: 0.20s; }
   html .qrx-qr span:nth-of-type(2)  { grid-area: 3 / 4; --d: 0.28s; }
   html .qrx-qr span:nth-of-type(3)  { grid-area: 4 / 1; --d: 0.20s; }
   html .qrx-qr span:nth-of-type(4)  { grid-area: 4 / 3; --d: 0.28s; }
   html .qrx-qr span:nth-of-type(5)  { grid-area: 4 / 4; --d: 0.32s; }
   html .qrx-qr span:nth-of-type(6)  { grid-area: 4 / 6; --d: 0.40s; }
   html .qrx-qr span:nth-of-type(7)  { grid-area: 5 / 4; --d: 0.36s; }
   html .qrx-qr span:nth-of-type(8)  { grid-area: 5 / 6; --d: 0.44s; }
   html .qrx-qr span:nth-of-type(9)  { grid-area: 5 / 7; --d: 0.48s; }
   html .qrx-qr span:nth-of-type(10) { grid-area: 6 / 5; --d: 0.44s; }
   html .qrx-qr span:nth-of-type(11) { grid-area: 6 / 7; --d: 0.52s; }
   html .qrx-qr span:nth-of-type(12) { grid-area: 7 / 4; --d: 0.44s; }
   html .qrx-qr span:nth-of-type(13) { grid-area: 7 / 6; --d: 0.52s; }
   html .qrx-qr span:nth-of-type(14) { grid-area: 7 / 7; --d: 0.56s; }
   
   /* a wave from the top-left: each module dims and shrinks, then comes back. At rest (and at every moment the page might be frozen) the QR is complete. */
   html[data-qrx] .qrx-qr span, html[data-qrx] .qrx-qr b {
     -webkit-animation: qrxWave 1.8s ease-in-out var(--d) infinite; animation: qrxWave 1.8s ease-in-out var(--d) infinite; will-change: transform, opacity;
   }
   @-webkit-keyframes qrxWave { 0%, 55%, 100% { -webkit-transform: scale(1); opacity: 1; } 75% { -webkit-transform: scale(.35); opacity: .2; } }
   @keyframes qrxWave { 0%, 55%, 100% { transform: scale(1); opacity: 1; } 75% { transform: scale(.35); opacity: .2; } }
   
   /* the scanner beam */
   html .qrx-qr em {
     position: absolute; left: -16px; right: -16px; top: 0; height: 3px; border-radius: 3px; opacity: .95; pointer-events: none;
     -webkit-transform: translate3d(0, 46px, 0); transform: translate3d(0, 46px, 0);
     background: linear-gradient(90deg, transparent, var(--qrx-accent) 18%, #fff 50%, var(--qrx-accent) 82%, transparent);
   }
   html[data-qrx] .qrx-qr em { -webkit-animation: qrxBeam 2.2s ease-in-out infinite; animation: qrxBeam 2.2s ease-in-out infinite; will-change: transform; }
   @-webkit-keyframes qrxBeam { 0%, 100% { -webkit-transform: translate3d(0, 46px, 0); } 25% { -webkit-transform: translate3d(0, 2px, 0); } 75% { -webkit-transform: translate3d(0, 92px, 0); } }
   @keyframes qrxBeam { 0%, 100% { transform: translate3d(0, 46px, 0); } 25% { transform: translate3d(0, 2px, 0); } 75% { transform: translate3d(0, 92px, 0); } }
   
   /* the label: margins instead of flex "gap" */
   html .qrx-label { display: flex; align-items: center; justify-content: center; margin-top: 35px; font: 600 .82rem/1 Inter, Rubik, -apple-system, system-ui, sans-serif; letter-spacing: .03em; color: var(--qrx-dark); opacity: .8; }
   html .qrx-label u { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--qrx-accent); text-decoration: none; opacity: .55; margin-left: 6px; }
   html[dir="rtl"] .qrx-label u { margin-left: 0; margin-right: 6px; }
   html[data-qrx] .qrx-label u { -webkit-animation: qrxDot 1.2s ease-in-out var(--n, 0s) infinite; animation: qrxDot 1.2s ease-in-out var(--n, 0s) infinite; }
   html .qrx-label u:nth-of-type(2) { --n: .15s; } html .qrx-label u:nth-of-type(3) { --n: .30s; }
   @-webkit-keyframes qrxDot { 0%, 70%, 100% { opacity: .55; -webkit-transform: translate3d(0, 0, 0); } 35% { opacity: 1; -webkit-transform: translate3d(0, -4px, 0); } }
   @keyframes qrxDot { 0%, 70%, 100% { opacity: .55; transform: translate3d(0, 0, 0); } 35% { opacity: 1; transform: translate3d(0, -4px, 0); } }
   
   /* "Reduce Motion" (very common on iPhones): nothing grows, flies or bounces, but the loader still looks alive: it fades softly. */
   @media (prefers-reduced-motion: reduce) {
     html[data-qrx] .qrx-qr span, html[data-qrx] .qrx-qr b { -webkit-animation: qrxSoft 1.6s ease-in-out var(--d) infinite; animation: qrxSoft 1.6s ease-in-out var(--d) infinite; }
     html[data-qrx] .qrx-qr::before { -webkit-animation: qrxSoftFrame 1.6s ease-in-out infinite; animation: qrxSoftFrame 1.6s ease-in-out infinite; }
     html[data-qrx] .qrx-label u { -webkit-animation: qrxSoftDot 1.2s ease-in-out var(--n, 0s) infinite; animation: qrxSoftDot 1.2s ease-in-out var(--n, 0s) infinite; }
     html[data-qrx] .qrx-qr em { -webkit-animation: none; animation: none; }
   }
   @-webkit-keyframes qrxSoft { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
   @keyframes qrxSoft { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
   @-webkit-keyframes qrxSoftFrame { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
   @keyframes qrxSoftFrame { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
   @-webkit-keyframes qrxSoftDot { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
   @keyframes qrxSoftDot { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
   
   /* Bootstrap forces every [hidden] element to display:none !important. The "hidden" attribute on the veil is only a safety
      net for the case where this file is missing, so when this file IS loaded it must be allowed to show. */
   html #qrxNavVeil[hidden] { display: flex !important; }