:root {
    --brand-brown: #5D3A29;
    --brand-terra: #8B4513;
    --brand-beige: #F5F0E6;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --color-light: #ffffff;
}

html { 
    scroll-behavior: smooth; 
    scroll-padding-top: 90px; 
}

body { 
    font-family: 'Lato', sans-serif; 
    background-color: var(--brand-beige); 
    -webkit-font-smoothing: antialiased; 
}

.font-serif { font-family: 'Playfair Display', serif; }

/* --- HERO VIDEO BACKGROUND --- */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(93, 58, 41, 0.8));
    z-index: 1;
}

/* --- CLASES DE UTILIDAD --- */
.text-brand-brown { color: var(--brand-brown); }
.text-brand-terra { color: var(--brand-terra); }
.bg-brand-brown { background-color: var(--brand-brown); }
.bg-brand-terra { background-color: var(--brand-terra); }
.bg-brand-beige { background-color: var(--brand-beige); }

/* --- ANIMACIONES --- */
@keyframes parpadeo {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-blink {
    animation: parpadeo 2s infinite ease-in-out;
}

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.animate-bounce-slow {
    animation: bounce-slow 3s infinite ease-in-out;
}

.section-padding { padding: 80px 0; }
.overflow-hidden { overflow: hidden; }

/* --- MARQUESINA DE GALERÍA (BASE / DESKTOP) --- */
.gallery-marquee {
    width: 100%; 
    padding: 40px 0; 
    background: transparent;
    /* Efecto desvanecido en los bordes (solo PC) */
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    /* En PC ocultamos el scroll bar */
    overflow: hidden; 
}

.marquee-track {
    display: flex; 
    width: max-content; 
    gap: 20px;
    animation: scroll-left 50s linear infinite; 
    will-change: transform;
    
    /* Empieza Pausada por defecto hasta que JS la activa */
    animation-play-state: paused; 
}

/* JS agrega esta clase al hacer scroll */
.marquee-track.active {
    animation-play-state: running;
}

/* Pausar con hover SOLO en PC */
@media (hover: hover) {
    .marquee-track:hover { animation-play-state: paused; }
}

/* JS usa esto para pausar temporalmente en touch si fuera necesario */
.marquee-track.is-paused {
    animation-play-state: paused !important;
}

.gallery-item {
    width: 280px; 
    height: 280px; 
    flex-shrink: 0; 
    border-radius: 16px; 
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 4px solid #fff;
    transform: translateZ(0); 
    cursor: zoom-in; 
}

@media (min-width: 769px) {
    .gallery-item { width: 320px; height: 320px; }
}

.gallery-item img {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease;
}

/* Efecto hover en imagen solo PC */
@media (hover: hover) {
    .gallery-item:hover img { 
        transform: scale(1.1); 
        filter: brightness(1.05); 
    }
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- LIGHTBOX (MODAL FOTOS) --- */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none; 
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox img {
    max-width: 95vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border: 2px solid #fff;
    transform: scale(0.9);
    transition: transform 0.3s;
    object-fit: contain;
}

#lightbox.active img {
    transform: scale(1);
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    font-family: sans-serif;
    line-height: 1;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones de navegación del Lightbox */
.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 3rem;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    user-select: none;
    z-index: 10001;
    transition: background 0.3s;
}

.lb-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lb-prev { left: 10px; }
.lb-next { right: 10px; }

/* En móvil las hacemos un poco más chicas */
@media (max-width: 768px) {
    .lb-nav {
        font-size: 2rem;
        padding: 15px;
        background: rgba(0, 0, 0, 0.1);
    }
}

/* --- MODO MÓVIL: CONFIGURACIÓN MIXTA --- */
@media (max-width: 768px) {
    
    /* 1. REGLA GENERAL (Para la Cabaña): Manual / Swipe */
    .gallery-marquee {
        display: flex;
        overflow-x: scroll !important;
        overflow-y: hidden;
        width: 100%;
        -webkit-overflow-scrolling: touch; 
        touch-action: pan-x;
        mask-image: none !important;
        -webkit-mask-image: none !important;
        padding-bottom: 20px;
        scrollbar-width: none;
    }
    
    .gallery-marquee::-webkit-scrollbar { display: none; }

    .marquee-track, 
    .marquee-track.active,
    .marquee-track.is-paused {
        animation: none !important;
        transform: none !important;
        display: flex !important;
        width: max-content !important;
        gap: 15px;
        padding: 0 15px;
    }

    .gallery-item {
        width: 80vw;
        height: 60vw;
        flex-shrink: 0;
        position: relative;
    }

    /* Ajuste de imagen para permitir swipe + click */
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        pointer-events: auto;        /* Permite click para lightbox */
        user-select: none;
        -webkit-user-drag: none;     /* Evita arrastrar el archivo imagen */
    }

    /* 2. EXCEPCIÓN (Para Postales): Automática */
    .gallery-marquee.auto-scroll {
        overflow-x: hidden !important; 
        mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%) !important;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%) !important;
    }

    .gallery-marquee.auto-scroll .marquee-track {
        animation: scroll-left 40s linear infinite !important; 
        gap: 15px;
        transform: none; 
        touch-action: auto;
    }

    .gallery-marquee.auto-scroll .gallery-item {
        width: 180px; 
        height: 180px;
    }
}