/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primario:    #c9a96e;
  --color-secundario:  #f9f0e3;
  --color-texto:       #3a2e25;
  --color-blanco:      #ffffff;
  --font-elegante:     'Cormorant Garamond', Georgia, serif;
  --font-limpia:       'Montserrat', system-ui, sans-serif;
  --radio:             12px;
  --sombra:            0 4px 24px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-limpia);
  background: var(--color-secundario);
  color: var(--color-texto);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== BOTÓN UNMUTE VIDEO ===== */
.unmute-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  line-height: 1;
}
.unmute-btn:hover { background: rgba(0,0,0,.7); transform: scale(1.1); }

/* ===== MÚSICA FLOTANTE ===== */
.music-toggle {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--color-primario);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sombra);
  transition: transform .2s, background .2s;
}
.music-toggle:hover { transform: scale(1.1); background: var(--color-primario); color: #fff; }
.music-toggle.playing { background: var(--color-primario); color: #fff; }
.music-toggle.playing .music-icon { animation: spin 3s linear infinite; }

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

/* ===== VIDEO HEADER ===== */
.video-header {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px 56px;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
}

.inv-pre {
  font-family: var(--font-limpia);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .25em;
  color: var(--color-primario);
  text-transform: uppercase;
  margin-bottom: 10px;
  animation: fadeUp .8s ease both;
}

.inv-name {
  font-family: var(--font-elegante);
  font-size: clamp(2.8rem, 10vw, 5rem);
  font-weight: 400;
  font-style: italic;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  animation: fadeUp .8s .2s ease both;
}

/* Accesibilidad y SEO: oculto visualmente pero legible por lectores de pantalla y bots */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== MAIN CONTENT ===== */
.inv-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.inv-section {
  margin-top: 48px;
  transition: opacity .65s ease, transform .65s ease;
}

/* Estado oculto (JS lo agrega al cargar) */
.inv-section.reveal        { opacity: 0; transform: translateY(38px); }

/* Estado visible (IO lo agrega al entrar al viewport) */
.inv-section.reveal.in     { opacity: 1; transform: translateY(0); }

/* Mapa embed — contenedor relativo fuerza al iframe a llenarlo */
.mapa-iframe-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--sombra);
  margin-bottom: 12px;
}
.mapa-iframe-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}

.section-title {
  font-family: var(--font-elegante);
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  color: var(--color-primario);
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-primario);
  margin: 8px auto 0;
  opacity: .5;
}

/* ===== MENSAJE ===== */
.inv-mensaje p {
  font-family: var(--font-elegante);
  font-size: 1.15rem;
  line-height: 1.8;
  text-align: center;
  color: var(--color-texto);
  font-style: italic;
}

/* ===== COUNTDOWN ===== */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.countdown-item {
  background: #fff;
  border: 1px solid rgba(201,169,110,.3);
  border-radius: var(--radio);
  padding: 16px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.countdown-item span {
  display: block;
  font-family: var(--font-elegante);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--color-primario);
  line-height: 1;
}

.countdown-item small {
  display: block;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #999;
  margin-top: 4px;
}

/* ===== DETALLES ===== */
.detalle-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: var(--radio);
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  font-size: .95rem;
  line-height: 1.4;
}

.detalle-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

/* ===== BOTONES ===== */
.btn-mapa,
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 50px;
  font-family: var(--font-limpia);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
  box-shadow: var(--sombra);
}

.btn-mapa {
  background: var(--color-primario);
  color: #fff;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
}

.btn-mapa:hover,
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* ===== RSVP ===== */
.rsvp-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; }

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(201,169,110,.35);
  border-radius: var(--radio);
  font-family: var(--font-limpia);
  font-size: .9rem;
  background: #fff;
  color: var(--color-texto);
  outline: none;
  transition: border-color .2s;
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus { border-color: var(--color-primario); }

.rsvp-form textarea { resize: vertical; min-height: 80px; }

.asistencia-btns {
  flex-direction: row !important;
  gap: 8px;
}

.btn-asistencia {
  flex: 1;
  padding: 10px 6px;
  border: 1.5px solid rgba(201,169,110,.4);
  border-radius: 8px;
  background: #fff;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
  color: var(--color-texto);
}

.btn-asistencia.active {
  background: var(--color-primario);
  border-color: var(--color-primario);
  color: #fff;
  font-weight: 600;
}

.btn-confirmar {
  padding: 16px;
  border: none;
  border-radius: 50px;
  background: var(--color-primario);
  color: #fff;
  font-family: var(--font-limpia);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  box-shadow: var(--sombra);
}

.btn-confirmar:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,169,110,.4); }
.btn-confirmar:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.rsvp-success {
  text-align: center;
  padding: 24px;
  background: #fff;
  border-radius: var(--radio);
  border: 1px solid rgba(201,169,110,.3);
}

.rsvp-success p {
  font-family: var(--font-elegante);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--color-primario);
}

/* ===== FOOTER ===== */
.inv-footer {
  text-align: center;
  padding: 32px 20px;
  font-size: .78rem;
  color: #888;
  border-top: 1px solid rgba(201,169,110,.2);
  margin-top: 48px;
}

.inv-footer .footer-brand {
  color: var(--color-primario);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .03em;
  transition: opacity .2s;
}
.inv-footer .footer-brand:hover { opacity: .75; }

/* ===== ANIMACIONES ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== EVENTO PASADO ===== */
.inv-pasado {
  text-align: center;
  padding: 60px 24px;
  color: #999;
  font-style: italic;
}

/* ===== FONDO: RESPLANDOR AMBIENTAL DINÁMICO ===== */
.bg-resplandor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--color-secundario);
}
.brillo {
  position: absolute;
  width: 75vw;
  height: 75vw;
  max-width: 650px;
  max-height: 650px;
  border-radius: 50%;
  filter: blur(95px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.brillo1 {
  background: radial-gradient(circle, var(--color-primario) 0%, transparent 70%);
  opacity: 0.24;
  animation: brilloCiclo1 16s ease-in-out infinite;
}
.brillo2 {
  background: radial-gradient(circle, #D6B15E 0%, transparent 70%);
  opacity: 0;
  animation: brilloCiclo2 16s ease-in-out infinite;
}
.brillo3 {
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
  opacity: 0;
  animation: brilloCiclo3 16s ease-in-out infinite;
}
@keyframes brilloCiclo1 { 0%, 15% { opacity: 0.24; } 35%, 50% { opacity: 0.05; } 85%, 100% { opacity: 0.24; } }
@keyframes brilloCiclo2 { 0%, 15% { opacity: 0.02; } 35%, 50% { opacity: 0.28; } 70%, 85% { opacity: 0.04; } }
@keyframes brilloCiclo3 { 35%, 50% { opacity: 0.02; } 68%, 82% { opacity: 0.22; } 100% { opacity: 0.02; } }

/* ===== MARCO DECORATIVO FIJO ===== */
.marco-decorativo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 1;
  pointer-events: none;
}

/* ===== APERTURA: PORTÓN / VIDEO DE BIENVENIDA ===== */
.porton {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.85s ease, visibility 0.85s ease;
}
.porton.abierto {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.video-apertura {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.porton-musica-btn {
  position: absolute;
  bottom: 2rem;
  right: 1.5rem;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pulsoBtn 1.8s ease-in-out infinite;
}
.porton-entrar-btn {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.3s, transform 0.2s;
}
.porton-entrar-btn:hover {
  background: rgba(255,255,255,0.4);
  transform: translateX(-50%) scale(1.04);
}
@keyframes pulsoBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
body.porton-cerrado {
  overflow: hidden;
}

/* Asegurar que el contenido esté por encima del fondo dinámico */
.video-header, .inv-main, .inv-footer {
  position: relative;
  z-index: 2;
}

/* ===== TRANSICIONES AVANZADAS AL SCROLL ===== */
.reveal-lr, .reveal-rl, .reveal-drop {
  opacity: 0;
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-lr { transform: translateX(-40px); }
.reveal-rl { transform: translateX(40px); }
.reveal-drop {
  transform: translateY(-35px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.34, 1.56, .64, 1);
}
.reveal-lr.in, .reveal-rl.in, .reveal-drop.in {
  opacity: 1;
  transform: none;
}

/* ===== ITINERARIO: ESTILO BOLETOS DE GALA ===== */
.itin-boletos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 440px;
  margin: 18px auto 0;
}
.itin-boleto {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.itin-boleto:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.itin-boleto-icono {
  width: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 169, 110, 0.12);
  border-right: 2px dashed rgba(201, 169, 110, 0.55);
  font-size: 1.3rem;
  padding: 8px 4px;
}
.itin-boleto-texto {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}
.itin-boleto-hora {
  font-family: var(--font-elegante);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-primario);
  text-transform: uppercase;
}
.itin-boleto-titulo {
  font-family: var(--font-elegante);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--color-texto);
  margin-top: 2px;
}

/* ===== BRILLO METÁLICO REFLECTIVO EN BOTONES ===== */
.brillo-activo {
  position: relative;
  overflow: hidden;
}
.brillo-activo::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 45%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: botonBrillo 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes botonBrillo {
  0% { left: -75%; }
  35%, 100% { left: 160%; }
}

/* Respeta preferencia de accesibilidad para reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .brillo1, .brillo2, .brillo3 { opacity: 0.15 !important; animation: none !important; }
  .reveal-lr, .reveal-rl, .reveal-drop, .inv-section.reveal { opacity: 1 !important; transform: none !important; }
  .brillo-activo::before { display: none !important; }
}
