/* ============================================
   Mobile Header Transformation - DYNAMIC LOGIC
   1. TOP: Large Logo + Lang Switcher (No Menu)
   2. SCROLLED: The Pills + Lang Switcher (No Logo)
   ============================================ */

@media (max-width: 768px) {

    /* 1. TOP STATE (Landing) */
    .header {
        background: #fff !important;
        padding: 10px 0 !important;
        transition: padding 0.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.5s ease, box-shadow 0.5s ease;
    }

    .nav-container {
        position: relative !important;
        /* Context for absolute lang switcher */
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 15px !important;
    }

    /* Logo is Large and Legible */
    .logo {
        display: flex !important;
        align-items: center;
        gap: 8px;
        transition: opacity 0.3s ease, transform 0.3s ease;
        opacity: 1;
        transform: translateY(0);
    }

    .logo-icon {
        width: 48px !important;
        height: 48px !important;
        transition: all 0.3s ease;
    }

    .logo-name {
        font-size: 1.65rem !important;
        font-weight: 800 !important;
        display: block !important;
    }

    .logo-subtitle {
        display: block !important;
        font-size: 1.0rem !important;
        opacity: 0.9;
    }

    .lang-switcher {
        display: flex !important;
        margin-top: -6px !important;
        transition: all 0.3s ease;
    }

    .lang-btn {
        padding: 7px 11px !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
        background: var(--secondary-gray) !important;
        border: 1px solid transparent;
        transition: all 0.3s ease;
    }

    /* HIDE MENU ON LANDING */
    .nav-menu {
        display: none !important;
        opacity: 0;
    }

    /* 2. SCROLLED STATE (Leaving Landing) */
    .header.scrolled-mobile {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        /* INCREASED SIZE 1.3x (from 6px to 10px padding top/bottom) */
        padding: 10px 0 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(12px);
    }

    /* Hide Large Logo smoothly */
    .header.scrolled-mobile .logo {
        display: none !important;
        /* Display toggle is needed to free space, sadly hard to animate purely */
    }

    .header.scrolled-mobile .logo-subtitle {
        display: none !important;
    }

    /* SHOW THE PILLS */
    .header.scrolled-mobile .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        width: auto !important;
        /* Allow sharing space with lang */
        flex: 1;
        gap: 4px !important;
        padding: 0 4px !important;
        animation: fadeInSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* Pill Styles */
    .header.scrolled-mobile .nav-link,
    .header.scrolled-mobile .nav-btn {
        /* BIGGER BUTTONS (1.3x feel) */
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        border-radius: 50px !important;
        background-color: var(--secondary-gray) !important;
        color: var(--text-dark) !important;
        white-space: nowrap !important;
        border: 1px solid rgba(45, 94, 63, 0.1) !important;
        line-height: 1 !important;
        text-align: center;
        flex: 1;
        max-width: fit-content;
    }

    /* LANG SWITCHER IN SCROLLED MODE - FLEX POSITIONING */
    .header.scrolled-mobile .lang-switcher {
        display: flex !important;
        position: static !important;
        /* In flow */
        margin-left: 8px !important;
        /* Small gap from booking btn */
        margin-top: 0 !important;
        transform: none !important;
        animation: fadeIn 0.5s ease forwards;
        z-index: 1002;
    }

    .header.scrolled-mobile .lang-btn {
        /* Very subtle style */
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        background-color: transparent !important;
        color: var(--text-gray) !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        border-radius: 6px !important;
        opacity: 0.7;
    }

    /* ANIMATION KEYFRAMES */
    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* Active Highlight */
    .header.scrolled-mobile .nav-link.active {
        background-color: var(--primary-green) !important;
        color: white !important;
        box-shadow: 0 2px 8px rgba(45, 94, 63, 0.25);
    }

    .header.scrolled-mobile .nav-btn.open-booking {
        background-color: var(--primary-green-dark) !important;
        color: white !important;
    }
}

/* ANIMATION KEYFRAMES */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide helper booking btn from previous attempts */
.header-booking-btn {
    display: none !important;
}