/* 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-color: #EDE4DB;
    /* Nuevo color de fondo */
    color: #333;
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
    min-height: 100dvh;
    position: relative;
    padding-top: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 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-color: rgba(237, 228, 219, 0.85);
    /* #EDE4DB with transparency */
    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: #333;
    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;
    height: 100dvh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #333;
    overflow: hidden;
    padding: 1rem;
    box-sizing: border-box;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../../src/img/nosotros/nosotros.jpg');
    background-size: cover;
    background-position: center;
    filter: grayscale(1) opacity(0.6);
    opacity: 0.6;
    z-index: -2;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(237, 228, 219, 0.5);
    z-index: -1;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.logo-container {
    width: 80vw;
    max-width: 600px;
    height: clamp(200px, 30vh, 350px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

#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%;
}

#logo-3d-container canvas {
    display: block;
}

.hero-content p {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin: 1.0rem 0;
    color: #333;
}

#countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 1rem;
    color: #333;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.countdown-item {
    display: flex;
    flex-direction: column;
}

/* Content Sections */
.content-section {
    background: #E7DFD6;
    position: relative;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    z-index: 5;
    padding: 1rem 0.5rem;
}

.section-content {
    max-width: 90vw;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0rem !important;
    color: #333;
    width: 100%;
    opacity: 0;
    transform: translateY(50px);
    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: 2.5rem;
    font-family: 'Playfair Display', serif;
    color: #6B5E4B;
    margin-bottom: 1rem;
    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;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

@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 #eee;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    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;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    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 #eee;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    margin-bottom: 1rem !important;
}

/* Form Styles */
.rsvp-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    box-sizing: border-box;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.form-group {
    margin-bottom: 2rem;
    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: 2px solid #eee;
    border-radius: 10px;
    background: #f5f5f5;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #add8e6;
}

.submit-btn {
    background-color: #B21C29;
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    width: 100%;
    max-width: 300px;
}

.submit-btn:hover {
    background-color: #931723;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    background: #E7DFD6;
    color: #6B5E4B;
    position: relative;
    z-index: 1;
    width: 100vw;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    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;
}

.back-to-top {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: rgba(107, 94, 75, 0.8);
    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;
    padding: 15px;
    cursor: pointer;
    background-color: transparent;
    border: 0;
    z-index: 1001;
    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;
    }

    body {
        padding-top: 70px;
    }

    /* --- Header y Navegación --- */
    header {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
        height: 70px;        
    }

    .couple-initials {
        font-size: 2rem;
    }

    .hamburger {
        display: inline-block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100dvh - 70px);
        background-color: rgba(237, 228, 219, 0.98);
        backdrop-filter: blur(5px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
        padding-bottom: 5rem;
    }

    .nav-menu.is-active {
        transform: translateX(0);
    }

    .nav-menu a {
        font-size: 1.5rem;
        padding: 0.5em 1em;
    }

    .nav-actions {
        gap: 1rem;
    }

    .view-switcher span {
        display: none;
    }

    .rsvp-btn {
        display: none;
    }

    /* --- Hero Section --- */
    .hero-section {
        height: 88dvh;
        padding: 1rem;
    }
    
    .hero-section::before {
        background-size: 200%;     /* Que no recorte nada */
        background-repeat: no-repeat; /* Evita repeticiones */
        background-position: center middle; /* Centra la imagen */
    }

    .logo-container {
        width: 90vw;
        height: clamp(150px, 25vh, 300px);
    }

    .hero-content p {
        font-size: clamp(1rem, 2.5vw, 1.4rem);
    }

    #countdown {
        gap: 0.5rem;
        padding: 0;
    }

    #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;
    }

    /* --- 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;
}