/* Printstrap 21.11 v2: wspolna warstwa „ladowanie i ruch” (czekaj.js) — sklep, konto klienta i panel admina.
   1) pasek postepu u gory (rosnie, na koniec dojezdza do 100% i gasnie), 2) po 1,5 s pastylka „Prosze czekac…”,
   3) kolko na kliknietym przycisku, 4) szkielety tresci (.sk*, p.loading), 5) wjazd elementow przy przewijaniu (.rv),
   6) zdjecia: migotanie tla do czasu zaladowania i lagodne pojawienie, 7) plynne przejscia miedzy stronami (View Transitions).
   Barwy z ksiegi znaku (pomaranczowy #FD7C2E, granat #0F1F38). Bez stylow inline (CSP): wszystko w klasach. Ruch wylacza prefers-reduced-motion. */
@keyframes czk-rot { to { transform: rotate(360deg) } }
@keyframes czk-grow { 0% { transform: scaleX(0) } 10% { transform: scaleX(.18) } 40% { transform: scaleX(.55) } 100% { transform: scaleX(.92) } }
@keyframes czk-shine { 0% { background-position: 150% 0 } 100% { background-position: -50% 0 } }
@keyframes czk-in { from { opacity: 0; translate: 0 14px } to { opacity: 1; translate: 0 0 } }
@keyframes czk-fade { from { opacity: 0 } to { opacity: 1 } }

/* ---- 1. pasek postepu */
.czk-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2147483000; pointer-events: none;
  opacity: 0; transition: opacity .25s ease-out .1s;
}
.czk-bar i {
  position: absolute; inset: 0; display: block; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #E8621A 0%, #FD7C2E 55%, #FFA15E 100%);
  box-shadow: 0 0 12px rgba(253, 124, 46, .55), 0 0 3px rgba(253, 124, 46, .7);
  border-radius: 0 3px 3px 0;
}
[dir=rtl] .czk-bar i { transform-origin: 100% 50%; border-radius: 3px 0 0 3px }
.czk-bar i::after { /* swiatlo biegnace po pasku */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 100%);
  background-size: 40% 100%; background-repeat: no-repeat; animation: czk-shine 1.2s ease-in-out infinite;
}
.czk-on .czk-bar { opacity: 1; transition-delay: 0s }
.czk-on .czk-bar i { animation: czk-grow 9s cubic-bezier(.08, .7, .2, 1) forwards }
.czk-fin .czk-bar { opacity: 0; transition: opacity .3s ease-out .22s }
.czk-fin .czk-bar i { transform: scaleX(1); transition: transform .22s ease-out; animation: none }

/* ---- 2. pastylka „Prosze czekac…” */
.czk-pill {
  position: fixed; top: 14px; left: 50%; z-index: 2147483001; transform: translate(-50%, -8px);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 10px 18px 10px 14px; border-radius: 999px; background: rgba(15, 31, 56, .94); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 600 14px/1.25 Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 14px 34px -10px rgba(15, 31, 56, .45);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1), visibility .2s;
}
.czk-pill .czk-spin { color: #FD7C2E; border-width: 2.5px; width: 1.1em; height: 1.1em }
.czk-long .czk-pill { opacity: 1; visibility: visible; transform: translate(-50%, 0) }
html.czk-on body { cursor: progress }

/* ---- 3. kolko na przycisku */
.czk-spin, .czk-btn::after {
  display: inline-block; width: 1em; height: 1em; flex: none; box-sizing: border-box;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: czk-rot .7s linear infinite;
}
.czk-btn { pointer-events: none !important; cursor: progress; opacity: .9 }
.czk-btn::after { content: "" !important; position: static !important; margin: 0 0 0 .5em; vertical-align: -.15em; background: none !important }
.czk-rel { position: relative !important }
.czk-btn.czk-ico { -webkit-text-fill-color: transparent }
.czk-btn.czk-ico > * { visibility: hidden }
.czk-btn.czk-ico::after { position: absolute !important; top: 50% !important; left: 50% !important; margin: -.5em 0 0 -.5em !important }

/* ---- 4. szkielety tresci (shimmer) */
.sk, p.loading::before, p.loading::after {
  display: block; border-radius: 10px;
  background-color: #EDF1F5;
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.75) 50%, rgba(255,255,255,0) 80%);
  background-size: 220% 100%; background-repeat: no-repeat;
  animation: czk-shine 1.35s ease-in-out infinite;
}
.sk { height: 14px; margin: 0 0 10px }
i.sk, span.sk { font-style: normal }
.sk-t { height: 22px; width: 46% }
.sk-l { width: 100% } .sk-l.w80 { width: 80% } .sk-l.w60 { width: 60% } .sk-l.w40 { width: 40% }
.sk-img { width: 100%; aspect-ratio: 1; height: auto; border-radius: 14px; margin: 0 }
.sk-c { width: 44px; height: 44px; border-radius: 50%; margin: 0 }
.sk-btn { height: 52px; border-radius: 999px; margin-top: 18px }
.sk-card { background: #fff; border: 1px solid #E3E8EE; border-radius: 22px; padding: 22px }
/* zwykly „…” w czasie ladowania (stare miejsca) = dwie belki szkieletu */
p.loading { display: grid; gap: 12px; margin: 6px 0; min-height: 70px; font-size: 0; color: transparent; overflow: hidden }
p.loading::before { content: ""; height: 18px; width: 55% }
p.loading::after { content: ""; height: 40px; width: 100% }
/* blok przeliczany (koszyk, podsumowanie w kasie): tresc przygaszona, kwoty migaja */
.is-busy { position: relative }
.is-busy .tots td:last-child, .is-busy .sl li > span:last-child { color: transparent !important; border-radius: 8px;
  background-color: #EDF1F5; background-image: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.8) 50%, rgba(255,255,255,0) 80%);
  background-size: 220% 100%; background-repeat: no-repeat; animation: czk-shine 1.2s ease-in-out infinite }
.is-busy .cl, .is-busy .sl { opacity: .62; transition: opacity .15s; pointer-events: none }

/* ---- 5. wjazd przy przewijaniu (klasy nadaje czekaj.js tylko elementom ponizej ekranu) */
.rv { opacity: 0; translate: 0 22px; transition: opacity .6s cubic-bezier(.2, .8, .2, 1), translate .7s cubic-bezier(.2, .8, .2, 1) }
.rv.rv-in { opacity: 1; translate: 0 0 }
.rv-d1 { transition-delay: .06s } .rv-d2 { transition-delay: .12s } .rv-d3 { transition-delay: .18s }
.rv-d4 { transition-delay: .24s } .rv-d5 { transition-delay: .30s } .rv-d6 { transition-delay: .36s }

/* ---- 6. zdjecia: tlo migocze, zdjecie lagodnie sie pojawia */
.img-wait { background-color: #EDF1F5;
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.7) 50%, rgba(255,255,255,0) 80%);
  background-size: 220% 100%; background-repeat: no-repeat; animation: czk-shine 1.35s ease-in-out infinite }
img.img-ld { opacity: 0; transition: opacity .5s ease-out }
img.img-ld.is-ld { opacity: 1 }

/* ---- 7. przejscia miedzy stronami (Chrome, Edge, Safari 18+; inne przegladarki — zwykle przejscie) */
@view-transition { navigation: auto }
::view-transition-old(root) { animation: .18s ease-out both czk-vt-out }
::view-transition-new(root) { animation: .28s cubic-bezier(.2, .8, .2, 1) both czk-vt-in }
@keyframes czk-vt-out { to { opacity: 0 } }
@keyframes czk-vt-in { from { opacity: 0; translate: 0 10px } }
img.vt-pimg { view-transition-name: ps-pimg }
img.vt-none { view-transition-name: none !important }
::view-transition-group(ps-pimg) { animation-duration: .42s; animation-timing-function: cubic-bezier(.2, .8, .2, 1) }
::view-transition-old(ps-pimg), ::view-transition-new(ps-pimg) { height: 100%; object-fit: cover }

/* licznik (count-up) — bez skakania szerokosci */
.czk-num { font-variant-numeric: tabular-nums }

@media (prefers-reduced-motion: reduce) {
  .czk-bar i { animation: none !important; transform: scaleX(.7) }
  .czk-bar i::after { animation: none }
  .czk-spin, .czk-btn::after { animation-duration: 2s }
  .sk, p.loading::before, p.loading::after, .img-wait, .is-busy .tots td:last-child { animation: none !important }
  .rv { opacity: 1; translate: none; transition: none }
  img.img-ld { opacity: 1; transition: none }
  @view-transition { navigation: none }
}
@media print { .czk-bar, .czk-pill { display: none } .rv { opacity: 1; translate: none } img.img-ld { opacity: 1 } }
