/* --- Estilos Generales, Fuentes y Reseteo Básico --- */
* {
    box-sizing: border-box; /* Previene problemas de padding y bordes */
}

html {
    scroll-behavior: smooth; /* Mueve el scroll-behavior aquí para mejor compatibilidad */
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    color: #333;
    /* Fondo blanco simple */
    background-color: #fff;
}

/* Evita el scroll del body cuando el menú está abierto */
body.no-scroll {
    overflow: hidden;
}

h1, h2, h3, .nav-logo {
    font-family: 'Playfair Display', serif;
}

/* --- Navegación --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 240, 245, 0.7); /* Fondo translúcido rosa */
    border-bottom: 1.5px solid #e9a5c9;
    box-shadow: 0 4px 16px rgba(233, 165, 201, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(8px); /* Prefijo para compatibilidad con Safari */
    backdrop-filter: blur(8px); /* Glassmorphism */
}

.nav-logo {
    font-size: 1.7rem;
    font-weight: bold;
    text-decoration: none;
    color: #c05fa5;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-logo:hover {
    color: #e9a5c9;
}

.nav-links a {
    margin: 0 1rem;
    text-decoration: none;
    color: #c05fa5;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #e9a5c9 0%, #f8b4e9 100%);
    transition: width 0.3s;
    position: absolute;
    left: 0;
    bottom: -4px;
}

.nav-links a:hover {
    color: #e9a5c9;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

/* Ocultamos el ícono de cierre por defecto */
.hamburger .icon-close {
    display: none;
}

/* Cuando el menú está activo (botón tiene clase 'active'), ocultamos el ícono de menú y mostramos el de cierre */
.hamburger.active .icon-menu {
    display: none;
}

.hamburger.active .icon-close {
    display: block;
}

/* --- Header --- */
header {
    /* Color de fondo de respaldo si la imagen no carga */
    background-color: #4a4a4a;
    height: 80vh;
    /* Ahora el fondo es solo el degradado sobre la imagen de fondo */
    /* Reemplaza 'tu-nueva-imagen.jpg' con el nombre de tu archivo. El degradado se ajustó para usar los colores de la marca. */
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(197, 164, 126, 0.3)), url('imagenes/logo-libra.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.hero-logo {
    width: 150px;
    height: auto;
    margin-bottom: 1rem;
    /* Opcional: añadir un filtro de sombra para que resalte más */
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.5));
}

.hero-content h1 {
    font-size: clamp(3.5rem, 8vw + 1rem, 6rem); /* Aumentado para más impacto */
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 10px rgba(0,0,0,0.7); /* Sombra más pronunciada */
    letter-spacing: 2px; /* Espaciado entre letras para un look más premium */
    font-weight: 800; /* Un poco más de grosor */
}

.hero-content p {
    font-size: clamp(1.5rem, 3vw + 0.5rem, 2rem); /* Aumentado para mejor balance */
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
    letter-spacing: 1px; /* Ligero espaciado para que respire mejor */
}

/* --- Secciones Principales --- */
main {
    padding: 0 5%;
}

section {
    padding: 4rem 0;
    text-align: center;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #4a4a4a;
}

/* Estilo para los subtítulos o descripciones de sección */
.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 700px;
    margin: -1.5rem auto 2rem auto; /* Ajusta el espaciado con el título y el contenido */
}

/* --- Efecto Fade-in --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(.77,0,.18,1), transform 0.7s cubic-bezier(.77,0,.18,1);
}

.fade-in-section.is-visible .fade-in-item {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-section.is-visible .delay-1 { transition-delay: 0.1s; }
.fade-in-section.is-visible .delay-2 { transition-delay: 0.3s; }
.fade-in-section.is-visible .delay-3 { transition-delay: 0.5s; }
.fade-in-section.is-visible .delay-4 { transition-delay: 0.7s; }


/* --- Sección Quiénes Somos / Video --- */
.video-container {
    margin: 0 auto;
    max-width: 800px;
}

/* Estilos para el video de la sección "Quiénes Somos" */
.video-container video {
    width: 100%;
    border-radius: 8px;
}

.servicios-container {
    display: flex;
    flex-direction: column; /* Apilado en móviles por defecto */
    align-items: center; /* Centra las tarjetas en la vista de columna */
    gap: 2rem;
    justify-content: center;
}

.servicio-card {
    background: #fff; /* Fondo blanco para la tarjeta */
    border-radius: 16px; /* Bordes redondeados en lugar de circular */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Sombra sutil y moderna */
    text-align: center; /* Centra el texto */
    opacity: 0;
    transform: translateY(30px);
    transition: 
        opacity 0.6s ease-out, 
        transform 0.6s ease-out, 
        box-shadow 0.3s ease,
        border 0.3s ease,
        filter 0.3s ease,
        background 0.3s ease;
    border: 2px solid transparent;
    width: 280px; /* Ancho ajustado */
    height: 280px; /* Alto ajustado */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem; /* Espacio interno para que el texto no toque los bordes */
}

.fade-in-section.is-visible .servicio-card {
    /* Estado final: visible y en su posición original */
    opacity: 1;
    transform: translateY(0);
}

/* Retraso escalonado para cada tarjeta, creando el efecto de cascada */
.fade-in-section.is-visible .servicio-card:nth-child(2) { transition-delay: 0.1s; }
.fade-in-section.is-visible .servicio-card:nth-child(3) { transition-delay: 0.2s; }
.fade-in-section.is-visible .servicio-card:nth-child(4) { transition-delay: 0.3s; }
.fade-in-section.is-visible .servicio-card:nth-child(5) { transition-delay: 0.4s; }
.fade-in-section.is-visible .servicio-card:nth-child(6) { transition-delay: 0.5s; }

.servicio-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2rem;
    word-break: break-word;
}

.servicio-card p {
    font-size: 1rem;
    margin: 0.5rem 0 0 0;
    word-break: break-word;
}

.servicio-card:hover {
    transform: translateY(-5px); /* Levanta la tarjeta al pasar el mouse */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); /* Sombra más pronunciada en hover */
    border-color: #e9a5c9; /* Mantenemos el borde rosa del diseño original */
}

/* Botón de video en las tarjetas de servicio */
.servicio-card .video-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe4ec 60%, #f8b4e9 100%);
    border: 2px solid #e9a5c9;
    color: #c05fa5;
    font-size: 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(233, 165, 201, 0.18);
    cursor: pointer;
    margin-top: 1rem;
    transition: 
        background 0.3s,
        box-shadow 0.3s,
        transform 0.2s,
        color 0.3s;
}

.servicio-card .video-btn:hover {
    background: linear-gradient(135deg, #f8b4e9 60%, #ffe4ec 100%);
    box-shadow: 0 8px 24px rgba(233, 165, 201, 0.32), 0 0 12px #f8b4e9;
    color: #fff;
    transform: scale(1.12);
}

/* --- Sección Galería --- */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.galeria-item {
    overflow: hidden;
    border-radius: 8px;
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.galeria-item img:hover {
    transform: scale(1.05);
}

/* --- Lightbox (Modal para Galería y Video) --- */
.lightbox {
    display: none; /* Oculto por defecto, controlado por JS */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    /* Usamos flex para centrar el contenido vertical y horizontalmente */
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
}

/* Contenedor específico para el video en el modal */
.video-modal-content {
    background: none;
    max-width: 900px;
    width: 100%;
    /* Evita que el video ocupe espacio si no está cargado */
    line-height: 0;
}

/* Video dentro del modal */
#modal-video {
    width: 100%;
}

.lightbox-close, .video-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus,
.video-modal-close:hover,
.video-modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    -webkit-user-select: none; /* Prefijo para compatibilidad */
    user-select: none; /* Versión estándar */
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* --- Sección Preguntas Frecuentes (FAQ) --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 0;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.faq-question:hover {
    color: #c5a47e;
}

.faq-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Evita que el ícono se encoja */
    margin-left: 1rem;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 300px; /* Un valor suficientemente grande para que quepa cualquier respuesta */
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* --- Sección Contacto --- */
.contacto-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: left;
    align-items: center;
}

.contacto-info {
    flex: 1;
    min-width: 300px;
}

.contacto-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: #333;
    font-size: 1.1rem;
}

.contacto-item svg {
    margin-right: 1rem;
    color: #c5a47e;
}

.mapa-container {
    flex: 1.5;
    min-width: 300px;
    height: 400px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(233, 165, 201, 0.18);
    background: rgba(255,240,245,0.5);
    -webkit-backdrop-filter: blur(6px); /* Prefijo para compatibilidad con Safari */
    backdrop-filter: blur(6px);
    transition: box-shadow 0.3s, transform 0.3s;
    position: relative;
}

.mapa-container:hover {
    box-shadow: 0 16px 48px rgba(233, 165, 201, 0.32), 0 0 24px #f8b4e9;
    transform: scale(1.03);
}

.mapa-container iframe {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    border: none;
    transition: filter 0.3s;
    filter: brightness(1.05) saturate(1.08);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 5%;
    background-color: #f8f9fa;
    margin-top: 2rem;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
}

/* --- Sección Nuestro Espacio --- */
#nuestro-espacio {
    padding: 4rem 0;
    text-align: center;
}

#nuestro-espacio h2 {
    font-size: 3rem;
    color: #c05fa5;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 4px 24px #f8b4e955, 0 1px 0 #fff;
}

#nuestro-espacio .section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

.video-container {
    margin: 0 auto;
    max-width: 800px;
}

.video-container video {
    width: 100%;
    border-radius: 8px;
    filter: brightness(1.05) saturate(1.08);
    box-shadow: 0 4px 16px rgba(233, 165, 201, 0.18);
    transition: transform 0.4s ease;
}

.video-container video:hover {
    transform: scale(1.02);
}

.espacio-flex {
    display: flex;
    gap: 3rem;
    align-items: center;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.espacio-descripcion {
    flex: 1;
    min-width: 260px;
    max-width: 400px;
    background: rgba(255,240,245,0.7);
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(233, 165, 201, 0.10);
    padding: 2rem;
    text-align: left;
    font-size: 1.1rem;
    color: #4a4a4a;
    -webkit-backdrop-filter: blur(4px); /* Prefijo para compatibilidad con Safari */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.video-container {
    flex: 2;
    min-width: 300px;
    max-width: 600px;
    background: rgba(255,240,245,0.6);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(233, 165, 201, 0.18);    
    -webkit-backdrop-filter: blur(6px); /* Prefijo para compatibilidad con Safari */
    backdrop-filter: blur(6px);
    padding: 2rem;
    position: relative;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(233, 165, 201, 0.12);
}

/* --- Estilos Responsivos (Mobile-First) --- */

/* Estilos para móvil y tablet (hasta 900px) */
@media (max-width: 899px) {
    /* --- Menú de Navegación para Móvil --- */
    .hamburger {
        display: block; /* Muestra el botón hamburguesa */
        position: relative; /* Cambiado de absolute para que no se superponga */
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 75vw; /* Ancho del panel */
        max-width: 320px;
        background: rgba(255,240,245,0.97);
        box-shadow: -4px 0 24px rgba(233,165,201,0.12);
        -webkit-backdrop-filter: blur(12px); /* Prefijo para compatibilidad con Safari */
        backdrop-filter: blur(12px); /* Versión estándar */

        transform: translateX(100%); /* Oculto por defecto */
        transition: transform 0.35s cubic-bezier(.77,0,.18,1);

        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 5rem;
        z-index: 999;
        margin: 0; /* Resetea el margen */
    }

    .nav-links.active {
        transform: translateX(0); /* Solo se muestra cuando tiene 'active' */
    }

    .nav-links a {
        margin: 1rem 2rem;
        font-size: 1.2rem;
        width: calc(100% - 4rem); /* Ocupa el ancho del panel menos el padding */
        text-align: left;
    }

    /* --- Layouts de Secciones para Móvil --- */
    .contacto-container,
    .espacio-flex {
        flex-direction: column;
        gap: 2rem;
    }

    .espacio-descripcion,
    .video-container {
        max-width: 100%;
        width: 100%;
        padding: 1.2rem;
    }

    /* Ajustes de tamaño de tarjetas de servicio */
    .servicio-card {
        width: 85vw;
        height: 85vw;
        max-width: 280px;
        max-height: 280px;
        padding: 1rem;
    }
}

/* Estilos para Tablet (opcional, para ajustes intermedios) */
@media (min-width: 768px) {
    .servicios-container {
        flex-direction: row; /* Pone las tarjetas en fila */
        flex-wrap: wrap;     /* Permite que se ajusten a la siguiente línea */
    }
}

/* Estilos para Desktop (desde 900px en adelante) */
@media (min-width: 900px) {
    .hamburger {
        display: none; /* Oculta el botón hamburguesa en desktop */
    }

    .nav-links {
        position: static;
        display: flex;
        flex-direction: row;
        height: auto;
        width: auto;
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        transform: none;
        padding-top: 0;
    }
}