/* =========================================================
   GENIUS MOVIES
   MOBILE SAFE NO-GAP V4

   - Original header appearance untouched
   - No fake header spacer
   - No extra top whitespace
   - Bottom navigation fixed globally
   ========================================================= */

:root{
    --gm-global-bottom-safe:0px;
}


/* =========================================================
   KILL ALL OLD SPACERS
   ========================================================= */

.gm-mobile-header-spacer{

    display:none !important;

    width:0 !important;

    height:0 !important;

    min-height:0 !important;

    max-height:0 !important;

    margin:0 !important;

    padding:0 !important;

    border:0 !important;

    overflow:hidden !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media(max-width:760px){

    /*
     * Header keeps the site's original
     * brand/search design.
     */

    .gm-fixed-site-header{

        position:fixed !important;

        top:0 !important;

        left:0 !important;

        right:0 !important;

        width:100% !important;

        margin:0 !important;

        transform:none !important;

        z-index:2147483000 !important;
    }


    /*
     * No artificial top padding.
     * JS aligns actual content directly
     * below the real header.
     */

    body.gm-no-gap-layout{

        padding-top:0 !important;

        padding-bottom:
            var(--gm-global-bottom-safe) !important;
    }


    /* =====================================================
       GLOBAL BOTTOM NAVIGATION
       ===================================================== */

    body.gm-no-gap-layout
    .gm-main-nav.gm-global-mobile-nav{

        position:fixed !important;

        top:auto !important;

        bottom:
            calc(
                10px
                +
                env(safe-area-inset-bottom)
            )
            !important;

        left:10px !important;

        right:10px !important;

        width:auto !important;

        max-width:
            calc(
                100vw - 20px
            )
            !important;

        margin:0 !important;

        transform:none !important;

        box-sizing:border-box !important;

        overflow-x:auto !important;

        overflow-y:hidden !important;

        white-space:nowrap !important;

        -webkit-overflow-scrolling:touch;

        overscroll-behavior-x:contain;

        scrollbar-width:none;

        z-index:2147482500 !important;
    }


    body.gm-no-gap-layout
    .gm-main-nav.gm-global-mobile-nav::-webkit-scrollbar{

        display:none !important;
    }


    body.gm-no-gap-layout
    .gm-global-mobile-nav
    .gm-nav-link,

    body.gm-no-gap-layout
    .gm-global-mobile-nav
    .gm-movies-nav{

        flex:0 0 auto !important;

        white-space:nowrap !important;
    }


    /*
     * Anchor navigation safety.
     */

    body.gm-no-gap-layout
    :where(
        h1,
        h2,
        h3,
        section,
        [id]
    ){

        scroll-margin-top:8px;
    }

}


/* =========================================================
   DESKTOP
   NO EXTRA HEADER SPACE
   ========================================================= */

@media(min-width:761px){

    .gm-mobile-header-spacer{

        display:none !important;

        height:0 !important;

        min-height:0 !important;

        max-height:0 !important;
    }

}
