/*
|--------------------------------------------------------------------------
| BUYSELL GH — GLOBAL FLOATING HEADER + SEARCH V1.0
|--------------------------------------------------------------------------
|
| Public marketplace architecture:
|
| Header:
|     1360px max
|     sticky top = 12px
|
| Search:
|     1160px max
|     sticky directly under header
|
| Minimum readable type:
|     12px
|
*/


:root{

    --am-global-master:
        1360px;

    --am-global-search-width:
        1160px;

    --am-global-side:
        28px;

    --am-global-header-top:
        12px;

    --am-global-header-height:
        72px;

    --am-global-stack-gap:
        8px;

}


/* ========================================================= */
/* HEADER — GLOBAL FLOATING STICKY                            */
/* ========================================================= */


.am-header{

    position:
        sticky
        !important;

    position:
        -webkit-sticky
        !important;


    top:
        var(--am-global-header-top)
        !important;


    left:
        auto
        !important;

    right:
        auto
        !important;


    z-index:
        1400
        !important;


    width:
        min(
            var(--am-global-master),
            calc(
                100% - 56px
            )
        )
        !important;


    max-width:
        var(--am-global-master)
        !important;


    margin:
        12px auto 0
        !important;


    border:
        1px solid
        rgba(
            220,
            222,
            226,
            .92
        )
        !important;


    border-radius:
        17px
        !important;


    background:
        rgba(
            255,
            255,
            255,
            .95
        )
        !important;


    box-shadow:

        0 12px 35px
        rgba(
            16,
            27,
            43,
            .10
        ),

        0 2px 8px
        rgba(
            16,
            27,
            43,
            .035
        )
        !important;


    backdrop-filter:
        blur(18px)
        saturate(1.15)
        !important;


    -webkit-backdrop-filter:
        blur(18px)
        saturate(1.15)
        !important;

}


/*
|--------------------------------------------------------------------------
| Force predictable height so the search can stick immediately below it.
|--------------------------------------------------------------------------
*/


.am-header
.am-header-inner{

    min-height:
        var(--am-global-header-height)
        !important;

}


/* ========================================================= */
/* GLOBAL SEARCH SHELL                                        */
/* ========================================================= */


.am-global-sticky-search{

    position:
        sticky;

    position:
        -webkit-sticky;


    top:
        calc(
            var(--am-global-header-top)
            +
            var(--am-global-header-height)
            +
            var(--am-global-stack-gap)
        );


    z-index:
        1350;


    width:
        100%;


    margin-top:
        var(--am-global-stack-gap);


    pointer-events:
        none;

}


/*
|--------------------------------------------------------------------------
| Inner search remains interactive while transparent shell spans page.
|--------------------------------------------------------------------------
*/


.am-global-search-wrap{

    width:
        min(
            var(--am-global-search-width),
            calc(
                100% - 110px
            )
        );


    max-width:
        var(--am-global-search-width);


    margin:
        0 auto;


    pointer-events:
        auto;

}


/* ========================================================= */
/* SEARCH BAR                                                 */
/* ========================================================= */


.am-global-search-form{

    min-height:
        64px;


    padding:
        7px;


    display:
        grid;


    grid-template-columns:
        minmax(
            0,
            1.45fr
        )
        minmax(
            220px,
            .65fr
        )
        150px;


    align-items:
        center;


    border:
        1px solid
        rgba(
            222,
            221,
            217,
            .96
        );


    border-radius:
        19px;


    background:
        rgba(
            255,
            255,
            255,
            .97
        );


    box-shadow:

        0 16px 38px
        rgba(
            22,
            28,
            38,
            .12
        ),

        0 3px 9px
        rgba(
            22,
            28,
            38,
            .04
        );


    backdrop-filter:
        blur(18px);


    -webkit-backdrop-filter:
        blur(18px);

}


/* ========================================================= */
/* FIELDS                                                     */
/* ========================================================= */


.am-global-search-keyword,
.am-global-search-location{

    min-width:
        0;


    height:
        50px;


    padding:
        0 19px;


    display:
        flex;


    align-items:
        center;


    gap:
        12px;

}


.am-global-search-keyword{

    border-right:
        1px solid
        #e5e4e1;

}


.am-global-search-icon,
.am-global-location-icon{

    width:
        21px;


    height:
        21px;


    flex:
        0 0 auto;


    display:
        inline-grid;


    place-items:
        center;


    color:
        #122039;

}


.am-global-location-icon{

    width:
        18px;


    height:
        18px;


    color:
        #ae7728;

}


.am-global-search-icon svg,
.am-global-location-icon svg,
.am-global-search-submit svg{

    width:
        100%;


    height:
        100%;


    fill:
        none;


    stroke:
        currentColor;


    stroke-width:
        1.8;


    stroke-linecap:
        round;


    stroke-linejoin:
        round;

}


.am-global-search-form input{

    width:
        100%;


    min-width:
        0;


    padding:
        0;


    border:
        0;


    outline:
        0;


    color:
        #111b2e;


    background:
        transparent;


    font-family:
        inherit;


    font-size:
        13px;


    line-height:
        1.4;

}


.am-global-search-form input::placeholder{

    color:
        #8a909a;


    opacity:
        1;

}


/* ========================================================= */
/* SEARCH BUTTON                                              */
/* ========================================================= */


.am-global-search-submit{

    height:
        50px;


    border:
        0;


    border-radius:
        14px;


    display:
        inline-flex;


    align-items:
        center;


    justify-content:
        center;


    gap:
        10px;


    color:
        #ffffff;


    background:

        linear-gradient(
            135deg,
            #d5a34d,
            #a86f20
        );


    box-shadow:
        0 8px 19px
        rgba(
            164,
            108,
            29,
            .23
        );


    font-family:
        inherit;


    font-size:
        13px;


    font-weight:
        750;


    cursor:
        pointer;


    transition:
        transform .18s ease,
        box-shadow .18s ease;

}


.am-global-search-submit:hover{

    transform:
        translateY(-1px);


    box-shadow:
        0 11px 24px
        rgba(
            164,
            108,
            29,
            .28
        );

}


.am-global-search-submit span{

    width:
        19px;


    height:
        19px;


    display:
        inline-grid;


    place-items:
        center;

}


/* ========================================================= */
/* HOMEPAGE — REMOVE OLD DUPLICATE SEARCH                     */
/* ========================================================= */


/*
|--------------------------------------------------------------------------
| Homepage used to have its own hero-overlapping search.
|
| The search is now global directly under the main navigation.
| Keep the category dock but remove duplicate form.
|--------------------------------------------------------------------------
*/


.am-marketly-home
.am4-search-dock{

    display:
        none
        !important;

}


.am-marketly-home
.am4-discovery{

    margin-top:
        -4px
        !important;

}


.am-marketly-home
.am4-category-dock{

    margin-top:
        0
        !important;


    padding-top:
        24px
        !important;


    border-radius:
        22px
        !important;

}


/* ========================================================= */
/* HEADER + SEARCH VISUAL COHESION                            */
/* ========================================================= */


.am-header,
.am-global-search-form{

    transition:

        box-shadow .22s ease,
        background .22s ease,
        border-color .22s ease;

}


/*
|--------------------------------------------------------------------------
| Search should visually feel attached to header without physically touching.
|--------------------------------------------------------------------------
*/


.am-global-sticky-search:before{

    content:
        "";


    position:
        absolute;


    top:
        -9px;


    left:
        50%;


    width:
        min(
            1080px,
            calc(
                100% - 160px
            )
        );


    height:
        12px;


    transform:
        translateX(-50%);


    background:
        linear-gradient(
            180deg,
            rgba(
                255,
                255,
                255,
                .20
            ),
            transparent
        );


    pointer-events:
        none;

}


/* ========================================================= */
/* 12PX MINIMUM READABLE TYPE                                 */
/* ========================================================= */


.am-global-sticky-search small,
.am-global-sticky-search label,
.am-global-sticky-search input,
.am-global-sticky-search button{

    font-size:
        12px;

}


/* ========================================================= */
/* LAPTOP                                                     */
/* ========================================================= */


@media(max-width:1400px){

    .am-header{

        width:
            calc(
                100% - 40px
            )
            !important;

    }


    .am-global-search-wrap{

        width:
            min(
                var(--am-global-search-width),
                calc(
                    100% - 80px
                )
            );

    }

}


/* ========================================================= */
/* TABLET                                                     */
/* ========================================================= */


@media(max-width:900px){

    :root{

        --am-global-header-top:
            8px;

        --am-global-header-height:
            66px;

        --am-global-stack-gap:
            7px;

    }


    .am-header{

        width:
            calc(
                100% - 24px
            )
            !important;


        margin-top:
            8px
            !important;


        border-radius:
            14px
            !important;

    }


    .am-global-search-wrap{

        width:
            calc(
                100% - 28px
            );

    }


    .am-global-search-form{

        grid-template-columns:
            minmax(
                0,
                1fr
            )
            minmax(
                180px,
                .48fr
            )
            120px;


        min-height:
            60px;


        border-radius:
            17px;

    }


    .am-global-search-keyword,
    .am-global-search-location{

        height:
            46px;


        padding:
            0 13px;

    }


    .am-global-search-submit{

        height:
            46px;


        font-size:
            12px;

    }

}


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


@media(max-width:640px){

    :root{

        --am-global-header-top:
            6px;

        --am-global-header-height:
            62px;

        --am-global-stack-gap:
            6px;

    }


    .am-header{

        width:
            calc(
                100% - 16px
            )
            !important;


        margin-top:
            6px
            !important;


        border-radius:
            13px
            !important;

    }


    .am-global-search-wrap{

        width:
            calc(
                100% - 16px
            );

    }


    .am-global-search-form{

        min-height:
            54px;


        padding:
            5px;


        grid-template-columns:
            minmax(
                0,
                1fr
            )
            48px;


        border-radius:
            15px;

    }


    /*
    |--------------------------------------------------------------------------
    | Mobile: keyword + compact submit.
    | Location remains available on search/filter page.
    |--------------------------------------------------------------------------
    */


    .am-global-search-location{

        display:
            none;

    }


    .am-global-search-keyword{

        height:
            44px;


        padding:
            0 11px;


        border-right:
            0;

    }


    .am-global-search-form input{

        font-size:
            12px;

    }


    .am-global-search-submit{

        width:
            44px;


        height:
            44px;


        padding:
            0;


        border-radius:
            12px;


        font-size:
            0;

    }


    .am-global-search-submit span{

        width:
            20px;


        height:
            20px;

    }


    /*
    |--------------------------------------------------------------------------
    | Sticky stack is now compact enough for phone screens.
    |--------------------------------------------------------------------------
    */


    .am-marketly-home
    .am4-category-dock{

        margin-top:
            8px
            !important;

    }

}
