/* ============================================================
   invitaqr / assets / css / invitacion.css
   Estilos de la vista pública de la invitación digital
   ============================================================ */

:root {
  --iq-primary:   #FF6B9D;
  --iq-secondary: #FFB3D1;
  --iq-fondo:     #FFF0F7;
}

*, *::before, *::after { box-sizing: border-box; }

body.iq-inv-body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--iq-fondo);
  color: #333;
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── FONDO ESTÁTICO ──────────────────────────────────────── */
.iq-bg-static {
  position: fixed; inset: 0;
  background: var(--iq-fondo);
  z-index: -1;
}

/* ── FONDO ANIMADO CANVAS ────────────────────────────────── */
.iq-bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── WRAPPER ─────────────────────────────────────────────── */
.iq-inv-wrapper {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes iqFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.iq-anim-fade-in {
  animation: iqFadeIn .7s ease both;
}

/* ── HERO ────────────────────────────────────────────────── */
.iq-inv-hero {
  text-align: center;
  padding: 2rem 1rem 2.2rem;
  position: relative;
}

/* Destellos decorativos flotantes */
.iq-hero-sparks {
  display: flex;
  justify-content: center;
  gap: .6rem;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  animation: iqFadeIn .5s ease both;
}
.iq-hero-sparks span { display: inline-block; animation: iqFloat 3s ease-in-out infinite; }
.iq-hero-sparks span:nth-child(1) { animation-delay: 0s; }
.iq-hero-sparks span:nth-child(2) { animation-delay: .4s; }
.iq-hero-sparks span:nth-child(3) { animation-delay: .8s; }
.iq-hero-sparks span:nth-child(4) { animation-delay: 1.2s; }
.iq-hero-sparks span:nth-child(5) { animation-delay: 1.6s; }

@keyframes iqFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* Badge circular con el número */
.iq-inv-age-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--iq-primary) 0%, var(--iq-secondary) 100%);
  box-shadow:
    0 8px 30px rgba(0,0,0,.22),
    0 0 0 6px rgba(255,255,255,.75),
    0 0 0 12px color-mix(in srgb, var(--iq-primary) 22%, transparent);
  margin: 0 auto 1.3rem;
  position: relative;
  animation: iqBadgePulse 3.5s ease-in-out infinite;
}

@keyframes iqBadgePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* Emoji decorativo en la esquina del badge */
.iq-inv-age-badge::after {
  content: '🎂';
  position: absolute;
  top: -14px; right: -12px;
  font-size: 1.9rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
  animation: iqWiggle 2.5s ease-in-out infinite;
}

@keyframes iqWiggle {
  0%, 100% { transform: rotate(-10deg); }
  50%       { transform: rotate(10deg); }
}

.iq-inv-age-num {
  font-family: 'Pacifico', cursive;
  font-size: 5rem;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.iq-inv-age-label {
  font-size: .72rem;
  font-weight: 900;
  color: rgba(255,255,255,.92);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: .1rem;
}

.iq-inv-name {
  font-family: 'Pacifico', cursive;
  font-size: clamp(2rem, 8vw, 3rem);
  margin: 0 0 .3rem;
  color: var(--iq-primary);
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.iq-inv-subtitle {
  font-size: .9rem;
  color: #777;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Divisor ornamental */
.iq-inv-divider {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .8rem auto 1.2rem;
  max-width: 240px;
  color: var(--iq-primary);
  opacity: .5;
}
.iq-inv-divider::before,
.iq-inv-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--iq-primary);
  border-radius: 2px;
}
.iq-inv-divider span { font-size: 1.2rem; opacity: .8; }
.iq-inv-details {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 320px;
  margin: 0 auto;
}
.iq-inv-detail-item {
  display: flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: .6rem 1.2rem;
  box-shadow: 0 3px 14px rgba(0,0,0,.08);
  font-weight: 700;
}
.iq-inv-detail-item i {
  color: var(--iq-primary);
  width: 18px; text-align: center;
  font-size: 1rem;
}

/* ── SECTION SHARED ──────────────────────────────────────── */
.iq-inv-section {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  border-radius: 22px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
}
.iq-inv-sec-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--iq-primary);
  text-align: center;
  margin-bottom: 1rem;
}

/* ── TEXTO MENSAJE ───────────────────────────────────────── */
.iq-inv-texto { text-align: center; }
.iq-inv-message { position: relative; }
.iq-inv-quote-mark {
  font-size: 4rem;
  color: var(--iq-primary);
  opacity: .2;
  line-height: .6;
  font-family: Georgia, serif;
  position: absolute;
  top: -.3rem; left: 0;
}
.iq-inv-message p {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  padding: 0 1.5rem;
  margin: 0;
  font-style: italic;
}

/* ── COUNTDOWN ───────────────────────────────────────────── */
.iq-countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(.25rem, 1.5vw, .6rem);
  flex-wrap: nowrap;
}
.iq-cd-unit {
  background: linear-gradient(135deg, var(--iq-primary), var(--iq-secondary));
  border-radius: 16px;
  padding: .8rem clamp(.3rem, 2.5vw, 1rem);
  text-align: center;
  min-width: clamp(52px, 16vw, 72px);
  box-shadow: 0 4px 15px rgba(0,0,0,.12);
}
.iq-cd-num {
  display: block;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-family: 'Nunito', monospace;
}
.iq-cd-unit small { color: rgba(255,255,255,.85); font-size: clamp(.6rem, 2vw, .75rem); font-weight: 700; }
.iq-cd-sep {
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 900;
  color: var(--iq-primary);
  display: flex;
  align-items: center;
  padding-bottom: 1rem;
}

/* ── CAROUSEL ────────────────────────────────────────────── */
.iq-carousel {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.iq-carousel .carousel-item img {
  max-height: 350px;
  object-fit: cover;
  width: 100%;
}

/* ── MASONRY ─────────────────────────────────────────────── */
.iq-masonry {
  column-count: 2;
  column-gap: .6rem;
}
.iq-masonry-item {
  break-inside: avoid;
  margin-bottom: .6rem;
  border-radius: 12px;
  overflow: hidden;
}
.iq-masonry-item img {
  width: 100%;
  display: block;
  border-radius: 12px;
  transition: transform .3s;
}
.iq-masonry-item:hover img { transform: scale(1.03); }

/* ── PREVIEW PLACEHOLDERS (galería sin fotos reales) ─────── */
.iq-photo-placeholder {
  background: linear-gradient(135deg, rgba(0,0,0,.07), rgba(0,0,0,.12));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,.25);
  font-size: 2rem;
}
/* Masonry placeholder */
.iq-preview-placeholder-masonry .iq-photo-placeholder {
  height: 90px;
  margin-bottom: .6rem;
  break-inside: avoid;
}
.iq-preview-placeholder-masonry .iq-photo-placeholder.tall { height: 140px; }
/* Carousel placeholder */
.iq-preview-placeholder-carousel { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.iq-preview-placeholder-carousel .iq-ppc-main {
  width: 100%;
  height: 180px;
  font-size: 3rem;
}
.iq-ppc-dots { display: flex; gap: 6px; justify-content: center; }
.iq-ppc-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  display: inline-block;
}
.iq-ppc-dots span:first-child { background: var(--iq-primary); width: 18px; border-radius: 4px; }

/* ── MAP ─────────────────────────────────────────────────── */
.iq-map-osm {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
/* Leaflet attribution z-index fix */
.iq-map-osm .leaflet-control-attribution { font-size: 10px; }
.iq-inv-btn-map {
  background: #fff;
  color: var(--iq-primary);
  border: 2px solid var(--iq-primary);
  transition: all .2s;
}
.iq-inv-btn-map:hover {
  background: var(--iq-primary);
  color: #fff;
}

/* ── TEMÁTICA ────────────────────────────────────────────── */
.iq-inv-tematica {
  background: linear-gradient(135deg, rgba(var(--iq-primary-rgb, 255,107,157),.08),
    rgba(123,47,190,.06));
  border-radius: 14px;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--iq-primary);
  font-size: .95rem;
  color: #444;
}

/* ── HERO CON PERSONAJE TEMÁTICO ────────────────────────── */
/* Wrap relativo: contiene el PNG grande + el badge encima */
.iq-hero-char-wrap {
  position: relative;
  display: block;          /* block para que margin auto funcione */
  width: fit-content;
  margin: 0 auto 3.2rem;  /* espacio extra abajo porque el badge sobresale */
  transition: opacity .35s ease, transform .35s ease;
}
.iq-inv-hero-char {
  display: block;
  width: clamp(200px, 56vw, 290px);
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,.22));
  animation: iq-hero-char-in .7s cubic-bezier(.34,1.4,.64,1) both;
  animation-delay: .25s;
}
@keyframes iq-hero-char-in {
  from { opacity: 0; transform: translateY(32px) scale(.82); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Badge: solapado sobre la parte baja del personaje, centrado */
.iq-hero-char-wrap .iq-inv-age-badge {
  position: absolute;
  bottom: -38px;           /* sobresale más → más encimado */
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  margin: 0;
}
.iq-hero-char-wrap .iq-inv-age-num  { font-size: 4rem; }
.iq-hero-char-wrap .iq-inv-age-label{ font-size: .62rem; }
/* Exit: el wrap se desvanece y sube al hacer scroll */
.iq-inv-hero--tematica.char-exit .iq-hero-char-wrap {
  opacity: 0;
  transform: translateY(-14px) scale(.92);
}

/* Nombre y subtítulo más grandes cuando hay temática */
.iq-inv-hero--tematica .iq-inv-name {
  font-size: clamp(2.2rem, 9vw, 3.2rem);
}
.iq-inv-hero--tematica .iq-inv-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ── STICKY BAR ──────────────────────────────────────────── */
.iq-sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 68px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  border-top: 2.5px solid var(--iq-secondary);
  box-shadow: 0 -3px 22px rgba(0,0,0,.1);
  display: flex;
  align-items: flex-end;
  padding: 0 1.4rem 0 .4rem;
  z-index: 300;
  transform: translateY(100%);
  transition: transform .45s cubic-bezier(.34,1.15,.64,1);
}
.iq-sticky-bar.visible {
  transform: translateY(0);
}
.iq-sticky-char {
  height: 96px;          /* más alto que la barra: asoma ~28px arriba */
  width: auto;
  flex-shrink: 0;
  margin-right: .8rem;
  filter: drop-shadow(-2px 0 8px rgba(0,0,0,.18));
  display: block;
  align-self: flex-end;
}
.iq-sticky-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: .5rem;
  min-width: 0;
}
.iq-sticky-name {
  font-family: 'Pacifico', cursive;
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  color: var(--iq-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iq-sticky-age {
  font-size: .78rem;
  font-weight: 700;
  color: #888;
  margin-top: .15rem;
}

/* ── WHATSAPP ────────────────────────────────────────────── */
.iq-inv-wa-section { text-align: center; }
.iq-inv-btn-wa {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  box-shadow: 0 6px 25px rgba(37,211,102,.35);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.iq-inv-btn-wa:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 35px rgba(37,211,102,.45);
  color: #fff;
}

/* ── MUSIC PLAYER ────────────────────────────────────────── */
.iq-music-player {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 1000;
  transition: bottom .3s;
}
.iq-mp-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--iq-primary), var(--iq-secondary));
  border: 3px solid rgba(255,255,255,.9);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  transition: transform .2s, box-shadow .2s;
}
.iq-mp-btn:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(0,0,0,.3); }

/* YouTube player oculto */
#iqYtContainer {
  position: fixed; bottom: -100px; right: -100px;
  width: 1px; height: 1px; overflow: hidden;
}
#iqYtPlayer { width: 1px; height: 1px; }

/* ── FOOTER INVITACIÓN ───────────────────────────────────── */
.iq-inv-footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: .78rem;
  color: #aaa;
}
.iq-inv-footer a { color: var(--iq-primary); text-decoration: none; font-weight: 700; }
.iq-inv-footer-brand { margin-top: -.3rem; font-size: .72rem; color: #bbb; }
.iq-inv-footer-brand a { color: #999; font-weight: 600; }
.iq-inv-footer-brand a:hover { color: var(--iq-primary); }
