/* Haviland loading overlay — bombillo plateado sobre el logo */
.hav-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.hav-loader.is-visible {
  display: flex;
}

.hav-loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  text-align: center;
}

.hav-loader__stage {
  position: relative;
  width: min(280px, 74vw);
  overflow: hidden;
  line-height: 0;
  isolation: isolate;
}

.hav-loader__logo {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.3));
}

/* Misma imagen, mas brillante; solo se ve donde el mask lo permite */
.hav-loader__logo--lit {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  filter:
    brightness(1.85)
    contrast(1.12)
    drop-shadow(0 0 10px rgba(220, 235, 255, 0.65));
  -webkit-mask-image: linear-gradient(
    100deg,
    transparent 0%,
    transparent 42%,
    rgba(0, 0, 0, 0.35) 47%,
    #000 50%,
    rgba(0, 0, 0, 0.35) 53%,
    transparent 58%,
    transparent 100%
  );
  mask-image: linear-gradient(
    100deg,
    transparent 0%,
    transparent 42%,
    rgba(0, 0, 0, 0.35) 47%,
    #000 50%,
    rgba(0, 0, 0, 0.35) 53%,
    transparent 58%,
    transparent 100%
  );
  -webkit-mask-size: 250% 100%;
  mask-size: 250% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: hav-lit-sweep 2.8s ease-in-out infinite;
}

/* Franja plateada que cruza por encima (efecto bombillo) */
.hav-loader__beam {
  position: absolute;
  top: -30%;
  bottom: -30%;
  width: 28%;
  left: -35%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 15%,
    rgba(230, 240, 255, 0.25) 35%,
    rgba(255, 255, 255, 0.7) 48%,
    rgba(210, 225, 240, 0.85) 50%,
    rgba(255, 255, 255, 0.7) 52%,
    rgba(230, 240, 255, 0.25) 65%,
    rgba(255, 255, 255, 0) 85%,
    transparent 100%
  );
  transform: skewX(-20deg);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: hav-beam-sweep 2.8s ease-in-out infinite;
}

@keyframes hav-lit-sweep {
  0% {
    -webkit-mask-position: 140% 0;
    mask-position: 140% 0;
  }
  100% {
    -webkit-mask-position: -140% 0;
    mask-position: -140% 0;
  }
}

@keyframes hav-beam-sweep {
  0% {
    left: -40%;
  }
  100% {
    left: 115%;
  }
}

.hav-loader__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(241, 245, 249, 0.94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.hav-loader__dots span {
  display: inline-block;
  width: 0.35em;
  opacity: 0;
  animation: hav-dot 1.35s infinite;
}

.hav-loader__dots span:nth-child(1) {
  animation-delay: 0s;
}

.hav-loader__dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.hav-loader__dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes hav-dot {
  0%,
  20% {
    opacity: 0;
  }
  40%,
  100% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hav-loader__logo--lit,
  .hav-loader__beam {
    animation-duration: 4.5s;
  }
}
