/* MegaGlitch Christmas 2026: flying sleigh + frost trail. Isolated from the rest of the theme.
   Loaded only when the sleigh switch is on (MGX_SLEIGH_ON and no assets/sleigh-off file).
   Off checkout and order-received (see mgx-sleigh.js). Allowed on basket and account.
   Faces the direction of travel on both crossings: left-to-right (scaleX(-1)), then right-to-left (scaleX(1)).
   Scroll hide, pointer-events none, no layout shift. Decoration only.

   v1.3.2: the sleigh flies IN FRONT of the fairy-light garland and the bow.
   Those decorations are .mgrd-hdr::after (bow, z-index 2) and .mgrd-hdr::before
   / .mgrd-hdr-in::before (lights, z-index 1), position:absolute; top:100%.
   They live inside .mgrd-hdr's stacking context (position:sticky; z-index:100000),
   so a fixed sleigh at z-index:3 used to pass behind them. While this file is
   loaded, the header context is lowered to 40 and the sleigh is raised to 50 —
   above the lights and bow, but below the menu drawer (99999), scrim (99998),
   bottom nav (99990), sticky Enter bar (99989) and typical cookie/modals.
   pointer-events stays none. Turning the sleigh off restores the header to 100000. */
html.mgx-on body.mgrd-on .mgrd-hdr{z-index:40}
.mgx-fly{position:fixed;left:0;top:130px;width:230px;height:46px;background:none;pointer-events:none;z-index:50;opacity:0;will-change:transform;transform:translate3d(-300px,0,0) scaleX(-1);animation:mgx-fly-g var(--mgx-fly-dur,26s) linear 4s infinite}
@keyframes mgx-fly-g{
0%{transform:translate3d(-300px,0,0) scaleX(-1);opacity:0}
2%{opacity:.95}
34%{opacity:.95}
36%{transform:translate3d(calc(100vw + 60px),-8px,0) scaleX(-1);opacity:0}
36.2%,49.8%{transform:translate3d(calc(100vw + 60px),0,0) scaleX(1);opacity:0}
50%{transform:translate3d(calc(100vw + 60px),0,0) scaleX(1);opacity:0}
52%{opacity:.95}
84%{opacity:.95}
86%{transform:translate3d(-300px,-8px,0) scaleX(1);opacity:0}
86.2%,100%{transform:translate3d(-300px,0,0) scaleX(-1);opacity:0}
}
.mgx-fly-body,.mgx-fly-cy,.mgx-fly-pk,.mgx-fly-trail{position:absolute;pointer-events:none}
.mgx-fly-body{inset:0;background:url(img/mgx-sleigh.webp) 0 0/100% 100% no-repeat}
.mgx-fly-cy,.mgx-fly-pk{display:none;inset:0;-webkit-mask:url(img/mgx-sleigh.webp) 0 0/100% 100% no-repeat;mask:url(img/mgx-sleigh.webp) 0 0/100% 100% no-repeat}
.mgx-fly-trail{left:100%;top:0;width:96px;height:100%;opacity:0;pointer-events:none;
background:linear-gradient(to right,rgba(14,237,255,.28),rgba(244,3,134,.16),transparent 75%) 0 28%/90px 50% no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath fill='%230eedff' d='M3 0h1v7H3zM0 3h7v1H0zM1 1h1v1H1zM5 1h1v1H5zM1 5h1v1H1zM5 5h1v1H5z'/%3E%3C/svg%3E") 4px 34%/9px 9px no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath fill='%23f40386' d='M3 0h1v7H3zM0 3h7v1H0zM1 1h1v1H1zM5 1h1v1H5zM1 5h1v1H1zM5 5h1v1H5z'/%3E%3C/svg%3E") 20px 58%/8px 8px no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6'%3E%3Crect width='6' height='6' rx='.6' fill='%23f40386'/%3E%3Cpath stroke='%230eedff' stroke-width='.8' d='M3 0v6M0 3h6'/%3E%3C/svg%3E") 34px 20%/8px 8px no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath fill='%230eedff' d='M3 0h1v7H3zM0 3h7v1H0zM1 1h1v1H1zM5 1h1v1H5zM1 5h1v1H1zM5 5h1v1H5z'/%3E%3C/svg%3E") 48px 70%/7px 7px no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath fill='%23f40386' d='M3 0h1v7H3zM0 3h7v1H0zM1 1h1v1H1zM5 1h1v1H5zM1 5h1v1H1zM5 5h1v1H5z'/%3E%3C/svg%3E") 62px 30%/7px 7px no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6'%3E%3Crect width='6' height='6' rx='.6' fill='%23f40386'/%3E%3Cpath stroke='%230eedff' stroke-width='.8' d='M3 0v6M0 3h6'/%3E%3C/svg%3E") 74px 52%/6px 6px no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath fill='%230eedff' d='M3 0h1v7H3zM0 3h7v1H0zM1 1h1v1H1zM5 1h1v1H5zM1 5h1v1H1zM5 5h1v1H5z'/%3E%3C/svg%3E") 28px 8%/7px 7px no-repeat;
-webkit-mask-image:linear-gradient(to right,#000 0%,#000 22%,transparent 100%);
mask-image:linear-gradient(to right,#000 0%,#000 22%,transparent 100%);
animation:mgx-c-trail var(--mgx-fly-dur,26s) linear 4s infinite}
.mgx-fly-body::after{content:"";position:absolute;left:0;right:0;top:42%;height:2px;pointer-events:none;opacity:0;background:linear-gradient(90deg,transparent,#0eedff,#f40386,#0eedff,transparent);animation:mgx-c-scan var(--mgx-fly-dur,26s) linear 4s infinite}
@keyframes mgx-c-trail{
0%,2.5%,35%,50%,52.5%,85%,100%{opacity:0}
5%,33%,55%,83%{opacity:.85}
}
@keyframes mgx-c-scan{
0%,2.7%,3.6%,34.2%,35.2%,50%,52.7%,53.6%,84.2%,85.2%,100%{opacity:0;transform:translate3d(0,0,0)}
2.95%{opacity:.75;transform:translate3d(0,-6px,0)}
3.2%{opacity:.5;transform:translate3d(0,8px,0)}
34.5%{opacity:.55;transform:translate3d(0,4px,0)}
34.8%{opacity:.3;transform:translate3d(0,-5px,0)}
52.95%{opacity:.75;transform:translate3d(0,-6px,0)}
53.2%{opacity:.5;transform:translate3d(0,8px,0)}
84.5%{opacity:.55;transform:translate3d(0,4px,0)}
84.8%{opacity:.3;transform:translate3d(0,-5px,0)}
}
@media (max-width:767px){.mgx-fly{width:132px;height:27px}}
@media (prefers-reduced-motion:reduce){
.mgx-on .mgx-fly,.mgx-fly-static{display:block;animation:none;opacity:.9;transform:translate3d(calc(100vw - 250px),0,0) scaleX(-1)}
.mgx-fly-cy,.mgx-fly-pk,.mgx-fly-trail,.mgx-fly-body::after{display:none}
.mgx-fly-body{animation:none;-webkit-clip-path:none;clip-path:none}
}
@media (max-width:767px) and (prefers-reduced-motion:reduce){
.mgx-on .mgx-fly,.mgx-fly-static{transform:translate3d(calc(100vw - 148px),0,0) scaleX(-1)}
}
