/* ============================================== */
/* BLOQUE 1: LAYOUT HERO                          */
/* ============================================== */

.hero-section {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero__background {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-image: url("https://images.unsplash.com/photo-1511285560929-80b456fea0bc?auto=format&fit=crop&w=2000&q=80");
  background-size: cover;
  background-position: center;
  z-index: -2;
  filter: brightness(0.6) grayscale(30%);
}

.hero__particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.2) 0%,
    var(--bg-dark) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.hero__content {
  z-index: 1;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ============================================== */
/* BLOQUE 2: LAYOUT HISTORIA Y CONTADOR           */
/* ============================================== */

.story-section {
  /* [MEJORA] Espaciado fluido: 60px en móvil, hasta 120px en PC */
  padding: clamp(60px, 10vh, 120px) 20px;
  background-color: var(--bg-dark);
  position: relative;
}

.story__container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 8vw, 80px);
  align-items: center;
}

@media (min-width: 768px) {
  .story__container {
    grid-template-columns: 1fr 1fr;
  }
}

.countdown-section {
  padding: clamp(80px, 12vh, 150px) 20px;
  background:
    linear-gradient(rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.85)),
    url("https://images.unsplash.com/photo-1469371670807-013ccf25f16a?auto=format&fit=crop&w=2000&q=80")
      center/cover no-repeat fixed;
  text-align: center;
  display: flex;
  justify-content: center;
}

.countdown__content {
  max-width: 800px;
  width: 100%;
}

.countdown__timer {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap; /* [MEJORA] Forzamos a que no se rompa en 2 líneas */
  gap: clamp(
    10px,
    2vw,
    20px
  ); /* El espacio entre cajas se encoge en celulares */
  margin-top: clamp(40px, 6vw, 60px);
}

/* En teléfonos EXTREMADAMENTE pequeños (ej. iPhone SE), permitimos wrap como último recurso */
@media (max-width: 360px) {
  .countdown__timer {
    flex-wrap: wrap;
  }
}

/* ============================================== */
/* BLOQUE 3: LAYOUT UBICACIONES                   */
/* ============================================== */

.locations-section {
  padding: clamp(60px, 10vh, 120px) 20px;
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.locations__header {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 60px);
}

.locations__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(30px, 5vw, 60px);
  width: 100%;
  max-width: 900px;
  margin-bottom: clamp(50px, 8vw, 80px);
}

@media (min-width: 768px) {
  .locations__container {
    grid-template-columns: 1fr 1fr;
  }
}

.dress-code {
  text-align: center;
  max-width: 600px;
  padding: clamp(40px, 6vw, 60px) 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
}

/* ============================================== */
/* BLOQUE 4: LAYOUT MÚSICA Y GALERÍA              */
/* ============================================== */

.music-section {
  padding: clamp(60px, 10vh, 100px) 20px;
  background-color: var(--bg-dark);
  text-align: center;
}

.music__container {
  max-width: 600px;
  margin: 0 auto;
}

.gallery-section {
  padding: clamp(60px, 10vh, 100px) 20px clamp(80px, 15vh, 150px);
  background-color: var(--bg-dark);
  position: relative;
  overflow: hidden;
}

.gallery__header {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 70px);
  position: relative;
  z-index: 2;
}

.gallery__container {
  display: grid;
  grid-template-columns: 1fr;
  /* En celular reducimos un poco la altura de las fotos para que se vean más dinámicas */
  grid-auto-rows: clamp(250px, 40vh, 300px);
  gap: 15px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .gallery__container {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 300px;
    grid-auto-flow: dense;
    gap: 20px;
  }

  .item-v {
    grid-row: span 2;
  }

  .item-h {
    grid-column: span 2;
  }

  .item-b {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* ============================================== */
/* BLOQUE 5: LAYOUT ITINERARIO, RSVP Y MODAL      */
/* ============================================== */

.timeline-section {
  padding: clamp(60px, 10vh, 100px) 20px;
  background-color: var(--bg-dark);
}

.timeline__header {
  text-align: center;
  margin-bottom: clamp(50px, 8vw, 80px);
}

.timeline__container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline__line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--glass-border);
}

.timeline__item {
  position: relative;
  padding-left: 50px;
  margin-bottom: 50px;
  width: 100%;
}

@media (min-width: 768px) {
  .timeline__line {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__item {
    width: 50%;
    padding-left: 0;
    margin-bottom: 60px;
  }

  .timeline__item.left {
    left: 0;
    padding-right: 40px;
    text-align: right;
  }

  .timeline__item.right {
    left: 50%;
    padding-left: 40px;
    text-align: left;
  }
}

.tourism-section {
  padding: 0 20px clamp(60px, 10vh, 100px);
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tourism__header {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 60px);
  max-width: 600px;
}

.tourism__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(30px, 5vw, 40px);
  width: 100%;
  max-width: 1000px;
}

@media (min-width: 768px) {
  .tourism__grid {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
  }
}

.rsvp-section {
  padding: clamp(60px, 10vh, 100px) 20px clamp(80px, 15vh, 150px);
  background:
    linear-gradient(to top, rgba(10, 10, 10, 0.2) 0%, var(--bg-dark) 100%),
    url("https://images.unsplash.com/photo-1519225421980-715cb0215aed?auto=format&fit=crop&w=2000&q=80")
      center/cover no-repeat fixed;
  text-align: center;
}

.rsvp__container {
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================== */
/* MODALES (QR Y MAPA)                            */
/* ============================================== */

.qr-modal,
.map-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s var(--ease-premium),
    visibility 0.5s;
}

.qr-modal.hidden,
.map-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.qr-modal__overlay,
.map-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.qr-modal__content {
  position: relative;
  width: 90%;
  max-width: 400px;
  padding: 50px 30px;
  border-radius: 4px;
  text-align: center;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.5s var(--ease-premium);
}

.map-modal__content {
  position: relative;
  width: 95%;
  max-width: 900px;
  height: clamp(60vh, 85vh, 800px); /* Ajuste para evitar que desborde en cel */
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.6s var(--ease-premium);
}

.qr-modal:not(.hidden) .qr-modal__content,
.map-modal:not(.hidden) .map-modal__content {
  transform: translateY(0) scale(1);
}

/* ============================================== */
/* BLOQUE 6: LAYOUT REGALOS Y CIERRE              */
/* ============================================== */

.gifts-section {
  padding: clamp(60px, 10vh, 100px) 20px clamp(80px, 15vh, 150px);
  background-color: var(--bg-dark);
  text-align: center;
}

.gifts__header {
  margin-bottom: clamp(50px, 8vw, 70px);
}

.gifts__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .gifts__container {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

.closing-section {
  position: relative;
  padding: 150px 20px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  overflow: hidden;
}

.closing__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(to bottom, var(--bg-dark) 0%, rgba(10, 10, 10, 0.3) 100%),
    url("https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=2000&q=80")
      center/cover no-repeat;
  z-index: -2;
  filter: brightness(0.5) grayscale(40%);
}

.closing__content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================== */
/* LIGHTBOX 3D (LAYOUT)                           */
/* ============================================== */
.lightbox-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  transition:
    opacity 0.5s var(--ease-premium),
    visibility 0.5s;
}

.lightbox-3d.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lightbox-3d__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.lightbox-3d__track {
  position: relative;
  width: 100%;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  z-index: 2;
}

.lightbox-3d__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 20px;
  transition: all 0.3s var(--ease-premium);
  opacity: 0.6;
}

.lightbox-3d__nav:hover {
  opacity: 1;
  color: var(--accent-gold);
}

.lightbox-3d__nav svg {
  width: 40px;
  height: 40px;
}

.btn-prev {
  left: 20px;
}
.btn-next {
  right: 20px;
}

@media (max-width: 768px) {
  .lightbox-3d__nav svg {
    width: 30px;
    height: 30px;
  }
  .btn-prev {
    left: 5px;
  }
  .btn-next {
    right: 5px;
  }
}
