/* =============================
   RESET Y VARIABLES
   ============================= */

:root {
  --great-sand: "Great Vibes", cursive;
  --josefin-sand: "Josefin Sans", sans-serif;
  --montserrat-sand: "Montserrat", sans-serif;
  --pinyon-sand: "Pinyon Script", cursive;
  --lora-sand: "Lora", serif;
}
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
/* =============================
   COMPONENTES Y SECCIONES
   ============================= */

.button {
  background-color: #fedfe5;
  border: 2px solid #960018;
  border-radius: 15px;
  color: #960018;
  margin: 20px;
  padding: 10px 40px;
  text-decoration: none;
  display: inline-block;
  font-family: var(--montserrat-sand);
  transition: all 0.3s ease;
  cursor: pointer;
}
.button:active {
  position: relative;
  top: 2px;
}
.button:hover {
  background-color: #960018;
  border: #fedfe5 2px solid;
  color: #fedfe5;
}

.card {
  align-items: center;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  font-family: var(--lora-sand);
  line-height: 1.6;
  margin: 1rem;
  padding: 1rem;
  width: 70%;
}
.card b {
  font-weight: 700;
  margin-bottom: 1rem;
}
.card h3 {
  font-family: var(--great-sand);
  text-align: center;
}
.card p {
  margin-bottom: 1rem;
  width: 100%;
}

#countdown {
  align-items: center;
  display: flex;
  font-size: 2rem;
  justify-content: center;
  margin-top: 1rem;
  text-align: center;
  position: relative;
  z-index: 5;
}
#countdown p {
  font-family: var(--lora-sand);
  font-size: 6vw;
  padding: 0 0.5vw 0 0.5vw;
}
.countdown-item {
  display: inline-block;
  font-family: var(--lora-sand);
  font-size: 8vw;
  margin-right: 20px;
  padding: 2vw 1vw 2vw 1vw;
}
.countdown-item-days .countdown-item-label {
  display: block;
}
.countdown-item-label {
  font-size: 3vw;
  margin-top: 5px;
}

footer {
  background-color: #be86e4;
  font-family: var(--montserrat-sand);
  font-weight: 600;
  padding: 1rem;
  text-align: center;
}
footer img {
  width: 100px;
}
footer p {
  font-size: 0.7rem;
}

.family_container {
  align-items: center;
  color: #000000;
  display: flex;
  flex-direction: column;
  font-family: var(--lora-sand);
  padding: 4rem 0rem;
  position: relative;
  text-align: center;
}
.family-card {
  width: 60%;
}
.family_container h3 {
  color: #61047e;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gift_section {
  align-items: center;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  padding: 1rem 2rem;
  text-align: center;
}
.gift_section h3 {
  font-family: var(--great-sand);
  font-size: 3rem;
  margin-bottom: 2rem;
}

.message {
  background-color: #dfc7ff;
  color: #000000;
}
.message_paragraph {
  font-family: var(--lora-sand);
  font-size: 1.2rem;
  line-height: 1.6;
  padding: 2rem;
  text-align: center;
}

.img_card {
  height: auto;
  margin-bottom: 1rem;
  width: 10rem;
}
.card_img_container {
  align-items: center;
  display: flex;
  flex-direction: row;
  height: auto;
  justify-content: center;
  margin-bottom: 1rem;
  padding-top: 1rem;
  width: 100%;
}
.gift_card {
  box-shadow: 0 4px 8px 0 #af7395;
  height: auto;
  width: 100%;
}

/* Contenedor estático del carrusel */
.carousel {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
}

/* Área de altura fija para evitar saltos de layout */
.carousel-items {
  position: relative;
  width: 100%;
  height: 600px; /* Tamaño estático fijo */
  background-color: rgba(0, 0, 0, 0.01p
  ); /* Fondo suave para los bordes restantes */
  border-radius: 12px;
}

/* Manejo de diapositivas con animación fade */
.carousel-items div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-items div.active {
  opacity: 1;
  visibility: visible;
}

/* Mostrar la imagen COMPLETA ajustándose al contenedor */
.carousel-items div img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* Garantiza que la imagen salga 100% entera sin recortar */
  border-radius: 8px;
}
.carousel p {
  font-size: 1.2rem;
  color: #333;
  text-align: center;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 0 10px;
  cursor: pointer;
  z-index: 1;
}
.carousel-btn:active {
  background: rgba(77, 130, 255, 0.7);
}
.carousel-btn.prev {
  left: 0;
}
.carousel-btn.next {
  right: 0;
}

.container {
  width: 100%;
  box-sizing: border-box;
}

iframe {
  width: 100%;
  height: 100%;
}

.img-section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}
.img_body {
  min-height: 100vh;
  min-height: 100svh;
}

.soft-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #dfc7ff);
  pointer-events: none;
  opacity: 0;
}
.soft-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0), #dfc7ff);
  pointer-events: none;
  opacity: 0;
}
.soft-section.show-fade::after,
.soft-section.show-fade::before {
  opacity: 1;
}

#music-player {
  position: fixed;
  top: 50%;
  right: 0px;
  transform: translateY(-50%);
}
#music-button {
  background: none;
  border: none;
  font-size: 20px;
}

#bg-layer {
  position: fixed;
  inset: 0;
  background-image: url("../img/bg-1.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: -10;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}

.pre_img {
  text-align: center;
  height: auto;
}
.clock_cont {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #000000;
  padding-top: 4rem;
  min-height: 100vh; /* Garantiza que ocupe toda la pantalla sin encimarse */
  box-sizing: border-box;
}
.pre_img p {
  margin: 1.5rem 0;
  font-size: 1.5rem;
}
.pre_img h2 {
  font-size: 8vw; /* Se redujo el tamaño de fuente exagerado */
  font-family: var(--great-sand);
  color: #61047e;
  text-align: center;
  margin: 1rem 0;
}
#XV_letter {
  font-size: 10rem;
  color: white;
  text-shadow: pink 2px 2px 4px;
  position: relative;
  z-index: 1;
}
#quince_letter {
  margin-top: -8rem;
  margin-bottom: 4rem;
  font-size: 4rem;
  font-family: var(--great-sand);
  color: #d4af37;
  position: relative;
  z-index: 2;
}

#welcome_mesagge {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #cf9bee;
  color: #ffffff;
  text-shadow: #aa3e7d 1px 1px 2px;
  padding: 20px;
  border: 3px solid #802a5c;
  border-radius: 5px;
  text-align: center;
  z-index: 9999;
}
#welcome_mesagge h1 {
  font-family: var(--great-sand);
  font-size: 4rem;
}
#welcome_mesagge p {
  font-family: var(--montserrat-sand);
  width: 80%;
  margin: auto;
  margin-bottom: 2rem;
}
#play_welcome_button {
  background-color: #aa3e7d;
  border: #ffeaf6 1px solid;
  color: #ffeaf6;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
}
#play_welcome_button:hover {
  background-color: #eeeaff;
  color: #aa3e7d;
  border: #aa3e7d 1px solid;
}
.glass {
  background-color: rgba(0, 0, 0, 0.792);
  position: fixed;
  width: 100%;
  height: 100%;
  padding: 100%;
  z-index: 10000;
}

/* ============================================================
   SOLICITUDES ESPECÍFICAS DE DISEÑO (PADRES, MAPAS Y REGALOS)
   ============================================================ */

/* 1. SECCIÓN PADRES Y PADRINOS */
.soft-section.family_container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* 2. MAPAS: CEREMONIA Y RECEPCIÓN (Estructura Base Móvil) */
.map-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  align-items: center;
}

.map-info-section {
  width: 100%;
}

.map-container iframe {
  width: 100%;
  height: 350px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 3. POSIBLE REGALO (Estructura Base Móvil) */
.confirmation-section.message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Forzar tarjeta de links primero en Móvil */
.confirmation-section.message .gift_card:nth-of-type(1) {
  order: 1;
}
.confirmation-section.message .gift_card:nth-of-type(2) {
  order: 2;
}

/* =============================
   MEDIA QUERIES (ESCRITORIO 720px en adelante)
   ================================ */

@media only screen and (min-width: 720px) {
  /* Padres y Padrinos en dos columnas */
  .soft-section.family_container {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
  }
  .soft-section.family_container .family-card {
    width: 40%;
    margin: 0;
  }

  /* Contenedor general de Misa y Recepción */
  .family_container.message .family-card {
    width: 90%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
  }
  .family_container.message .map-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  /* CEREMONIA: Info a la izquierda, Mapa a la derecha */
  .family_container.message:nth-of-type(4) .map-container {
    flex-direction: row;
  }

  /* RECEPCIÓN: Mapa a la izquierda, Info a la derecha */
  .family_container.message:nth-of-type(5) .map-container {
    flex-direction: row-reverse;
  }

  .family_container.message .map-info-section,
  .family_container.message iframe {
    flex: 1;
  }

  /* POSIBLE REGALO: Links izquierda, Efectivo derecha */
  .confirmation-section.message {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
  }
  .confirmation-section.message h3,
  .confirmation-section.message .message_paragraph {
    width: 100%;
  }
  .confirmation-section.message .gift_card:nth-of-type(1) {
    order: 1;
    width: 45% !important;
    margin: 0;
  }
  .confirmation-section.message .gift_card:nth-of-type(2) {
    order: 2;
    width: 45% !important;
    margin: 0;
  }

  .carousel-items div img {
    height: 100vh;
    height: 100svh;
  }
}

@media only screen and (min-width: 1280px) {
  .card {
    width: 23%;
  }
}




/* Overlay principal */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 12, 28, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* Dimensiones del sobre */
.envelope-wrapper {
  position: relative;
  width: 340px;
  height: 240px;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  background: #3b1e54; /* Fondo interno del sobre */
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

/* Solapa superior desplegable */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 170px solid transparent;
  border-right: 170px solid transparent;
  border-top: 130px solid #522b76;
  transform-origin: top;
  transition: transform 0.6s ease-in-out, z-index 0.2s;
  z-index: 4;
}

/* Bolsillo frontal del sobre */
.envelope-pockets {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6c389b 50%, #522b76 50%);
  clip-path: polygon(0 0, 0% 100%, 100% 100%, 100% 0, 50% 50%);
  z-index: 3;
  border-radius: 8px;
}

/* Carta adentro del sobre */
.letter {
  position: absolute;
  top: 12px;
  left: 15px;
  right: 15px;
  bottom: 12px;
  background: #ffffff;
  border-radius: 6px;
  padding: 1.2rem 1rem;
  text-align: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.8s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.letter h1 {
  color: #6c389b;
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.1;
}

.letter p {
  color: #555;
  font-size: 0.85rem;
  margin: 0;
}

.letter h2 {
  color: #333;
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
}

/* Sello de cera estilo botón */
.wax-seal {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65px;
  height: 65px;
  background: radial-gradient(circle, #a25df0 0%, #6c389b 100%);
  border-radius: 50%;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.4);
  border: 2px solid #b87bf8;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 18px rgba(162, 93, 240, 0.6);
}

.wax-seal span {
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Montserrat', sans-serif;
}

/* --- ANIMACIÓN AL ABRIR --- */
.envelope-wrapper.open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1; /* Pasa atrás de la carta */
}

.envelope-wrapper.open .letter {
  transform: translateY(-120px); /* Desliza la carta hacia arriba */
  z-index: 4; /* Pasa enfrente del sobre */
}

.envelope-wrapper.open .wax-seal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}