/* ============================================
   LOADER.CSS — Animación personalizada
   Hotel Casa Bonita · Cajamarca, Perú
   ============================================ */

/* ── Keyframes ── */

@keyframes loaderFadeIn {
  to { opacity: 1; }
}

@keyframes loaderFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* La casa se dibuja como un trazo continuo */
@keyframes drawHouse {
  from { stroke-dashoffset: 310; }
  to   { stroke-dashoffset: 0; }
}

/* Destello final cuando la casa termina de dibujarse */
@keyframes houseGlow {
  0%   { filter: drop-shadow(0 0 0px rgba(255,255,255,0.6)); }
  50%  { filter: drop-shadow(0 0 10px rgba(255,255,255,0.9)); }
  100% { filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)); }
}

/* ── Contenedor principal ── */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #8B1A10;  /* granate — color de marca */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.55s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Bloque central ── */

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

/* ── Emblema SVG — la casa ── */

.loader__emblem {
  width: clamp(140px, 28vw, 200px);
  height: auto;
  overflow: visible;
}

/* Trazo de la casa: se dibuja de un extremo al otro */
.loader__house {
  fill: none;
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 310;
  stroke-dashoffset: 310;
  animation:
    drawHouse 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards,
    houseGlow 0.6s ease 1.7s forwards;
}

/* ── Nombre del hotel ── */

.loader__brand {
  font-size: clamp(1.8rem, 5.5vw, 3rem);
  line-height: 1.1;
  opacity: 0;
  animation: loaderFadeUp 0.7s cubic-bezier(0.23, 1, 0.32, 1) 1.6s forwards;
  display: flex;
  align-items: baseline;
  gap: 0.25em;
}

/* "CASA" — serif mayúsculas, blanco */
.loader__brand-casa {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1em;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-transform: uppercase;
}

/* "Bonita" — serif itálica, blanco */
.loader__brand-bonita {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1em;
  letter-spacing: 0.12em;
  font-style: normal;
  color: #ffffff;
  text-transform: uppercase !important;
}

/* ── Línea divisora ── */

.loader__divider {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  transition: width 0.6s ease;
  margin: -0.5rem auto 0;
}

/* ── Subtítulo ── */

.loader__location {
  font-family: 'Josefin Sans', 'Segoe UI', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 300;
  margin: -0.5rem 0 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ── Barra de progreso inferior ── */

.loader__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(to right, #6B1009, #ffffff, #F5EFE0);
  transition: width 2s ease;
}

/* ── Loader simple para subpáginas ── */

.loader__simple-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  color: #ffffff;
  opacity: 0;
  animation: loaderFadeIn 0.5s ease 0.1s forwards;
}
