/* ==========================================================================
   Xevora branded loader — monogram + gold ring
   ========================================================================== */

.xevora-loader {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.xevora-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.xevora-loader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 19, 15, 0.44);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.xevora-loader__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 36px 42px 32px;
  background: var(--surface, #fff);
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(12, 10, 7, 0.28);
  min-width: 168px;
  transform: translateY(10px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.xevora-loader.is-visible .xevora-loader__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.xevora-loader__mark {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xevora-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold, #9c7a3c);
  border-right-color: rgba(156, 122, 60, 0.32);
  animation: xevora-loader-spin 1.05s linear infinite;
}

.xevora-loader__ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(156, 122, 60, 0.14);
}

@keyframes xevora-loader-spin {
  to { transform: rotate(360deg); }
}

.xevora-loader__logo {
  width: 52px;
  height: auto;
  display: block;
  animation: xevora-loader-breathe 2.1s ease-in-out infinite;
  filter: drop-shadow(0 4px 14px rgba(156, 122, 60, 0.24));
}

@keyframes xevora-loader-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.xevora-loader__text {
  margin: 0;
  font-family: var(--sans, "Jost", sans-serif);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft, #4a463f);
}

body.xevora-loader-active {
  overflow: hidden;
}

/* Inline button spinner while WooCommerce marks .loading */
.add_to_cart_button.loading,
.single_add_to_cart_button.loading,
.xevora-buy-now.is-loading,
.drawer-qty.is-updating .drawer-qty__val,
.qty-stepper.is-updating {
  position: relative;
}

.add_to_cart_button.loading,
.single_add_to_cart_button.loading {
  color: transparent !important;
  pointer-events: none;
}

.add_to_cart_button.loading::after,
.single_add_to_cart_button.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: xevora-loader-spin 0.75s linear infinite;
}

.drawer-qty.is-updating::after,
.qty-stepper.is-updating::after {
  content: "";
  position: absolute;
  right: -22px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid rgba(156, 122, 60, 0.25);
  border-top-color: var(--gold, #9c7a3c);
  animation: xevora-loader-spin 0.75s linear infinite;
}

.drawer-qty.is-updating {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .xevora-loader__ring {
    animation: none;
    border-color: rgba(156, 122, 60, 0.45);
    opacity: 0.65;
  }

  .xevora-loader__logo {
    animation: none;
  }

  .xevora-loader,
  .xevora-loader__card {
    transition: none;
  }
}
