/* --- VARIABLES Y RESET --- */
:root {
    --color-text-main: #4A3B32;
    --color-gold: #684204;
    --color-brown:#B25519;
    --color-dark-tan:#9A835D;
    --color-terracotta: #C05826;
    --color-paper: #F9F5F0;
    --color-timeline-inactive: #e0d8c8;
    
    --font-script: 'Fleur De Leah', cursive; 
    --font-serif: 'Cinzel', serif;
    --font-body: 'Josefin Slab', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%; /* Esto le da estabilidad al sobre fixed */
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-paper);
    /* ELIMINADA IMAGEN DE FONDO DE AQUÍ PARA EVITAR REPETICIÓN EN CELULAR */
    overflow-x: hidden; 
}

/* --- TIPOGRAFÍA --- */
h1, h2, .script-title {
    font-family: 'Great Vibes', cursive; 
    color: var(--color-gold);
    font-weight: 400;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.script-title-main {
    font-family: var(--font-script) !important;
}

h3, h4, .serif-title {
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 2px;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- UTILIDADES --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.btn {
    display: inline-block;
    background: linear-gradient(to bottom, #D4B886, #C4A46D);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 1px;
    border: 1px solid #b08d55;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 15px;
}

.btn:hover {
    background: #b08d55;
    transform: translateY(-2px);
}

/* --- SECCIÓN 1: HERO (Portada) - CORREGIDO PARA MÓVIL --- */
.hero-section {
    width: 100%;
   min-height: 100vh; 
    min-height: 100dvh; 
    
    /* Color de respaldo igual al fondo de tu invitación */
    background-color: var(--color-paper);
    
    /* Configuración de fondo que evita repetición y se ajusta a la pantalla */
    background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)), url('principal.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover; 
    background-attachment: scroll; /* Scroll es más compatible en móviles que fixed */
    
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
    color: white;
    text-align: center;
    padding-bottom: 50px;
}

.hero-title {
    font-size: 6rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.hero-date {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* Countdown */
.countdown {
    display: flex;
    gap: 30px;
}
.countdown-item {
    text-align: center;
}
.countdown-number {
    font-size: 2rem;
    font-family: var(--font-serif);
    display: block;
}
.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* --- SECCIÓN 2: BIENVENIDA --- */
.welcome-section {
    padding: 80px 0;
    background-color: var(--color-paper);
    background-image: url('fondo2.png');
}

.welcome-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.circle-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: subtleZoom 15s ease-in-out infinite alternate;
}

@keyframes subtleZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.welcome-text { max-width: 500px; }
.icon-heart { font-size: 2rem; color: var(--color-terracotta); margin: 20px 0; }

/* --- SECCIONES MADERA --- */
.wood-section {
    background-image: url('fondo3.png');
    background-size: cover;
    background-attachment: scroll; /* Cambiado a scroll para consistencia móvil */
    padding: 80px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* En pantallas grandes sí podemos usar parallax */
@media screen and (min-width: 1024px) {
    .wood-section {
        background-attachment: fixed;
    }
}

.paper-card {
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 450px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.paper-card::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px dashed #dcdcdc;
    border-radius: 10px;
    pointer-events: none;
}

.reservation-name {
    font-size: 3rem;
    color: var(--color-text-main);
    margin: 10px 0;
}

/* --- VESTIMENTA --- */
.dresscode-section {
    padding: 80px 0;
    background-color: var(--color-paper);
}
.outfit-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.outfit-item img { height: 200px; object-fit: contain; }
.colors-forbidden { margin-top: 40px; }
.color-dots { display: flex; justify-content: center; gap: 15px; margin-top: 15px; }
.dot { width: 30px; height: 30px; border-radius: 50%; display: inline-block; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* --- ITINERARIO --- */
.itinerary-section { padding: 80px 0; background-color: var(--color-paper);background-image: url('fondo2.png');
    background-repeat: repeat; }
    .itinerary-section p {
    font-family: 'Cinzel', serif;
    color: #666;
    font-size: 1rem;
    letter-spacing: 1px;
}
.timeline { position: relative; max-width: 800px; margin: 40px auto; padding-bottom: 50px; }

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-timeline-inactive);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 0;
}

.timeline-fill {
    position: absolute;
    width: 4px;
    background-color: var(--color-brown);
    top: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 1;
    height: 0%; 
    transition: height 0.1s linear; 
    box-shadow: 0 0 10px rgba(147, 122, 79, 0.5); 
}

.timeline-item { padding: 10px 40px; position: relative; width: 50%; z-index: 2; }
.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; text-align: left; }
.timeline-content h4 { font-family: 'Cinzel', serif; /* Fuente Cinzel */
    font-weight: 600;color: var(--color-dark-tan); font-size: 1.2rem; transition: color 0.3s ease;}
.timeline-content span { font-family: 'Cinzel', serif; color: var(--color-terracotta); font-size: 0.9rem; transition: color 0.3s ease;}

.timeline-icon {
    position: absolute; width: 40px; height: 40px; right: -20px; background-color: var(--color-paper);
    border: 2px solid var(--color-timeline-inactive); 
    top: 15px; border-radius: 50%; z-index: 3;
    display: flex; align-items: center; justify-content: center; 
    color: var(--color-timeline-inactive); 
    transition: all 0.4s ease;
}
.timeline-item.right .timeline-icon { left: -20px; }

.timeline-item.active .timeline-icon {
    border-color: var(--color-brown);
    background-color: var(--color-brown);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(147, 122, 79, 0.6);
}

.timeline-item.active .timeline-content h4 { color: var(--color-dark-tan); }
.timeline-item.active .timeline-content span { color: var(--color-brown); }

.js-scroll-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.js-scroll-item.active {
    opacity: 1;
    transform: translateY(0);
}


/* --- MESA REGALOS --- */
.gift-icon { font-size: 3rem; color: var(--color-gold); margin-bottom: 20px; }
.bank-data-btn {
    background-color: #D4B886; color: white; padding: 15px; border-radius: 5px;
    margin-top: 20px; display: inline-block; cursor: pointer; font-family: var(--font-serif);
}

/* --- PADRINOS --- */
.padrinos-section {
    padding: 80px 20px; background-color: var(--color-paper);
    background-image: url('fondo2.png'); text-align: center;
}
.padrinos-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 20px;
    margin-top: 40px; max-width: 1100px; margin: 40px auto;
}
.padrino-card {
    background: #fff; border: 1px solid #f0e6d2; padding: 20px 10px;
    width: 300px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}
.padrino-role { font-family: var(--font-serif); color: var(--color-gold); font-size: 1.1rem; margin-bottom: 5px; text-transform: uppercase; }
.padrino-name { font-size: 0.9rem; color: #666; text-transform: uppercase; }

/* =========================================
   --- GALERÍA TIPO POLAROID (MOMENTOS) ---
   ========================================= */
.gallery-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    padding: 50px 0;
    max-width: 1200px;
    margin: 0 auto;
    /* Importante para que no salga scroll horizontal en móvil al mover fotos */
    overflow-x: hidden; 
}

.polaroid-item {
    background: white;
    padding: 15px 15px 50px 15px; /* Marco blanco más grande abajo */
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 280px; 
    
    /* Agregado will-change para mejor rendimiento de animación */
    will-change: transform;
    /* Transition solo para el hover, NO para el transform de scroll */
    transition: transform 0.2s ease-out, box-shadow 0.3s ease;
    
    position: relative;
}

.polaroid-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    filter: sepia(10%); 
}

/* Rotaciones alternas base */
.polaroid-item:nth-child(odd) {
    transform: rotate(-3deg);
    margin-top: 20px;
}
.polaroid-item:nth-child(even) {
    transform: rotate(4deg);
    margin-top: -20px; 
}

/* Hover: La foto se endereza y hace zoom */
.polaroid-item:hover {
    /* !important para asegurar que el hover gane a la animación de JS momentáneamente si se desea */
    transform: rotate(0deg) scale(1.1) !important;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}


/* --- SECCIÓN CONFIRMAR --- */
.confirm-section {
    background-image: url('anillo.png');
    background-size: cover; background-position: center;
    padding: 100px 20px; color: white; text-align: center; position: relative;
}
.confirm-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
}
.confirm-content { position: relative; z-index: 2; max-width: 600px; margin: 0 auto; }

/* --- HOSPEDAJE --- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; }
.location-img { width: 100%; height: 180px; object-fit: cover; border-radius: 5px; margin-bottom: 15px; }

/* Ajustes para la galería en Pantallas Grandes */
@media screen and (min-width: 1024px) {
    .gallery-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Dos columnas para que la animación sea simétrica */
        gap: 60px; /* Más espacio entre fotos para que el movimiento se note */
        padding: 100px 0;
        max-width: 900px;
        margin: 0 auto;
    }

    .polaroid-item {
        margin: 0 !important; /* Quitamos márgenes manuales para dejar que el JS controle el vuelo */
    }
}
/* --- RESPONSIVE --- */
@media screen and (max-width: 768px) {
    .hero-title { font-size: 4.5rem; }
    
    .wood-section { 
        padding: 40px 15px; 
    }
    
    .timeline::before, .timeline-fill { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item.left, .timeline-item.right { text-align: left; left: 0; }
    .timeline-item.left .timeline-icon, .timeline-item.right .timeline-icon { left: 10px; }

    /* Ajuste galería en móvil */
    .gallery-wrapper {
        gap: 50px; 
        padding-bottom: 80px;
    }
    /* Reiniciamos un poco márgenes para que se vean bien al moverse */
    .polaroid-item:nth-child(even) { margin-top: 0; }
    .polaroid-item:nth-child(odd) { margin-top: 0; }
}

/* Contenedor principal que bloquea la vista */
.envelope-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--color-paper);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 10000;
    transition: opacity 1s ease, visibility 1s;
}

/* El Sobre */
.envelope {
    position: relative;
    width: 300px; height: 200px;
    background-color: #e0d8c8; /* Color base del sobre */
    cursor: pointer;
    perspective: 1000px; /* Para el efecto 3D */
}

/* Solapa (Triángulo superior) */
.envelope-flap {
    position: absolute;
    top: 0; left: 0; width: 0; height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid var(--color-gold); /* Usamos tu dorado */
    transform-origin: top;
    transition: transform 0.8s ease;
    z-index: 3;
}

/* Frente del sobre */
.envelope-front {
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 0;
    border-left: 150px solid #d4cbb7;
    border-right: 150px solid #d4cbb7;
    border-bottom: 100px solid #c9bfa9;
    z-index: 4;
}

/* El Sello (Logo) */
.envelope-seal {
    position: absolute;
    top: 80px; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 80px;
    background-color: var(--color-terracotta); /* Tu color terracota */
    border-radius: 50%;
    z-index: 5;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Animación al abrir */
.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope.open .envelope-seal {
    transform: translateX(-50%) translateY(-50px);
    opacity: 0;
}

/* Ocultar todo el protector al finalizar */
.envelope-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

.click-hint {
    margin-top: 20px;
    font-family: var(--font-serif);
    letter-spacing: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* --- NUEVA SECCIÓN: UBICACIONES (CEREMONIA Y RECEPCIÓN) --- */

/* Ajuste al contenedor de madera para permitir dos tarjetas */
.locations-section {
    flex-direction: column; /* Asegura que el contenido fluya bien */
    height: auto; /* Permite que crezca según el contenido */
    padding: 100px 20px;
}

.locations-grid {
    display: flex;
    justify-content: center;
    gap: 50px; /* Espacio entre las dos tarjetas */
    flex-wrap: wrap; /* Importante para que baje en celular */
    width: 100%;
}

/* Modificaciones específicas para estas tarjetas */
.location-card {
    max-width: 400px; /* Ancho máximo para que no se vean gigantes en PC */
    width: 100%;
    margin: 0; /* Quitamos margen auto para usar el gap del grid */
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%; /* Para que ambas tarjetas midan lo mismo */
}

.location-title {
    font-size: 3rem;
    color: var(--color-gold);
    margin-bottom: 15px;
}

.location-img-wrapper {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.loc-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen para llenar el espacio sin deformar */
}

.location-subtitle {
    font-size: 1.1rem;
    color: var(--color-terracotta);
    margin-bottom: 5px;
    font-weight: 600;
}

.location-address {
    font-size: 0.95rem;
    color: #555;
    margin: 10px 0;
    min-height: 60px; /* Mantiene alineados los botones aunque el texto varíe */
}

.separator-dots {
    color: var(--color-gold);
    letter-spacing: 3px;
    font-size: 0.8rem;
    margin: 5px 0;
    opacity: 0.6;
}

.location-btn {
    background: #d4cbb7; /* Un tono más suave parecido al de Figma */
    color: var(--color-text-main);
    border: 1px solid #bdae93;
    width: 100%;
    max-width: 200px;
    font-weight: 600;
}

.location-btn:hover {
    background: var(--color-gold);
    color: white;
}

/* Ajuste Mobile para esta sección */
@media screen and (max-width: 768px) {
    .locations-grid {
        gap: 30px;
    }
    
    .location-card {
        max-width: 100%; /* En celular ocupan todo el ancho disponible */
    }
}

/* --- ESTILOS DEL MODAL (POPUP) --- */
.bank-modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 11000; /* Por encima del sobre */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

/* Clase para activar el modal con JS */
.bank-modal.active {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.bank-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    transform: scale(0.7);
    transition: transform 0.4s ease;
}

.bank-modal.active .bank-modal-content {
    transform: scale(1);
}

.bank-img-card {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

/* --- BOTÓN DE MÚSICA FLOTANTE --- */
.music-control {
    position: fixed;
    bottom: 25px; /* Un poco más arriba para que no choque con bordes */
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: var(--color-gold);
    color: white;
    border-radius: 50%;
    display: none; /* Se activa por JS */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20000; /* POR ENCIMA de los 10000 del sobre */
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

/* Forzamos visibilidad con una clase de utilidad */
.music-control.show {
    display: flex !important;
}