/* ===========================
   VARIABLES Y BASE
   =========================== */

:root {
  --bg: #faf4ec;
  --bg-alt: #f4ece2;
  --deep: #2e1d13;
  --accent: #c55a2c;
  --accent-soft: #e0b995;
  --text: #3f3227;
  --text-muted: #8f7b68;
  --radius-card: 22px;
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.18);
  --section-padding: 70px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ===========================
   ELEMENTOS GENERALES
   =========================== */

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  color: var(--deep);
  margin-top: 0;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 18px;
}

.section {
  padding: var(--section-padding) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-highlight {
  background: #fff;
}

.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 720px;
}

.center {
  text-align: center;
}

.intro-text {
  margin: 0 auto 24px;
  max-width: 680px;
  color: var(--text-muted);
}

/* Layout dividido */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   BOTONES
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 25px rgba(197, 90, 44, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(197, 90, 44, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* ===========================
   HERO + SLIDER
   =========================== */

.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
}

.hero-slider {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 6, 2, 0.45),
    rgba(10, 6, 2, 0.85)
  );
  z-index: -1;
}

.hero-content {
  text-align: center;
}

.hero-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 3rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-title-white {
  color: #fff;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.hero-date {
  font-size: 1rem;
  margin-bottom: 20px;
}

.hero-sub {
  margin-top: 12px;
  font-size: 0.95rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  color: #f5e8dc;
}

/* Slider genérico */
.simple-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.simple-slider .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.simple-slider .slide.active {
  opacity: 1;
}

/* ===========================
   CUENTA ATRÁS + CALENDARIO
   =========================== */

.countdown-section {
  background: #f8f2ea;
}

.countdown-grid {
  margin: 20px auto 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 12px;
  max-width: 480px;
}

.count-box {
  background: #fff;
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(214, 182, 142, 0.8);
}

.count-number {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  color: var(--deep);
}

.count-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.calendar-card {
  margin: 0 auto;
  margin-top: 4px;
  max-width: 260px;
  border-radius: 22px;
  background: #fff;
  padding: 16px 10px 18px;
  text-align: center;
  border: 1px solid rgba(214, 182, 142, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.calendar-month {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calendar-day {
  font-family: "Playfair Display", serif;
  font-size: 2.4rem;
  line-height: 1;
  margin: 8px 0 4px;
  color: var(--deep);
}

.calendar-year {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .countdown-grid {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }
}

/* ===========================
   TARJETAS
   =========================== */

.card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(214, 182, 142, 0.7);
}

/* Nuestra historia fotos */
.story-photos {
  padding: 0;
  overflow: hidden;
}
.story-photos .simple-slider {
  height: 260px;
  border-radius: 20px;
}
@media (max-width: 900px) {
  .story-photos .simple-slider {
    height: 220px;
  }
}

/* ===========================
   DETALLES + GALERÍA ZONA CHIC
   =========================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.detail-strong {
  font-weight: 700;
  margin-bottom: 6px;
}

.venue-gallery {
  margin-top: 40px;
}

.venue-gallery h3 {
  text-align: center;
  margin-bottom: 8px;
}

.venue-slider {
  margin-top: 16px;
  height: 260px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

/* Mapa */
.map-frame {
  margin-top: 12px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(214, 182, 142, 0.7);
}

.map-frame iframe {
  width: 100%;
  height: 280px;
  border: 0;
}

/* En tarjeta (Ubicación) un pelín menos margen */
.map-frame-inline {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   PROGRAMA (TIMELINE)
   =========================== */

.timeline {
  margin-top: 26px;
  border-left: 2px solid rgba(214, 182, 142, 0.8);
  padding-left: 18px;
  position: relative; /* IMPORTANTE: para deco-program-3 */
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  display: none;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.time {
  font-family: "Playfair Display", serif;
  font-size: 0.95rem;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 4px;
}

.timeline-content h3 {
  margin-bottom: 4px;
}

/* ===========================
   ALOJAMIENTO - DESCUENTO
   =========================== */

.discount-accordion {
  margin-top: 14px;
  max-width: 360px;
}

.discount-toggle {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(214, 182, 142, 0.9);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--deep);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10);
}

.discount-toggle:hover {
  transform: translateY(-1px);
}

.discount-panel {
  margin-top: 10px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(214, 182, 142, 0.75);
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

.discount-code {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--deep);
  text-align: center;
}

/* ===========================
   RSVP CON FOTO DE FONDO
   =========================== */

.rsvp-section {
  position: relative;
  color: #fff;
  background-image: url("img/rsvp-bg.jpg");
  background-size: cover;
  background-position: center;
}

.rsvp-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 6, 2, 0.55),
    rgba(10, 6, 2, 0.7)
  );
}

.rsvp-inner {
  position: relative;
  z-index: 1;
}

.rsvp-title {
  color: #fff;
  text-shadow: 0 10px 28px rgba(0,0,0,0.35);
}

/* ===========================
   FOOTER
   =========================== */

.footer {
  padding: 22px 0 26px;
  background: #20140c;
  color: #f2e7db;
  text-align: center;
  font-size: 0.85rem;
}

.footer .small {
  color: #cbb9a5;
}

/* ===========================
   OVERLAY DEL SOBRE INICIAL
   =========================== */

.invite-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(circle at top, #fdf7ef 0%, #f3ebe1 40%, #e5d7c4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 28px 16px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.invite-overlay.finished {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.invite-inner {
  width: min(420px, 100%);
  text-align: center;
  padding: 12px 10px 10px;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
}

.invite-top-text {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  color: var(--deep);
  margin: 0 0 14px;
}

.invite-top-text span {
  display: block;
  font-size: 1.3rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.invite-names {
  font-family: "Playfair Display", serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 18px 0 0;
  color: var(--deep);
  font-size: 1.7rem;
}

/* SOBRE */

.envelope-wrapper {
  margin: 10px auto 0;
  width: min(320px, 100%);
  cursor: pointer;
  perspective: 1200px;
  position: relative;
}

.envelope {
  position: relative;
  width: 100%;
  padding-top: 65%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 35px rgba(102, 59, 26, 0.35);
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #c55a2c 0%, #9f4220 100%);
  border-radius: 8px;
}

.envelope-front {
  position: absolute;
  inset: 35% 0 0 0;
  background: linear-gradient(135deg, #c55a2c 0%, #b34b24 100%);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.envelope-flap {
  position: absolute;
  inset: 0;
  transform-origin: top center;
  background: linear-gradient(to bottom, #d06a3b 0%, #bf5123 60%, #c55a2c 100%);
  clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 0, 0 0);
  transition: transform 0.6s ease-in-out;
}

/* SELLO */
.envelope-seal {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 5;
}

.envelope-seal img {
  width: 45px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.envelope-seal:hover img {
  transform: scale(1.05);
}

.envelope-click {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fdf3e3;
}

.invite-overlay.opened .envelope-flap {
  transform: rotateX(-180deg);
}

.invite-overlay.opened .envelope-seal {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.85);
}

.invite-overlay.opened .envelope-click,
.invite-overlay.opened .invite-top-text {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* TARJETAS DENTRO DEL SOBRE */
.invite-cards {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  max-width: 320px;

  transform: translate(-50%, -52%);
  opacity: 0;
  pointer-events: none;

  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "reserved photo"
    "btn      photo";
  column-gap: 12px;
  row-gap: 10px;

  transition: opacity 0.35s ease;
}

.invite-overlay.cards-visible .invite-cards {
  opacity: 1;
  pointer-events: auto;
}

.invite-card {
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(225, 198, 160, 0.8);
}

.invite-card.reserved {
  grid-area: reserved;
  min-width: 0;
}

.invite-card.photo {
  grid-area: photo;
  padding: 8px;
}

.reserved-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.reserved-name {
  margin: 0;
  font-weight: 600;
  color: var(--deep);
  font-size: 0.9rem;
}

.photo-frame {
  width: 120px;
  height: 140px;
  overflow: hidden;
  border-radius: 12px;
  border: 0;
  background: transparent;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.26);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-details {
  margin: 0;
  margin-top: 4px;
  font-size: 0.85rem;
  grid-area: btn;
  justify-self: stretch;
}

#btn-details {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.75) !important;
  font-weight: 500;
}

#btn-details:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
}

/* Ajustes responsive sobre */
@media (max-width: 420px) {
  .invite-cards {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "photo"
      "reserved"
      "btn";
    row-gap: 10px;
    transform: translate(-50%, -50%);
  }

  .photo-frame {
    width: 110px;
    height: 132px;
    margin: 0 auto;
  }

  .invite-names {
    font-size: 1.65rem;
    letter-spacing: 0.18em;
  }
}

@media (max-width: 480px) {
  .invite-names {
    margin-top: 42px;
  }
}

/* Bajar 3mm el botón “Ver más detalles” en móvil */
@media (max-width: 480px) {
  .btn-details {
    margin-top: 0.7rem; /* ≈ 3mm */
  }
}

/* DIANA / & / SERGIO en móvil */
@media (max-width: 480px) {
  .hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
  }

  .hero-title span {
    display: block;
  }

  .hero-title .ampersand {
    font-size: 1.4rem;
    margin: 6px 0;
    letter-spacing: 0.1em;
  }
}

/* ===========================
   DETALLES: UNA SOLA TARJETA
   =========================== */

.cards-grid.single-card {
  grid-template-columns: 1fr;
}

.detail-location {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================
   DECORACIONES (UNA POR UNA) — DESKTOP
   ========================================================== */

/* --- CUENTA ATRÁS: TOP --- */
.countdown-section {
  position: relative;
  overflow: hidden;
}

.countdown-section::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 1200px;
  height: 400px;
  background: url("img/deco-countdown-top.png") no-repeat center top;
  background-size: contain;
  opacity: 0.18;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

/* --- CUENTA ATRÁS: BOTTOM --- */
.countdown-section::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: 50%;
  width: 1200px;
  height: 400px;
  background: url("img/deco-countdown-bottom.png") no-repeat center bottom;
  background-size: contain;
  opacity: 0.18;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

/* --- HISTORIA: TOP (ARREGLADO) --- */
.story-section {
  position: relative;
  overflow: hidden;
}

.story-section::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 50%;
  width: 1200px;
  height: 350px;
  background: url("img/deco-story-top.png") no-repeat center top;
  background-size: contain;
  opacity: 0.16;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

/* IMPORTANTE: el contenido por encima */
.story-section .container {
  position: relative;
  z-index: 1;
}

/* --- PROGRAMA: 3 IMÁGENES INDEPENDIENTES --- */
#schedule {
  position: relative;
  overflow: hidden;
}

#schedule::before {
  content: "";
  position: absolute;
  top: -50px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: url("img/deco-program-1.png") no-repeat center;
  background-size: contain;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}

#schedule::after {
  content: "";
  position: absolute;
  top: 45%;
  right: -40px;
  width: 260px;
  height: 260px;
  background: url("img/deco-program-2.png") no-repeat center;
  background-size: contain;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}

/* 3ª imagen va en la timeline (ya tiene position:relative arriba) */
#schedule .timeline::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: 50%;
  width: 260px;
  height: 260px;
  background: url("img/deco-program-3.png") no-repeat center;
  background-size: contain;
  opacity: 0.14;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================
   DECORACIONES (UNA POR UNA) — MÓVIL
   (aquí puedes tocar cada una independiente)
   ========================================================== */
@media (max-width: 480px) {

  /* Cuenta atrás: TOP */
  .countdown-section::before {
    width: 560px;
    height: 560px;
    opacity: 0.22;
    top: -10px;
  }

  /* Cuenta atrás: BOTTOM */
  .countdown-section::after {
    width: 560px;
    height: 560px;
    opacity: 0.22;
    bottom: -20px;
  }

  /* Historia: TOP */
  .story-section::before {
    width: 780px;
    height: 260px;
    opacity: 0.18;
    top: -10px;
  }

  /* Programa: imagen 1 (arriba-izq) */
  #schedule::before {
    width: 660px;
    height: 660px;
    opacity: 0.22;
    top: -60px;
    left: -220px;
  }

  /* Programa: imagen 2 (centro-der) */
  #schedule::after {
    width: 660px;
    height: 660px;
    opacity: 0.22;
    top: 40%;
    right: -240px;
  }

  /* Programa: imagen 3 (abajo-centro) */
  #schedule .timeline::after {
    width: 660px;
    height: 660px;
    opacity: 0.22;
    bottom: -180px;
  }
}
/* Botón reserva hotel */
.btn-reserva {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}
@media (max-width: 480px) {
  .btn-reserva {
    font-size: 0.9rem;
    padding: 10px 20px;
  }
}
/* Alojamiento: dos columnas en escritorio */
@media (min-width: 901px) {
  #stay .split {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: flex-start;
  }
}
.btn-book {
  width: 100%;
  margin-top: 12px;
}
@media (max-width: 480px) {

  /* PROGRAMA - imagen 1 (arriba) */
  #schedule::before {
    width: 600px;
    height: 600px;
    opacity: 0.22;

    top: -100px;    /* ↑↓ */
    left: 0px;  /* ←→ */
    right: auto;   /* importante para que mande left */
    transform: none;
  }

  /* PROGRAMA - imagen 2 (centro) */
  #schedule::after {
    width: 600px;
    height: 600px;
    opacity: 0.22;

    top: 70%;      /* ↑↓ (prueba 35% - 55%) */
    right: 0px; /* ←→ */
    left: auto;    /* importante para que mande right */
    transform: translateY(-50%);
  }

  /* PROGRAMA - imagen 3 (abajo) */
  #schedule .timeline::after {
    width: 520px;
    height: 520px;
    opacity: 0.22;

    bottom: -120px; /* ↑↓ */
    left: 50%;      /* ←→ (50% centra) */
    right: auto;
    transform: translateX(-50%);
  }
}
@media (max-width: 480px) {

  /* ===========================
     CUENTA ATRÁS – IMAGEN SUPERIOR
     deco-countdown-top.png
     =========================== */
  .countdown-section::before {
    width: 560px;
    height: 560px;
    opacity: 0.22;

    top: -20px;    /* ↑↓ */
    left: 60%;      /* ←→ (50% = centro) */
    transform: translateX(-50%);
  }

  /* ===========================
     CUENTA ATRÁS – IMAGEN INFERIOR
     deco-countdown-bottom.png
     =========================== */
  .countdown-section::after {
    width: 560px;
    height: 560px;
    opacity: 0.22;

    bottom: 0px; /* ↑↓ */
    left: 30%;      /* ←→ */
    transform: translateX(-50%);
  }

  /* ===========================
     HISTORIA – IMAGEN SUPERIOR
     deco-story-top.png
     =========================== */
  .story-section::before {
    width: 470px;
    height: 470px;
    opacity: 0.22;

    top: 0px;    /* ↑↓ */
    left: 50%;      /* ←→ */
    transform: translateX(-50%);
  }

}
@media (max-width: 480px) {
  .invite-card.photo {
    margin-top: 5mm;
  }
}
/* ===========================
   BOTÓN "VER MÁS DETALLES" – SOLO MÓVIL
   =========================== */
@media (max-width: 480px) {
  #btn-details {
    background: transparent;
    color: var(--accent) !important;
    border: 2px solid var(--accent);
    font-weight: 600;
    letter-spacing: 0.05em;
    box-shadow: 0 6px 18px rgba(197, 90, 44, 0.28);
  }

  #btn-details:hover {
    box-shadow: 0 8px 22px rgba(197, 90, 44, 0.45);
    transform: translateY(-1px);
  }
}
@media (max-width: 480px) {
  #btn-details {
    padding: 7px 18px;     /* antes era aprox 10px 22px → ↓ ~3 mm */
    font-size: 0.82rem;    /* ligeramente más pequeño */
    border-width: 2px;
    background: transparent;
    color: var(--accent) !important;
    font-weight: 600;
    letter-spacing: 0.05em;
    box-shadow: 0 6px 18px rgba(197, 90, 44, 0.28);
  }

  #btn-details:hover {
    box-shadow: 0 8px 22px rgba(197, 90, 44, 0.45);
    transform: translateY(-1px);
  }
}
/* ===========================
   DECORACIÓN FOTO SOBRE (SOLO MÓVIL)
   =========================== */

@media (max-width: 480px) {

  .invite-card.photo {
    position: relative;
    overflow: hidden;           /* 🔑 CLAVE: recorte */
    border-radius: 14px;        /* mismo radio que la tarjeta */
  }

  .invite-card.photo::before {
    content: "";
    position: absolute;
    inset: 0;                   /* 🔑 NO sobresale */
    background: url("img/deco-photo-frame.png") no-repeat center;
    background-size: 112%;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
  }

  .invite-card.photo .photo-frame {
    position: relative;
    z-index: 1;
  }
}
/* ===========================
   SOBRE (tapa por encima)
   Sustituye tus 3 bloques:
   .envelope-back, .envelope-front, .envelope-flap
   =========================== */

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #c55a2c 0%, #9f4220 100%);
  border-radius: 8px;
  z-index: 1;
}

/* “cuerpo” delantero del sobre (la parte baja) */
.envelope-front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 42%; /* ajusta si quieres más/menos altura del frontal */
  background: linear-gradient(135deg, #c55a2c 0%, #a34320 100%);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* tapa (triángulo) por ENCIMA del frontal */
.envelope-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62%;              /* controla cuánto “baja” la tapa */
  transform-origin: top center;
  background: linear-gradient(to bottom, #d06a3b 0%, #bf5123 60%, #c55a2c 100%);
  clip-path: polygon(0 0, 50% 100%, 100% 0); /* triángulo limpio */
  z-index: 3;               /* ✅ clave: por encima del frontal */
  transition: transform 0.6s ease-in-out;

  /* un pelín de sombra para que se vea “encima” */
  box-shadow: 0 10px 18px rgba(0,0,0,0.18);
}

/* El sello siempre por encima de todo */
.envelope-seal { z-index: 5; }
/* ==========================================================
   FIX EXACTO: animación flap + tarjetas por delante
   (NO cambia transform/posición/tamaño de tus tarjetas)
   ========================================================== */

/* 1) Asegura 3D para que la tapa rote de verdad */
.envelope-wrapper {
  perspective: 1200px;           /* ya lo tienes, lo reafirmo */
}

.envelope {
  position: relative;
  transform-style: preserve-3d;   /* clave */
}

/* 2) La tapa mantiene la animación y no “parpadea” */
.envelope-flap {
  transform: rotateX(0deg);
  backface-visibility: hidden;   /* clave */
  transform-style: preserve-3d;   /* clave */
  will-change: transform;         /* suaviza */
}

/* Al abrir: mantiene tu animación */
.invite-overlay.opened .envelope-flap {
  transform: rotateX(-180deg);
}

/* 3) Asegura el orden de capas: tarjetas SIEMPRE delante */
.envelope-back { z-index: 1; }
.envelope-front { z-index: 2; }
.envelope-flap { z-index: 3; }
.envelope-seal { z-index: 5; }   /* ya lo tenías */

/* Tarjetas por encima del sobre (sin moverlas) */
.invite-cards {
  z-index: 10;
}
