/* --- Variables de Color y Fuentes --- */
:root {
    --color-bg: #fff8f0;         
    --color-primary: #f2d7d9;  
    --color-primary-solapa: #f5d0d3;   
    --color-secondary: #d3e0ea;  
    --color-accent: #b0c2a2;     
    --color-text: #5c5c5c;        
    --color-border-envelope: #e0c8cb; 

    --font-title: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* --- Estilos Globales (Mobile-First) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--color-accent);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}


/* --- 1. ESTILOS DEL SOBRE (CORREGIDOS) --- */

.envelope-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    background-color: var(--color-secondary);
    z-index: 100;
    transition: opacity 1s ease-out 0.5s;
    padding: 1rem;
}

.envelope-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
    text-align: center;
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    cursor: pointer;
}

/* Cuerpo del sobre (AHORA ES LA BASE REAL) */
.envelope .body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary); /* El color de fondo va aquí */
    z-index: 1;
    border-radius: 5px; /* El radius va aquí */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* La sombra va aquí */
    border: 1px solid var(--color-border-envelope); /* El borde principal va aquí */
}

/* Solapa Izquierda (creada con ::before) */
.envelope .body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color-primary); /* Mismo color */
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    z-index: 2; /* Encima del body */
    border-right: 1px solid var(--color-border-envelope);
    border-radius: 5px 0 0 5px; /* Ajuste para la esquina */
}

/* Solapa Derecha (creada con ::after) */
.envelope .body::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color-primary); /* Mismo color */
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
    z-index: 2; /* Encima del body */
    border-left: 1px solid var(--color-border-envelope);
    border-radius: 0 5px 5px 0; /* Ajuste para la esquina */
}

/* Solapa inferior (estática) */
.envelope .lower-triangle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 51%; /* 1% extra para solaparse */
    background-color: var(--color-primary); /* Mismo color */
    clip-path: polygon(0 100%, 100% 100%, 50% 0);
    z-index: 3; /* Encima de las laterales */
    border-top: 1px solid var(--color-border-envelope);
}

/* Solapa superior (la que se anima) */
.envelope .flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 51%; /* 1% extra para solaparse */
    background-color: var(--color-primary-solapa); /* Mismo color */
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    z-index: 4; /* Encima de TODAS */
    transform-origin: top;
    transition: transform 0.5s ease-in-out;
    border-radius: 5px 5px 0 0;
}

/* Pseudo-elemento para los bordes de la solapa superior */
.envelope .flap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    border-top: 1px solid var(--color-border-envelope);
    border-left: 1px solid var(--color-border-envelope);
    border-right: 1px solid var(--color-border-envelope);
    box-sizing: border-box;
    border-radius: 5px 5px 0 0;
}

.open-text {
    position: relative; 
    font-family: var(--font-title);
    color: rgb(78, 76, 76);
    font-size: 1.2rem;
    z-index: 5;
    margin-top: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
}

/* --- Animación al abrir (cuando se añade la clase .open) --- */
.envelope-wrapper.open {
    opacity: 0;
    pointer-events: none;
}

.envelope-wrapper.open .flap {
    transform: rotateX(180deg);
    transition-delay: 0.2s;
}

.envelope-wrapper.open .open-text {
    opacity: 0;
}


/* --- 2. ESTILOS DE LA INVITACIÓN --- */
/* (Esta parte no cambia) */

.invitation {
    display: none; 
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    opacity: 0;
    animation: fadeIn 1s ease-in-out forwards;
    animation-delay: 1s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section {
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-primary);
}
.section:last-child {
    border-bottom: none;
}

/* Estilos del Timeline */
.timeline ul {
    list-style: none;
    position: relative;
    padding: 1rem 0;
}
.timeline ul::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--color-accent);
}

.timeline li {
    position: relative;
    padding: 1rem 0;
    text-align: left;
    width: 50%;
}
.timeline li::after {
    content: '';
    position: absolute;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: 2px solid var(--color-bg);
}

.timeline li:nth-child(odd) {
    left: 0;
    padding-right: 2rem;
    text-align: right;
}
.timeline li:nth-child(odd)::after {
    right: -8px; 
}

.timeline li:nth-child(even) {
    left: 50%;
    padding-left: 2rem;
}
.timeline li:nth-child(even)::after {
    left: -8px;
}

.timeline time {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--color-text);
    font-weight: bold;
}

/* Estilos del Mapa (Responsive) */
.map-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: 8px;
    margin-top: 1rem;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Estilos Botones RSVP */
.rsvp-buttons {
    display: flex;
    flex-direction: column; 
    gap: 1rem;
    margin-top: 1.5rem;
}

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease;
}
.button:hover {
    transform: scale(1.05);
}

.button.whatsapp {
    background-color: #25D366;
    color: white;
}
.button.email {
    background-color: var(--color-secondary);
    color: var(--color-text);
}

/* --- RESPONSIVE (Para Escritorio) --- */
@media (min-width: 600px) {
    .rsvp-buttons {
        flex-direction: row; 
        justify-content: center;
    }

    .invitation {
        padding: 2rem;
    }
}