/* ============================================================
   Shared mobile UI — matches the homepage mobile experience.
   Loaded after each page's own <style> so these rules win.
   ============================================================ */

/* Logo variants are hidden until the breakpoint that needs them */
.logo img.logo-mobile-icon,
.logo-mobile-text {
    display: none;
}

/* Back-to-top button (injected by mobile-ui.js) */
.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1.5rem;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--primary, #0070f3);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 112, 243, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
    z-index: 1100;
}
.back-to-top:hover { background: var(--primary-dark, #0059c7); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top.visible:hover { transform: translateY(-2px); }

@media (max-width: 767px) {
    /* Solid header (no blur) keeps scrolling smooth */
    .header {
        background: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .header-container {
        position: relative;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }

    /* Centered logo: icon mark + navy wordmark */
    .logo {
        display: inline-flex;
        align-items: center;
        margin: 0 !important;
        order: 2;
        gap: 0.5rem;
    }
    .logo img.logo-desktop { display: none !important; }
    .logo img.logo-mobile-icon {
        display: block !important;
        height: 38px !important;
        width: auto !important;
        filter: none !important;
    }
    .header.scrolled .logo img.logo-mobile-icon { height: 38px !important; }
    .logo-mobile-text {
        display: inline-block !important;
        font-family: 'Montserrat', sans-serif;
        font-weight: 700;
        font-size: 1.12rem;
        letter-spacing: -0.01em;
        color: #0B1220;
        white-space: nowrap;
    }

    /* Hamburger button (injected if the page lacks one) */
    .nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        order: 1;
        background: none;
        border: none;
        font-size: 1.7rem;
        line-height: 1;
        color: #0b1220;
        cursor: pointer;
        padding: 0;
        width: 40px;
        height: 40px;
    }

    /* Tap-to-call button on the right */
    .mobile-call-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        order: 3;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--primary, #0070f3);
        color: #fff;
        flex-shrink: 0;
        margin-left: 0 !important;
    }
    .mobile-call-btn svg {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        stroke-width: 2.2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Nav becomes a dropdown panel */
    .header-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0;
        right: 0;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        background: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        padding: 0.25rem 1.1rem 1.1rem !important;
        box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
        border-top: 1px solid rgba(15, 23, 42, 0.06);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    }
    .header.nav-open .header-menu {
        max-height: 80vh;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        width: 100%;
    }
    .nav-links a {
        font-size: 1rem !important;
        font-weight: 600;
        padding: 0.9rem 0.25rem !important;
        width: 100%;
        color: #0b1220;
        border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    }
    .nav-links a::after { display: none !important; }

    .header-actions {
        display: flex !important;
        width: 100%;
        margin-top: 0.9rem;
    }
    .header-actions .header-phone { display: none !important; }
    .header .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Tighter vertical rhythm */
    section { padding: 2.5rem 1rem; }
}
