/* ============================================================
   Shopaale — Professional Page Loader (redesigned 2026-10-04)
   Brand-matched loading overlay used across all pages.
   Works with existing HTML: .loader > .loader_con > .loading
   ============================================================ */

/* Full-screen overlay */
.loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 0.35s ease;
}
.loader.loader-fadeout {
  opacity: 0;
  pointer-events: none;
}

/* Center container */
.loader_con {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Hide legacy fashion SVGs — replaced by branded spinner */
.loader_con .loading svg {
  display: none !important;
}

/* Branded spinner: pulsing logo core + rotating ring */
.loader_con .loading {
  width: 88px;
  height: 88px;
  position: relative;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rotating gradient ring */
.loader_con .loading::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6e1597, #c084fc, #f0abfc, #6e1597);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: shopaale-spin 1.1s linear infinite;
}

/* Soft pulsing halo */
.loader_con .loading::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 21, 151, 0.16) 0%, transparent 70%);
  animation: shopaale-pulse 1.8s ease-in-out infinite;
}

/* Shopaale "S" monogram in the center */
.loader_con .loading .shopaale-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6e1597 0%, #4a0e66 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 4px 16px rgba(110, 21, 151, 0.35);
  position: relative;
  z-index: 1;
}

/* Loading text with animated dots */
.loader_con p,
.loader_con .shopaale-load-text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #6e1597;
  letter-spacing: 0.4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.loader_con p .dots::after,
.loader_con .shopaale-load-text .dots::after {
  content: "";
  animation: shopaale-dots 1.4s steps(4) infinite;
}

@keyframes shopaale-spin {
  to { transform: rotate(360deg); }
}
@keyframes shopaale-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.12); opacity: 1; }
}
@keyframes shopaale-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* Small inline variant (buttons etc.) — keeps old #btnLoader working */
.loader.loader-inline {
  position: static;
  inset: auto;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  z-index: auto;
}
.loader.loader-inline .loader_con .loading {
  width: 32px;
  height: 32px;
}
.loader.loader-inline .loader_con .loading .shopaale-mark {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
.loader.loader-inline .loader_con p { display: none; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .loader_con .loading::before { animation-duration: 2.5s; }
  .loader_con .loading::after { animation: none; }
}
