/* ============================================================
   Invitación XV Años — "Noche de gala"
   Paleta: violeta noche + oro champagne + rosa empolvado
   Tipos:  Great Vibes (caligrafía) · Cormorant Garamond (serif)
           Jost (utilitaria)
   ============================================================ */

:root {
  --noche: #1c1030;
  --noche-2: #2e1b4e;
  --noche-3: #3d2766;
  --oro: #d9b45b;
  --oro-claro: #f3e0ae;
  --rosa: #eeaac4;
  --crema: #fbf4e8;
  --sombra: 0 18px 50px rgba(0, 0, 0, 0.45);
  --f-script: "Great Vibes", cursive;
  --f-serif: "Cormorant Garamond", serif;
  --f-sans: "Jost", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-sans);
  font-weight: 300;
  background: var(--noche);
  color: var(--crema);
  overflow-x: hidden;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

.oculto { display: none !important; }

/* ---------- Mariposa (símbolo) ---------- */
.mariposa use, .orn-mariposa use, .gracias-mariposa use { color: var(--oro); }
#sym-mariposa ellipse { fill: currentColor; opacity: 0.85; }
#sym-mariposa .cuerpo { fill: currentColor; }
#sym-mariposa .antena { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
#sym-mariposa .alaL, #sym-mariposa .alaR { transform-box: fill-box; }
#sym-mariposa .alaL { transform-origin: 100% 50%; animation: aletear 0.7s ease-in-out infinite alternate; }
#sym-mariposa .alaR { transform-origin: 0% 50%; animation: aletear 0.7s ease-in-out infinite alternate; }
@keyframes aletear { from { transform: scaleX(1); } to { transform: scaleX(0.45); } }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(238, 170, 196, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(217, 180, 91, 0.14), transparent 60%),
    linear-gradient(180deg, #241541 0%, var(--noche) 70%);
  overflow: hidden;
  padding: 2rem 1.25rem 5rem;
}

#polvo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-contenido { position: relative; z-index: 2; max-width: 46rem; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--rosa);
  margin-bottom: 1.4rem;
}

.nombre {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(4.2rem, 17vw, 9.5rem);
  line-height: 1.05;
  color: var(--oro-claro);
  text-shadow: 0 0 34px rgba(217, 180, 91, 0.38);
}

.quince {
  font-family: var(--f-serif);
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--crema);
  margin-top: 0.6rem;
}
.quince span {
  color: var(--oro);
  font-weight: 600;
  padding: 0 0.15em;
}

.hero-fecha {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-fecha .linea, .ornamento .linea {
  height: 1px;
  width: clamp(2.4rem, 9vw, 5.5rem);
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
}

/* Entrada escalonada del hero */
.aparece { opacity: 0; transform: translateY(26px); animation: entrar 1s ease forwards; }
.d1 { animation-delay: 0.2s; }
.d2 { animation-delay: 0.55s; }
.d3 { animation-delay: 0.95s; }
.d4 { animation-delay: 1.3s; }
@keyframes entrar { to { opacity: 1; transform: none; } }

/* Mariposas volando */
.mariposas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.mariposa {
  position: absolute;
  width: 52px;
  height: 52px;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px rgba(217, 180, 91, 0.45));
}
.m1 { left: 8%;  top: 18%; animation: vuelo1 17s ease-in-out infinite alternate; }
.m2 { right: 10%; top: 26%; width: 38px; height: 38px; animation: vuelo2 21s ease-in-out infinite alternate; }
.m2 use { color: var(--rosa); }
.m3 { left: 16%; bottom: 16%; width: 30px; height: 30px; animation: vuelo3 14s ease-in-out infinite alternate; }
.m4 { right: 14%; bottom: 22%; width: 44px; height: 44px; animation: vuelo1 24s ease-in-out infinite alternate-reverse; }
.m4 use { color: var(--oro-claro); }

@keyframes vuelo1 {
  0%   { transform: translate(0, 0) rotate(-8deg); }
  30%  { transform: translate(9vw, -6vh) rotate(10deg); }
  60%  { transform: translate(3vw, -14vh) rotate(-6deg); }
  100% { transform: translate(14vw, -4vh) rotate(12deg); }
}
@keyframes vuelo2 {
  0%   { transform: translate(0, 0) rotate(6deg); }
  40%  { transform: translate(-10vw, 8vh) rotate(-12deg); }
  100% { transform: translate(-4vw, -10vh) rotate(8deg); }
}
@keyframes vuelo3 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(12vw, -8vh) rotate(14deg); }
  100% { transform: translate(2vw, -2vh) rotate(-10deg); }
}

/* Flechita de scroll */
.scroll-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(243, 224, 174, 0.6);
  border-radius: 20px;
  z-index: 2;
}
.scroll-hint span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 4px;
  background: var(--oro-claro);
  animation: rueda 1.8s ease-in-out infinite;
}
@keyframes rueda { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

/* ============================================================
   SECCIONES GENERALES
   ============================================================ */
.seccion { padding: 5.5rem 1.4rem; max-width: 62rem; margin: 0 auto; text-align: center; }

.titulo {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  letter-spacing: 0.06em;
  color: var(--crema);
}

.ornamento {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.1rem 0 2.6rem;
}
.orn-mariposa { width: 30px; height: 30px; }

/* Revelado al hacer scroll */
.revelar { opacity: 0; transform: translateY(34px); transition: opacity 0.9s ease, transform 0.9s ease; }
.revelar.visible { opacity: 1; transform: none; }

/* ============================================================
   CONTADOR
   ============================================================ */
.contador {
  display: flex;
  justify-content: center;
  gap: clamp(0.6rem, 2.5vw, 1.4rem);
  flex-wrap: wrap;
}
.caja {
  width: clamp(4.6rem, 20vw, 7rem);
  padding: 1.1rem 0.4rem 0.9rem;
  border: 1px solid rgba(217, 180, 91, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(46, 27, 78, 0.85), rgba(28, 16, 48, 0.85));
  box-shadow: inset 0 0 24px rgba(217, 180, 91, 0.07), var(--sombra);
}
.num {
  display: block;
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 7vw, 3rem);
  color: var(--oro-claro);
  transition: transform 0.2s ease, color 0.2s ease;
}
.num.tick { transform: scale(1.18); color: var(--rosa); }
.uni {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(251, 244, 232, 0.72);
}
.contador-llegamos {
  margin-top: 2rem;
  font-family: var(--f-script);
  font-size: 2.2rem;
  color: var(--rosa);
}

/* ============================================================
   MENSAJE
   ============================================================ */
.mensaje-seccion { padding-top: 2rem; padding-bottom: 2rem; }
.mensaje {
  font-family: var(--f-serif);
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  font-weight: 400;
  line-height: 1.8;
  color: rgba(251, 244, 232, 0.92);
  max-width: 42rem;
  margin: 0 auto;
}
.mensaje::before, .mensaje::after {
  content: "“";
  color: var(--oro);
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.25em;
  padding: 0 0.15em;
}
.mensaje::after { content: "”"; }

/* ============================================================
   GALERÍA
   ============================================================ */
.carrusel { position: relative; max-width: 40rem; margin: 0 auto; }
.car-marco {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(217, 180, 91, 0.6);
  box-shadow: inset 0 0 0 6px var(--noche), inset 0 0 0 7px rgba(217, 180, 91, 0.35), var(--sombra);
  background: var(--noche-2);
}
.car-pista { display: flex; transition: transform 0.65s cubic-bezier(0.25, 0.8, 0.3, 1); }
.car-pista img {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  -webkit-touch-callout: none;
}
.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(217, 180, 91, 0.7);
  background: rgba(28, 16, 48, 0.75);
  color: var(--oro-claro);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(3px);
}
.car-btn:hover { background: rgba(217, 180, 91, 0.25); }
.car-prev { left: -8px; }
.car-next { right: -8px; }
.car-puntos { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.1rem; }
.car-puntos button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--oro);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.3s ease;
}
.car-puntos button.activo { background: var(--oro); transform: scale(1.25); }
.galeria-vacia { color: rgba(251, 244, 232, 0.6); font-style: italic; }

/* ============================================================
   DETALLES
   ============================================================ */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.4rem;
  text-align: center;
}
.tarjeta {
  padding: 2.2rem 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(217, 180, 91, 0.35);
  background: linear-gradient(180deg, rgba(46, 27, 78, 0.6), rgba(28, 16, 48, 0.6));
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.tarjeta:hover {
  transform: translateY(-7px);
  border-color: var(--oro);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(217, 180, 91, 0.18);
}
.t-icono {
  width: 58px; height: 58px;
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(217, 180, 91, 0.6);
  color: var(--oro);
}
.t-icono svg { width: 28px; height: 28px; }
.tarjeta h3 {
  font-family: var(--f-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oro-claro);
  margin-bottom: 0.6rem;
}
.tarjeta p { color: rgba(251, 244, 232, 0.88); }

/* ---------- Botones ---------- */
.boton {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.7rem 1.9rem;
  border-radius: 999px;
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.boton-linea { border: 1px solid var(--oro); color: var(--oro-claro); background: transparent; }
.boton-linea:hover { background: rgba(217, 180, 91, 0.15); transform: translateY(-2px); }
.boton-lleno {
  border: none;
  color: var(--noche);
  background: linear-gradient(135deg, var(--oro-claro), var(--oro));
  box-shadow: 0 10px 26px rgba(217, 180, 91, 0.35);
  width: 100%;
}
.boton-lleno:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(217, 180, 91, 0.5); }
.boton-lleno:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* ============================================================
   CONFIRMACIÓN (RSVP)
   ============================================================ */
.rsvp-sub { max-width: 34rem; margin: 0 auto 2.4rem; color: rgba(251, 244, 232, 0.85); }
.link-asistente {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--rosa);
  text-decoration: underline;
  cursor: pointer;
}

.rsvp-caja {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.4rem 1.8rem;
  text-align: left;
  border-radius: 20px;
  border: 1px solid rgba(217, 180, 91, 0.4);
  background: linear-gradient(180deg, rgba(46, 27, 78, 0.75), rgba(28, 16, 48, 0.75));
  box-shadow: var(--sombra);
}
.campo { margin-bottom: 1.2rem; }
.campo label, .campo .etiqueta {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro-claro);
  margin-bottom: 0.45rem;
}
.campo input, .campo textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 244, 232, 0.25);
  background: rgba(28, 16, 48, 0.6);
  color: var(--crema);
  font-family: var(--f-sans);
  font-size: 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.campo input:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--oro);
  box-shadow: 0 0 0 3px rgba(217, 180, 91, 0.2);
}
.fila-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.radios { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.radio {
  flex: 1;
  min-width: 9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 244, 232, 0.25);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.radio input { accent-color: var(--oro); }
.radio:has(input:checked) { border-color: var(--oro); background: rgba(217, 180, 91, 0.12); }
.rsvp-error { color: #ff9fae; margin-bottom: 0.9rem; }

.rsvp-gracias { max-width: 30rem; margin: 0 auto; padding: 2.5rem 0 0.5rem; }
.gracias-mariposa { width: 64px; height: 64px; margin-bottom: 0.8rem; }
.rsvp-gracias h3 {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: 2.6rem;
  color: var(--oro-claro);
  margin-bottom: 0.4rem;
}

/* ============================================================
   PIE
   ============================================================ */
.pie { text-align: center; padding: 3.5rem 1rem 6.5rem; }
.pie-hashtag {
  font-family: var(--f-serif);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  color: var(--oro);
}
.pie-firma { margin-top: 0.5rem; color: rgba(251, 244, 232, 0.55); font-size: 0.9rem; }

/* ============================================================
   MÚSICA
   ============================================================ */
.boton-musica {
  position: fixed;
  bottom: 1.4rem;
  left: 1.4rem;
  z-index: 60;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--oro);
  background: rgba(28, 16, 48, 0.85);
  color: var(--oro-claro);
  font-size: 1.4rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.25s ease;
}
.boton-musica:hover { transform: scale(1.08); }
.boton-musica.sonando { animation: girar 4s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ============================================================
   ASISTENTE (CHAT)
   ============================================================ */
.chat-burbuja {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 70;
  width: 62px; height: 62px;
  border-radius: 50%;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--noche);
  background: linear-gradient(135deg, var(--oro-claro), var(--oro));
  box-shadow: 0 12px 30px rgba(217, 180, 91, 0.45);
  transition: transform 0.25s ease;
}
.chat-burbuja:hover { transform: scale(1.08); }
.chat-brillo {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(217, 180, 91, 0.7);
  animation: pulso 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes pulso { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.45); opacity: 0; } }

.chat-panel {
  position: fixed;
  bottom: 6.6rem;
  right: 1.4rem;
  z-index: 80;
  width: min(24rem, calc(100vw - 2rem));
  height: min(32rem, calc(100svh - 9rem));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(217, 180, 91, 0.5);
  background: linear-gradient(180deg, #2b1a49, #1c1030);
  box-shadow: var(--sombra);
  overflow: hidden;
  transform-origin: bottom right;
  animation: abrirChat 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.chat-panel[hidden] { display: none; }
@keyframes abrirChat { from { opacity: 0; transform: scale(0.75) translateY(18px); } to { opacity: 1; transform: none; } }

.chat-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(217, 180, 91, 0.3);
  background: rgba(217, 180, 91, 0.08);
}
.chat-titulo { font-family: var(--f-serif); font-size: 1.15rem; font-weight: 600; color: var(--oro-claro); }
.chat-sub { font-size: 0.72rem; color: rgba(251, 244, 232, 0.6); letter-spacing: 0.04em; }
.chat-cerrar {
  border: none; background: none;
  color: var(--crema);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: var(--noche-3) transparent;
}
.burbuja {
  max-width: 85%;
  padding: 0.65rem 0.95rem;
  border-radius: 16px;
  font-size: 0.95rem;
  animation: entrar 0.35s ease;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.burbuja.ia {
  align-self: flex-start;
  background: rgba(251, 244, 232, 0.1);
  border: 1px solid rgba(251, 244, 232, 0.12);
  border-bottom-left-radius: 4px;
}
.burbuja.yo {
  align-self: flex-end;
  color: var(--noche);
  background: linear-gradient(135deg, var(--oro-claro), var(--oro));
  border-bottom-right-radius: 4px;
}
.burbuja.error { border-color: rgba(255, 159, 174, 0.5); color: #ffc9d2; }

.escribiendo { display: inline-flex; gap: 5px; padding: 0.85rem 1rem; }
.escribiendo i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--oro);
  animation: salto 1.1s ease-in-out infinite;
}
.escribiendo i:nth-child(2) { animation-delay: 0.15s; }
.escribiendo i:nth-child(3) { animation-delay: 0.3s; }
@keyframes salto { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-6px); opacity: 1; } }

.chat-entrada {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem;
  border-top: 1px solid rgba(217, 180, 91, 0.3);
}
.chat-entrada input {
  flex: 1;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 244, 232, 0.25);
  background: rgba(28, 16, 48, 0.7);
  color: var(--crema);
  font-family: var(--f-sans);
  font-size: 0.95rem;
}
.chat-entrada input:focus { outline: none; border-color: var(--oro); }
.chat-entrada button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--noche);
  background: linear-gradient(135deg, var(--oro-claro), var(--oro));
  font-size: 1rem;
}

/* ============================================================
   CONFETI
   ============================================================ */
#confeti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE Y ACCESIBILIDAD
   ============================================================ */
@media (max-width: 540px) {
  .fila-doble { grid-template-columns: 1fr; gap: 0; }
  .car-prev { left: 4px; }
  .car-next { right: 4px; }
  .seccion { padding: 4rem 1.1rem; }
}

:focus-visible { outline: 2px solid var(--rosa); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aparece { animation: none; opacity: 1; transform: none; }
  .revelar { transition: none; opacity: 1; transform: none; }
  .mariposa, #sym-mariposa .alaL, #sym-mariposa .alaR,
  .scroll-hint span, .chat-brillo, .boton-musica.sonando { animation: none !important; }
  .car-pista { transition: none; }
  #polvo, #confeti { display: none; }
}

/* ============================================================
   3D BOOK / ALBUM SECTION
   ============================================================ */
.album-seccion {
  background: radial-gradient(circle at 50% 50%, rgba(46, 27, 78, 0.4), transparent 70%);
}
.album-sub {
  margin-bottom: 2.5rem;
  color: var(--rosa);
  font-size: 0.95rem;
}
.book-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 0;
  perspective: 2000px;
  width: 100%;
}
.book-wrapper {
  position: relative;
  width: 320px;
  height: 440px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  transform: rotateX(12deg) rotateY(0deg);
}
/* Shift book spine when opened to keep open book centered */
.book-wrapper.open {
  transform: rotateX(10deg) rotateY(-18deg) translateX(80px);
}
.book-page-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 5;
  pointer-events: none; /* Pointer events are controlled on individual page sides */
}
.book-page-3d.flipped {
  transform: rotateY(-172deg);
}
.book-page-3d.flipping {
  z-index: 100 !important;
}

/* Page Sides (Front and Back) */
.page-side {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: #fdfaf4;
  color: #1c1030;
  border-radius: 4px 12px 12px 4px;
  padding: 1.5rem;
  box-shadow: inset 4px 0 10px rgba(0,0,0,0.1), 2px 2px 10px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border-left: 1px solid rgba(0,0,0,0.08);
  pointer-events: auto;
  cursor: pointer;
}
.page-side.page-back {
  transform: rotateY(180deg);
  border-radius: 12px 4px 4px 12px;
  border-left: none;
  border-right: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset -4px 0 10px rgba(0,0,0,0.1), -2px 2px 10px rgba(0,0,0,0.15);
}

/* Hard Covers (Tapa Dura) */
.book-cover-3d {
  border-radius: 8px 16px 16px 8px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  z-index: 10;
}
.book-cover-3d.back {
  z-index: 1;
  transform: rotateY(0deg); /* stays flat in background */
  border-radius: 16px 8px 8px 16px;
}
.book-cover-3d.back .cover-outside {
  border-radius: 16px 8px 8px 16px;
}
.cover-side {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px 16px 16px 8px;
  pointer-events: auto;
  cursor: pointer;
}
.cover-side.front-outside {
  background: #1c1030 url('portada.png') no-repeat center;
  background-size: 100% 100%;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
}
.cover-side.front-inside {
  background: linear-gradient(135deg, #2e1b4e, #1c1030);
  transform: rotateY(180deg);
  border-radius: 16px 8px 8px 16px;
  border-right: 3px solid var(--oro);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crema);
}
.cover-side.back-inside {
  background: linear-gradient(135deg, #1c1030, #2e1b4e);
  border-left: 3px solid var(--oro);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crema);
  border-radius: 16px 8px 8px 16px;
}
.cover-side.back-outside {
  background: #1c1030 url('portada.png') no-repeat center;
  background-size: 100% 100%;
  transform: rotateY(180deg);
  border-radius: 16px 8px 8px 16px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
}
.cover-inside-content {
  text-align: center;
  padding: 1.5rem;
}
.cover-inside-content h3 {
  font-family: var(--f-script);
  font-size: 2.8rem;
  color: var(--oro-claro);
  margin-top: 0.5rem;
  line-height: 1.1;
}
.cover-inside-content p {
  font-family: var(--f-serif);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rosa);
  font-size: 0.9rem;
}

/* Page Elements */
.page-content {
  width: 100%;
  height: 90%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.page-photo {
  max-width: 100%;
  max-height: 82%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 6px solid #fff;
  border-bottom: 24px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transform: rotate(calc(var(--angle, 0deg)));
  transition: transform 0.3s;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.page-side:hover .page-photo {
  --angle: 1.5deg;
}
.page-side.page-back:hover .page-photo {
  --angle: -1.5deg;
}
.page-text {
  margin-top: 0.6rem;
  font-family: var(--f-serif);
  font-size: 0.88rem;
  font-style: italic;
  color: #4a3e5c;
  text-align: center;
  padding: 0 0.5rem;
}
.page-num {
  font-size: 0.75rem;
  color: rgba(28, 16, 48, 0.45);
  font-weight: 500;
}
.book-hint {
  margin-top: 1.8rem;
  font-size: 0.85rem;
  color: var(--rosa);
  opacity: 0.85;
}

/* Responsive scale for 3D Book on different devices */
@media (max-width: 600px) {
  .book-container {
    transform: scale(0.85);
    margin: -1.5rem 0;
  }
}
@media (max-width: 420px) {
  .book-container {
    transform: scale(0.72);
    margin: -3.5rem 0;
  }
}

/* ============================================================
   MAP AND LOCATION
   ============================================================ */
.mapa-contenedor {
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(217, 180, 91, 0.38);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(217, 180, 91, 0.15);
}
.mapa-contenedor iframe {
  display: block;
}

/* ============================================================
   MESA DE REGALOS (GIFT TABLE)
   ============================================================ */
.regalos-seccion {
  background: radial-gradient(circle at 50% 10%, rgba(238, 170, 196, 0.08), transparent 60%);
}
.regalos-sub {
  max-width: 32rem;
  margin: 0 auto 2rem;
  font-size: 0.96rem;
  color: var(--crema);
  opacity: 0.9;
}
.regalos-caja {
  margin-top: 1.8rem;
  animation: abrirChat 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.regalos-detalles {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 20px;
  background: rgba(46, 27, 78, 0.6);
  border: 1px solid rgba(217, 180, 91, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}
.regalo-dato {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(251, 244, 232, 0.12);
  padding-bottom: 0.75rem;
}
.regalo-dato:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.dato-etiqueta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rosa);
}
.dato-valor {
  font-family: var(--f-sans);
  font-size: 1.05rem;
  color: var(--crema);
  word-break: break-all;
}
.valor-copiar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.btn-copiar {
  background: linear-gradient(135deg, var(--oro-claro), var(--oro));
  border: none;
  color: var(--noche);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}
.btn-copiar:hover {
  transform: scale(1.05);
}
.btn-copiar.copiado {
  background: #6fc276;
  color: white;
}

/* ============================================================
   DRESSCODE STYLE
   ============================================================ */
.dresscode-img-container {
  margin-top: 1.2rem;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(217, 180, 91, 0.25);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.35s ease;
}
.dresscode-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.tarjeta:hover .dresscode-img-container {
  transform: scale(1.04);
  border-color: var(--oro);
}

/* ============================================================
   BOOK COVER TEXT OVERLAYS
   ============================================================ */
.cover-outside-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
  pointer-events: none;
}
.cover-title {
  font-family: var(--f-script);
  font-size: 2.8rem;
  color: var(--oro-claro);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(217, 180, 91, 0.4);
  margin-top: 4.8rem; /* Centered in the circular gold frame of the cover image */
  line-height: 1.1;
  font-weight: 400;
}
.cover-author {
  font-family: var(--f-serif);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--rosa);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  margin-bottom: 0.5rem; /* Bottom of the cover */
}

/* ============================================================
   HOURGLASS ANIMATION
   ============================================================ */
.hourglass-container {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hourglass-svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 10px rgba(217, 180, 91, 0.35));
}
#sand-stream {
  animation: sandDrip 0.4s linear infinite;
}
@keyframes sandDrip {
  to {
    stroke-dashoffset: -6;
  }
}

/* ============================================================
   MOBILE RESPONSIVENESS AND OPTIMIZATIONS
   ============================================================ */
@media (max-width: 480px) {
  /* Gift details optimizations for small screens (prevent word wrap/squeeze issues) */
  .regalos-detalles {
    padding: 1.25rem 1rem;
    gap: 1.1rem;
  }
  .valor-copiar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .btn-copiar {
    align-self: flex-end;
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
  }
  
  /* Fullscreen Chat Assistant Panel on mobile (mimics a native app, avoids squishing) */
  .chat-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100svh;
    border-radius: 0;
    border: none;
    transform-origin: center bottom;
    animation: abrirChatMobile 0.3s ease-out;
  }
  @keyframes abrirChatMobile {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
  .chat-cabecera {
    padding: 1.2rem 1.1rem;
  }
  .chat-cerrar {
    font-size: 2.1rem;
  }
  
  /* Details Cards padding and spacing on mobile */
  .tarjeta {
    padding: 1.8rem 1.2rem;
  }
  
  /* General section titles spacing */
  .seccion {
    padding: 3.5rem 1rem;
  }
}
