/* ==========================================================================
   Amazing Glazing – animated Xmas badge  (transparent background, CSS only)
   --------------------------------------------------------------------------
   Size it with --xb-width on the .xb element, e.g.  style="--xb-width:420px".
   Everything inside scales with it. No JavaScript.
   ========================================================================== */
.xb{
  --xb-width:min(420px,90vw);
  position:relative; display:block;
  width:var(--xb-width); aspect-ratio:1200/1242;
  container-type:inline-size;
  background:transparent;
}
.xb--centre{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); }   /* centre of the nearest positioned parent */
.xb__link{ position:absolute; inset:0; display:block; border-radius:50%; outline-offset:6px; -webkit-tap-highlight-color:transparent; }
.xb__img{ position:absolute; inset:0; width:100%; height:100%; display:block; user-select:none; -webkit-user-drag:none; }
.xb__fx{ position:absolute; inset:0; isolation:isolate; pointer-events:none; }

/* ---- the lights around the circle -------------------------------------- */
.xb__b{ position:absolute; left:calc(var(--x)*1%); top:calc(var(--y)*1%); width:8%; aspect-ratio:1; transform:translate(-50%,-50%); border-radius:50%; }
.xb__b::before{            /* bulb dims */
  content:""; position:absolute; inset:27%; border-radius:50%;
  background:radial-gradient(circle,rgba(70,12,0,.85) 0%,rgba(110,24,0,.55) 55%,rgba(110,24,0,0) 100%);
  mix-blend-mode:multiply; animation:xb-dim var(--p) ease-in-out var(--d) infinite;
}
.xb__b::after{             /* bulb glows */
  content:""; position:absolute; inset:-6%; border-radius:50%;
  background:radial-gradient(circle,rgba(255,252,222,1) 0%,rgba(255,226,130,.9) 20%,rgba(255,180,70,.4) 46%,rgba(255,150,40,0) 70%);
  mix-blend-mode:screen; animation:xb-glow var(--p) ease-in-out var(--d) infinite;
}
@keyframes xb-glow{ 0%,100%{opacity:.25;transform:scale(.8)} 30%{opacity:.9;transform:scale(1.12)} 58%{opacity:.45;transform:scale(.9)} 78%{opacity:.9;transform:scale(1.08)} }
@keyframes xb-dim { 0%,100%{opacity:.85}                      30%{opacity:0}                      58%{opacity:.7}                       78%{opacity:.05} }

/* ---- sparkles on the bow and ribbon ------------------------------------ */
.xb__s{ position:absolute; left:calc(var(--x)*1%); top:calc(var(--y)*1%); width:4.6%; aspect-ratio:1; transform:translate(-50%,-50%) scale(0); opacity:0;
  background:#fff; clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%);
  filter:drop-shadow(0 0 4px #fff); animation:xb-spark 6s ease-in-out var(--d) infinite; }
@keyframes xb-spark{ 0%,55%,100%{opacity:0;transform:translate(-50%,-50%) scale(0) rotate(0)} 72%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(45deg)} 88%{opacity:0;transform:translate(-50%,-50%) scale(.3) rotate(90deg)} }

/* ---- 25% OFF: a small pulse -------------------------------------------- */
.xb__offer{ position:absolute; left:31.04%; top:63.75%; width:37.25%; height:16.25%; transform-origin:50% 55%; animation:xb-pulse 6s ease-in-out infinite; }
@keyframes xb-pulse{ 0%,34%,100%{transform:scale(1);filter:none} 12%{transform:scale(1.075);filter:drop-shadow(0 0 .9cqw rgba(255,235,200,.85))} 22%{transform:scale(1);filter:none} 28%{transform:scale(1.035);filter:drop-shadow(0 0 .5cqw rgba(255,235,200,.5))} }

/* ---- CTA button: pulse, glow and a shine across it ---------------------- */
.xb__cta{ position:absolute; left:31.81%; top:81.6%; width:33.89%; height:5.4%; border-radius:1.5cqw; transform-origin:50% 50%; animation:xb-cta 6s ease-in-out -3s infinite; }
.xb__cta img{ position:absolute; inset:0; width:100%; height:100%; display:block; }
@keyframes xb-cta{ 0%,40%,100%{transform:scale(1);filter:none} 14%{transform:scale(1.07);filter:drop-shadow(0 0 1.4cqw rgba(255,255,255,.95)) drop-shadow(0 .6cqw .8cqw rgba(60,0,0,.45))} 26%{transform:scale(1)} }
.xb__shine{ position:absolute; inset:0; border-radius:inherit; overflow:hidden; }
.xb__shine::after{ content:""; position:absolute; top:-20%; bottom:-20%; left:0; width:30%;
  background:linear-gradient(100deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.9) 50%,rgba(255,255,255,0) 100%);
  transform:translateX(-130%) skewX(-18deg); animation:xb-shine 12s ease-in-out infinite; }
@keyframes xb-shine{ 0%,12%{transform:translateX(-130%) skewX(-18deg)} 34%,100%{transform:translateX(430%) skewX(-18deg)} }

/* people who ask for less motion get the still badge */
@media (prefers-reduced-motion:reduce){ .xb__b::before,.xb__b::after,.xb__s,.xb__shine::after,.xb__offer,.xb__cta{ animation:none } .xb__b::before{opacity:0} .xb__b::after{opacity:.4} .xb__s{opacity:0} }
