/* MARU CORP — Pantalla de precarga */

html.preloader-active {
  overflow: hidden;
}

.site-preloader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 45%, var(--navy-light) 100%);
  background-size: 200% 200%;
  animation: preloaderBgShift 8s ease infinite;
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.65s;
}

.site-preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-preloader__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem;
  text-align: center;
}

/* Anillos alrededor del logo */
.site-preloader__rings {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-preloader__ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}
.site-preloader__ring--1 {
  inset: 0;
  border-top-color: var(--gold);
  border-right-color: rgba(232, 185, 35, 0.25);
  animation: preloaderSpin 1.4s linear infinite;
}
.site-preloader__ring--2 {
  inset: 12px;
  border-bottom-color: var(--gold-light);
  border-left-color: rgba(245, 215, 110, 0.2);
  animation: preloaderSpin 2s linear infinite reverse;
}
.site-preloader__ring--3 {
  inset: 24px;
  border-top-color: rgba(255, 255, 255, 0.35);
  animation: preloaderSpin 2.6s linear infinite;
}

.site-preloader__logo-wrap {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(232, 185, 35, 0.25),
              0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: preloaderLogoPulse 1.8s ease-in-out infinite;
}
.site-preloader__logo-wrap img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

/* Partículas de fondo */
.site-preloader__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.site-preloader__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.5;
  animation: preloaderDotFloat 6s ease-in-out infinite;
}
.site-preloader__dot:nth-child(1) { top: 18%; left: 22%; animation-delay: 0s; }
.site-preloader__dot:nth-child(2) { top: 28%; right: 18%; background: var(--gold-light); animation-delay: -1.2s; width: 4px; height: 4px; }
.site-preloader__dot:nth-child(3) { bottom: 32%; left: 14%; background: rgba(255, 255, 255, 0.6); animation-delay: -2.4s; }
.site-preloader__dot:nth-child(4) { bottom: 22%; right: 24%; animation-delay: -0.8s; width: 8px; height: 8px; }
.site-preloader__dot:nth-child(5) { top: 48%; left: 8%; animation-delay: -3s; width: 5px; height: 5px; }
.site-preloader__dot:nth-child(6) { top: 55%; right: 10%; background: var(--gold-light); animation-delay: -1.8s; }

.site-preloader__brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}
.site-preloader__brand span {
  color: var(--gold);
}

.site-preloader__tagline {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  max-width: 260px;
  line-height: 1.45;
  margin-top: -0.75rem;
}

.site-preloader__progress {
  width: min(280px, 72vw);
}
.site-preloader__progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.site-preloader__progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  background-size: 200% 100%;
  animation: preloaderBarShine 1.2s linear infinite;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(232, 185, 35, 0.55);
}
.site-preloader__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.site-preloader__percent {
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

@keyframes preloaderBgShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes preloaderSpin {
  to { transform: rotate(360deg); }
}
@keyframes preloaderLogoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(232, 185, 35, 0.25), 0 12px 40px rgba(0, 0, 0, 0.25); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(232, 185, 35, 0.15), 0 16px 48px rgba(0, 0, 0, 0.3); }
}
@keyframes preloaderDotFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.35; }
  50% { transform: translate(8px, -14px); opacity: 0.85; }
}
@keyframes preloaderBarShine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-preloader,
  .site-preloader__ring,
  .site-preloader__logo-wrap,
  .site-preloader__dot,
  .site-preloader__progress-fill {
    animation: none !important;
  }
  .site-preloader__progress-fill {
    transition: none;
  }
}
