/* Artec ERP branded loader — render with {% loader %} (apps/core/templatetags/erp_ui.py).
   Self-contained (no Tailwind classes) so JS can re-inject the markup verbatim.
   The tag sets --sz / --spd / --bspd inline; fallbacks below match its defaults. */

.ldr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ldr-spinbox {
  position: relative;
  width: var(--sz, 96px);
  height: var(--sz, 96px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ldr-ring {
  position: absolute;
  inset: 0;
  border: calc(var(--sz, 96px) / 24) solid #E4E4E7;
  border-top-color: #DC2626;
  border-radius: 50%;
  animation: ldr-spin var(--spd, 1.5s) linear infinite;
}

.ldr-blade {
  position: absolute;
  inset: 0;
  margin: auto;
  height: 46%;
  width: auto;
  animation: ldr-breathe 2.2s ease-in-out infinite;
}

/* Source order is load-bearing: .ldr-spin-* sits after .ldr-blade (a spin mode
   replaces the breathe fade on the ring's blade) and before .ldr-blade-solo
   (the pulse variant's throb always wins over a spin mode). */
.ldr-spin-flat   { animation: ldr-spin   var(--bspd, 3s) linear      infinite; }
.ldr-spin-coin   { animation: ldr-coin   var(--bspd, 3s) ease-in-out infinite; }
.ldr-spin-wobble { animation: ldr-wobble var(--bspd, 3s) ease-in-out infinite; }

.ldr-blade-solo {
  height: var(--sz, 96px);
  width: auto;
  animation: ldr-throb calc(var(--spd, 1.5s) * 1.4) ease-in-out infinite;
}

.ldr-dotrow {
  height: var(--sz, 96px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ldr-dot {
  width: calc(var(--sz, 96px) / 7);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #DC2626;
  animation: ldr-dotp calc(var(--spd, 1.5s) * 1.2) ease-in-out infinite;
}
.ldr-dot-2 { animation-delay: calc(var(--spd, 1.5s) / 6); }
.ldr-dot-3 { animation-delay: calc(var(--spd, 1.5s) / 3); }

.ldr-lbl {
  font-size: 14px;
  color: #52525B;
}

/* Row layout for use beside a button (e.g. as an htmx-indicator). */
.ldr-inline {
  display: inline-flex;
  flex-direction: row;
  gap: 10px;
  vertical-align: middle;
}
.ldr-inline .ldr-dotrow { height: auto; }

/* Screen-reader-only label when show_label=False. */
.ldr-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Full-page navigation overlay + corner htmx pill — both driven by
   static/js/loader.js, hidden via inline display:none until it shows them.
   pointer-events:none on both: they are feedback, not shields — clicks and
   barcode-scanner keystrokes must always reach the page beneath. */
.ldr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 250, 250, .92);
  pointer-events: none;
  animation: ldr-fade-in .15s ease-out;
}

.ldr-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 9999px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / .06), 0 2px 4px -1px rgb(0 0 0 / .04);
  pointer-events: none;
  animation: ldr-fade-in .15s ease-out;
}

@keyframes ldr-fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes ldr-spin    { to { transform: rotate(360deg); } }
@keyframes ldr-coin    { to { transform: rotateY(360deg); } }
@keyframes ldr-wobble  { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes ldr-breathe { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes ldr-throb   { 0%, 100% { opacity: .4; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes ldr-dotp    { 0%, 100% { opacity: .2; transform: scale(.75); } 40% { opacity: 1; transform: scale(1); } }
