/* Full-page blur overlay shown during language switch */

html.deco-lang-switching,
body.deco-lang-switching {
  cursor: progress !important;
}

body.deco-lang-switching {
  overflow: hidden !important;
}

/* Try to blur the main page container as fallback (when backdrop-filter isn't supported) */
body.deco-lang-switching #page,
body.deco-lang-switching #wrapper {
  filter: blur(6px);
}

.deco-lang-switch-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  isolation: isolate;
  display: none;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html.deco-lang-switching .deco-lang-switch-overlay {
  display: block;
}

.deco-lang-switch-overlay__center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.deco-lang-switch-overlay__ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2px solid rgba(150, 69, 35, 0.25);
  background: rgba(255, 255, 255, 0.20);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: decoLangPulse 900ms ease-in-out infinite;
}

.deco-lang-switch-overlay__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 4px solid rgba(150, 69, 35, 0.25);
  border-top-color: #964523;
  animation: decoLangSpin 800ms linear infinite;
  display: none;
}

.deco-lang-switch-overlay__ring i.fa {
  font-size: 30px;
  color: #964523;
  animation: decoLangSpin 1000ms linear infinite;
}

.deco-lang-switch-overlay__dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(150, 69, 35, 0.95);
  box-shadow: 0 0 0 3px rgba(150, 69, 35, 0.18);
}

.deco-lang-switch-overlay__dot--a {
  animation: decoLangOrbitA 900ms ease-in-out infinite;
}

.deco-lang-switch-overlay__dot--b {
  animation: decoLangOrbitB 900ms ease-in-out infinite;
}

@keyframes decoLangSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes decoLangPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes decoLangOrbitA {
  0% {
    transform: translate(0, -34px);
  }
  50% {
    transform: translate(32px, 0);
  }
  100% {
    transform: translate(0, 34px);
  }
}

@keyframes decoLangOrbitB {
  0% {
    transform: translate(0, 34px);
  }
  50% {
    transform: translate(-32px, 0);
  }
  100% {
    transform: translate(0, -34px);
  }
}

/* Spinner animation type */
.deco-lang-switch-overlay[data-anim="spinner"] .deco-lang-switch-overlay__ring {
  animation: none;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.deco-lang-switch-overlay[data-anim="spinner"] .deco-lang-switch-overlay__ring i,
.deco-lang-switch-overlay[data-anim="spinner"] .deco-lang-switch-overlay__dot {
  display: none;
}

.deco-lang-switch-overlay[data-anim="spinner"] .deco-lang-switch-overlay__spinner {
  display: block;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .deco-lang-switch-overlay__ring,
  .deco-lang-switch-overlay__ring i.fa,
  .deco-lang-switch-overlay__dot,
  .deco-lang-switch-overlay__spinner {
    animation: none !important;
  }
}
