/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0, rgba(255, 255, 255, 0) 35%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.65) 0, rgba(255, 255, 255, 0) 30%),
        #f5ede6;
    color: #2c1d12;
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding-top: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Conceptual Background Elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(220, 220, 220, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(220, 220, 220, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    /* Tamaño de la cuadrícula */
    opacity: 0.5;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 2rem;
    background: rgba(245, 237, 230, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* For Safari */
    border-bottom: 1px solid rgba(172, 158, 145, 0.3);
    /* Softer border color */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    gap: 2rem;
}

.nav-brand {
    flex-shrink: 0;
    padding-right: 1rem;
}

.couple-initials {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #333;
    font-weight: bold;
    letter-spacing: 2px;
}

.nav-logo {
    height: 40px;
    width: auto;
    display: block;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #3a2c21;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.6em 1.0em;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active-link {
    color: #6B5E4B;
    /* Darker, more elegant color */
    background-color: rgba(255, 255, 255, 0.7);
}

.nav-actions {
    display: flex;
    align-items: center;
    /* Adjusted for better alignment */
    gap: 1.5rem;
    flex-shrink: 0;
}

.view-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: 2px;
    /* Fine-tune adjustment */
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    color: #333;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    vertical-align: middle;
    margin-top: -2px;
    /* Visual adjustment if the slider is too low */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #6B5E4B;
}

input:focus+.slider {
    box-shadow: 0 0 1px #6B5E4B;
}

input:checked+.slider:before {
    -webkit-transform: translateX(22px);
    -ms-transform: translateX(22px);
    transform: translateX(22px);
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}

.action-btn {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
    padding: 0.6em 1.2em;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.rsvp-btn {
    margin-top: 6px;
    margin-bottom: 6px;
    background-color: #B21C29;
    /* Rojo oscuro */
    color: #fff;
}

.rsvp-btn:hover {
    background-color: #931723;
    /* Rojo más oscuro */
}

.language-switcher a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.language-switcher a.active {
    color: #B21C29;
    /* rRojo oscuro */
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 90vh;
    width: 100vw;
    display: grid;
    place-items: center;
    color: #2c1d12;
    overflow: hidden;
    z-index: 5;
    background: linear-gradient(135deg, rgba(245, 237, 230, 0.94) 0%, rgba(238, 228, 216, 0.94) 45%, rgba(235, 222, 210, 0.94) 100%);
    padding: 2rem 1.5rem 3rem;
    box-sizing: border-box;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 2.5rem;
    align-items: center;
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 1rem 0;
}

.logo-container {
    width: 100%;
    height: clamp(200px, 28vh, 340px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    grid-column: 2;
}

#logo-2d-container,
#logo-3d-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#logo-2d-container img {
    display: block;
    margin: auto;
    object-fit: contain;
    max-height: 100%;
    max-width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.06));
}

#logo-3d-container canvas {
    display: block;
}

.hero-content p {
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    margin: 0.75rem 0 0.5rem;
    color: #3a2c21;
    grid-column: 2;
    text-align: left;
}

#countdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.75rem;
    font-weight: 600;
    margin: 0.75rem 0 1rem;
    color: #2c1d12;
    width: 100%;
    max-width: 480px;
    grid-column: 2;
}

.bottom-image-wrapper {
    width: 100%;
    height: 100%;
    max-height: 440px;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.12);
    grid-row: 1 / span 4;
    grid-column: 1;
}

.bottom-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    object-fit: cover;
    height: 100%;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* Content Sections */
.content-section {
    background: linear-gradient(180deg, rgba(245, 237, 230, 0.95) 0%, rgba(241, 231, 221, 0.96) 100%);
    position: relative;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    z-index: 5;
    padding: 2.5rem 0.5rem;
}

.section-content {
    max-width: 1200px;
    padding: 0.5rem 1rem 0;
    margin-bottom: 0rem !important;
    color: #2c1d12;
    width: 100%;
    opacity: 0;
    transform: translateY(50px);
    /* Start slightly below */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.content-section.is-visible .section-content {
    opacity: 1;
    transform: translateY(0);
}

.content-section h2 {
    font-size: clamp(2.1rem, 4vw, 2.6rem);
    font-family: 'Playfair Display', serif;
    color: #4c3728;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Nosotros Section */
.profile-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1rem !important;
    border: 1px solid #eee;
    /* Borde sutil */
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    /* Sombra suave */
}

@media (min-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr 1fr;
    }

    .alba-profile-container .profile-image {
        order: 2;
    }

    .alba-profile-container .profile-description {
        order: 1;
    }

    .victor-profile-container .profile-image {
        order: 1;
    }

    .victor-profile-container .profile-description {
        order: 2;
    }
}

/* La Boda Section */
.wedding-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .wedding-details {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    border: 1px solid rgba(142, 117, 95, 0.12);
    padding: 1.75rem;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    background: #fff;
    margin-bottom: 1rem !important;
}

/* El Bus Section */
.bus-schedule {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .bus-schedule {
        grid-template-columns: 1fr 1fr;
    }
}

.schedule-item {
    border: 1px solid #eee;
    /* Borde sutil */
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    /* Sombra suave */
    margin-bottom: 1rem !important;
}

/* Alojamiento Section */
.accommodation-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .accommodation-options {
        grid-template-columns: 1fr 1fr;
    }
}

.hotel-card {
    border: 1px solid rgba(142, 117, 95, 0.12);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    background: #fff;
    margin-bottom: 1rem !important;
}

/* Form Styles */
.rsvp-form {
    max-width: 720px;
    margin: 2.5rem auto;
    padding: 2rem;
    border-radius: 18px;
    width: 90%;
    box-sizing: border-box;
    border: 1px solid rgba(142, 117, 95, 0.12);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.07);
    background: #fff;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(142, 117, 95, 0.18);
    border-radius: 12px;
    background: #f9f6f3;
    color: #2c1d12;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #b25a3c;
    box-shadow: 0 0 0 3px rgba(178, 90, 60, 0.15);
}

.submit-btn {
    background: linear-gradient(90deg, #b25a3c, #c46d4d);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 12px 30px rgba(178, 90, 60, 0.35);
}

.submit-btn:hover {
    background: linear-gradient(90deg, #a24f33, #b85d41);
    transform: translateY(-1px);
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    /* More padding */
    background: #E7DFD6;
    /* Match section background */
    color: #6B5E4B;
    /* Softer text color */
    position: relative;
    z-index: 1;
    width: 100vw;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    /* Stack elements vertically */
    justify-content: center;
    /* Center them */
    align-items: center;
    gap: 1.5rem;
    /* Space between elements */
    width: 100%;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #6B5E4B;
}

.footer-thank-you {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    margin-top: -1rem;
    /* Pull it closer to the logo */
}

.back-to-top {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: rgba(107, 94, 75, 0.8);
    /* #6B5E4B with alpha */
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background-color: #6B5E4B;
    transform: translateY(-3px);
}

#countdown .numbers {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5.4vw, 3.24rem);
    line-height: 1;
}

#countdown .labels {
    font-size: clamp(0.7rem, 1.8vw, 0.81rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/*
----------------------------------------------------------------
RESPONSIVE DESIGN - MOBILE FIRST ADJUSTMENTS
----------------------------------------------------------------
*/

/* --- INSTRUCCIONES PARA HTML Y JAVASCRIPT --- */
/*
    Para que el menú hamburguesa funcione, necesitas hacer dos pequeños cambios:

    1.  En tu archivo HTML (index.php), añade este botón DENTRO del .nav-container,
        justo después del .nav-brand y antes del .nav-menu:

        <button class="hamburger" aria-label="Abrir menú" aria-expanded="false">
            <span class="hamburger-box">
                <span class="hamburger-inner"></span>
            </span>
        </button>

    2.  En tu archivo JAVASCRIPT (script.js), añade este código para que el botón
        funcione al hacer clic:

        document.addEventListener('DOMContentLoaded', () => {
            const hamburger = document.querySelector('.hamburger');
            const navMenu = document.querySelector('.nav-menu');

            if (hamburger && navMenu) {
                hamburger.addEventListener('click', () => {
                    hamburger.classList.toggle('is-active');
                    navMenu.classList.toggle('is-active');
                    
                    const isExpanded = hamburger.getAttribute('aria-expanded') === 'true';
                    hamburger.setAttribute('aria-expanded', !isExpanded);
                });
            }
        });
*/

/* --- Estilos para el botón Hamburguesa --- */
.hamburger {
    display: none;
    /* Oculto en escritorio */
    padding: 15px;
    cursor: pointer;
    background-color: transparent;
    border: 0;
    z-index: 1001;
    /* Por encima del menú */
    transition: transform 0.3s ease;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
    width: 30px;
    height: 3px;
    background-color: #333;
    border-radius: 4px;
    position: absolute;
    transition: transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 4px;
    position: absolute;
    transition: transform 0.15s ease;
}

.hamburger-inner::before {
    top: -10px;
}

.hamburger-inner::after {
    bottom: -10px;
}

/* Animación del botón a 'X' */
.hamburger.is-active .hamburger-inner {
    transform: rotate(225deg);
    transition-delay: 0.12s;
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

.hamburger.is-active .hamburger-inner::before {
    top: 0;
    transform: rotate(-90deg);
    transition: top 0.1s ease-out, transform 0.22s cubic-bezier(0.215, 0.61, 0.355, 1) 0.12s;
}

.hamburger.is-active .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-90deg);
    transition: bottom 0.1s ease-out, transform 0.22s cubic-bezier(0.215, 0.61, 0.355, 1) 0.12s;
}


/* --- Media Query principal para Teléfonos (hasta 768px) --- */
@media (max-width: 768px) {

    /* --- Ajustes Generales --- */
    html {
        scroll-padding-top: 70px;
        /* Ajustar al nuevo alto del header */
    }

    body {
        padding-top: 70px;
        /* Dejar espacio para el header fijo */
    }

    /* --- Header y Navegación --- */
    header {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
        height: 70px;
    }

    .couple-initials {
        font-size: 2rem;
        /* Más pequeño para móviles */
    }

    .hamburger {
        display: inline-block;
        /* Mostrar en móvil */
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        /* Justo debajo del header */
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: rgba(237, 228, 219, 0.98);
        /* Fondo casi opaco */
        backdrop-filter: blur(5px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transform: translateX(100%);
        /* Oculto fuera de la pantalla */
        transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
        padding-bottom: 5rem;
        /* Espacio extra abajo */
    }

    .nav-menu.is-active {
        transform: translateX(0);
        /* Visible */
    }

    .nav-menu a {
        font-size: 1.5rem;
        /* Letras grandes para fácil selección */
        padding: 0.5em 1em;
    }

    .nav-actions {
        /* Ocultamos acciones individuales para integrarlas en el menú si es necesario */
        /* O las simplificamos. Por ahora, las dejamos para ver cómo se comportan */
        gap: 1rem;
    }

    .view-switcher span {
        display: none;
        /* Ocultar texto "2D/3D" */
    }

    .rsvp-btn {
        display: none;
        /* Ocultar botón RSVP principal, ya está en el menú */
    }


    /* --- Hero Section --- */
    .hero-section {
        padding: 1rem;
    }

    .logo-container {
        width: 90vw;
        height: clamp(150px, 25vh, 300px);
        /* Ligeramente más pequeño */
    }

    .hero-content p {
        font-size: clamp(1rem, 2.5vw, 1.4rem);
    }

    #countdown {
        gap: 0.5rem;
        padding: 0;
        grid-column: 1;
    }

    #countdown .numbers {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    #countdown .labels {
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    }

    /* --- Secciones de Contenido --- */
    .content-section {
        padding: 1rem 0.5rem;
    }

    .section-content {
        max-width: 100%;
        padding: 0.5rem 0;
    }

    .profile-container,
    .detail-card,
    .schedule-item,
    .hotel-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .hero-bottom-image {
        background-color: #EDE4DB;
        display: flex;
        justify-content: center;
        padding: 3rem 1rem;
    }

    .bottom-image-wrapper {
        max-width: 600px;
        width: 100%;
        margin: 0 auto;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
    }

    .bottom-image-wrapper img {
        display: block;
        width: 100%;
        height: auto;
        object-fit: cover;
        aspect-ratio: 3 / 2;
        /* Ajuste visual: mantén proporción limpia */
    }

    /* --- Hero grid reflow --- */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .logo-container,
    .hero-content p,
    #countdown {
        grid-column: 1;
        justify-self: center;
    }

    .hero-content p {
        text-align: center;
    }

    .bottom-image-wrapper {
        grid-row: auto;
        max-height: 320px;
    }

    /* --- Formulario --- */
    .rsvp-form {
        width: 100%;
        padding: 1.5rem;
    }

    /* --- Footer --- */
    footer {
        padding: 3rem 1rem;
    }
}

/* Enlaces externos como botones */
a[target="_blank"] {
    display: inline-block;
    background-color: #B21C29;
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6em 1.2em;
    border-radius: 25px;
    transition: background-color 0.3s ease;
    font-size: 0.95em;
}

a[target="_blank"]:hover {
    background-color: #931723;
    color: #fff;
}
