/* ==========================================================================
   PAALAL IXCHEL — Preview Page Styles
   Archivo externo que consolida todo el CSS inline de preview.html / preview-en.html
   ========================================================================== */

/* --- Base --- */
html {
    scroll-behavior: smooth;
}

/* --- Hero Overlay --- */
.video-bg-overlay {
    background: linear-gradient(to bottom, rgba(81, 164, 174, 0.3), rgba(24, 37, 44, 0.6));
}

/* --- Glass Card (Glassmorphism) --- */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(81, 164, 174, 0.25);
}

/* --- Logo SVG Filters --- */
.logo-filter-sand {
    filter: brightness(0) saturate(100%) invert(98%) sepia(2%) saturate(1210%) hue-rotate(314deg) brightness(105%) contrast(100%) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}
.logo-filter-blue {
    filter: invert(31%) sepia(96%) saturate(1115%) hue-rotate(158deg) brightness(91%) contrast(93%);
}

/* --- Flag Icons (Language Switcher) --- */
.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* --- Hide Scrollbar Utility --- */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Modal Scale-In Animation --- */
@keyframes scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.animate-scale-in {
    animation: scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Hamburger Button Reset (Tailwind Forms plugin override) --- */
#hamburgerBtn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    -webkit-appearance: none;
    appearance: none;
}
#hamburgerBtn:focus,
#hamburgerBtn:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* --- Hamburger Menu Animation (X toggle) --- */
.hamburger-active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.hamburger-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   MOBILE MENU — Staged Animation
   Sequence: 1) Background fades in  →  2) Content slides up + fades in
   On close: Content fades out first → Background fades out → visibility hidden
   ========================================================================== */

/* Base state: hidden (visibility delays 0.5s on CLOSE to let fade-out finish) */
#mobileMenu {
    visibility: hidden;
    transition: visibility 0s linear 0.5s;
}

/* Background overlay — fades in/out over 350ms */
#mobileMenu > div:first-child {
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content container — slides + fades, NO delay on CLOSE (exits immediately) */
#mobileMenu > div:last-child {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0s,
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0s;
}

/* --- OPEN state --- */
.mobile-menu-open {
    pointer-events: auto !important;
    visibility: visible !important;
    transition: visibility 0s linear 0s !important; /* instant show */
}

/* Background fades in immediately */
.mobile-menu-open > div:first-child {
    opacity: 1 !important;
}

/* Content fades in + slides up WITH 180ms DELAY (background appears first) */
.mobile-menu-open > div:last-child {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.18s,
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.18s !important;
}

/* --- Body Scroll Lock --- */
body.menu-open {
    overflow: hidden;
}
