/*
|--------------------------------------------------------------------------
| BUYSELL GH — GLOBAL MARKETLY SHELL + TYPOGRAPHY V1.0
|--------------------------------------------------------------------------
| Global public-marketplace visual authority.
|
| Typography:
|   UI      : Inter
|   Display : DM Serif Display
|
| Rules:
|   - 12px minimum readable text
|   - shared 1360px floating/sticky marketplace header
|   - shared sticky search visual system
|   - no page-specific font families for future public pages
|--------------------------------------------------------------------------
*/

:root{
    --bsg-font-ui:
        "Inter",
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --bsg-font-display:
        "DM Serif Display",
        Georgia,
        "Times New Roman",
        serif;

    --bsg-shell-master:1360px;
    --bsg-shell-gutter:28px;
    --bsg-shell-header-top:12px;
    --bsg-shell-header-height:64px;
    --bsg-shell-gap:8px;
    --bsg-shell-search-width:1160px;

    --bsg-type-xs:12px;
    --bsg-type-sm:13px;
    --bsg-type-md:14px;
    --bsg-type-lg:16px;
    --bsg-type-xl:18px;
    --bsg-type-2xl:22px;
    --bsg-type-3xl:32px;

    --bsg-ink:#101828;
    --bsg-muted:#667085;
    --bsg-line:#e4e7ec;
    --bsg-navy:#0b1729;
    --bsg-gold:#c89232;
    --bsg-gold-dark:#a96f1f;
}

/* ========================================================= */
/* GLOBAL TYPOGRAPHY AUTHORITY                                */
/* ========================================================= */

html{
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
}

body,
button,
input,
select,
textarea{
    font-family:var(--bsg-font-ui) !important;
}

body{
    font-size:var(--bsg-type-md);
    line-height:1.5;
    font-weight:400;
    color:var(--bsg-ink);
    text-rendering:optimizeLegibility;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

button,
input,
select,
textarea{
    font-size:var(--bsg-type-sm);
    line-height:1.4;
}

small,
.meta,
.muted,
.badge,
.status,
.am-logo-text small,
.am-footer-copy,
.am-footer-links,
.am-main-nav,
.am-sign-link,
.am-post-button,
.am-global-sticky-search,
.bsg-browse-page{
    font-size:12px;
}

p,
li,
td,
th,
label,
option{
    font-family:var(--bsg-font-ui);
}

h1,
h2,
h3,
h4,
h5,
h6{
    font-family:var(--bsg-font-ui);
    color:inherit;
    font-weight:700;
    letter-spacing:-.02em;
}

.am4-hero h1,
.am4-section-title,
.am4-drive-copy h2,
.am4-app-copy h2,
.am4-popular-heading h2,
.am4-process-heading h2,
.bsg-browse-hero h1,
.bsg-upgrade-card h2,
.bsg-rail-card h2,
.am-display-font{
    font-family:var(--bsg-font-display) !important;
    font-weight:400 !important;
    letter-spacing:-.025em !important;
}

a,
button,
input,
select,
textarea{
    -webkit-tap-highlight-color:transparent;
}

/* Future-proof named type utilities */
.bsg-type-caption{
    font-size:12px !important;
    line-height:1.4 !important;
    font-weight:500 !important;
}

.bsg-type-ui{
    font-size:13px !important;
    line-height:1.4 !important;
    font-weight:600 !important;
}

.bsg-type-body{
    font-size:14px !important;
    line-height:1.55 !important;
    font-weight:400 !important;
}

.bsg-type-card-title{
    font-size:14px !important;
    line-height:1.35 !important;
    font-weight:700 !important;
}

.bsg-type-price{
    font-size:19px !important;
    line-height:1.2 !important;
    font-weight:800 !important;
}

.bsg-type-section-title{
    font-size:32px !important;
    line-height:1.08 !important;
    font-weight:700 !important;
}

.bsg-type-display{
    font-family:var(--bsg-font-display) !important;
    font-size:56px !important;
    line-height:.98 !important;
    font-weight:400 !important;
}

/* Legacy/current classes that previously used sub-12px sizes */
.badge,
.status,
.am-card-badge,
.am4-card-badge,
.am4-card-location,
.am4-card-meta,
.am4-popular-bottom strong,
.am4-popular-bottom small,
.bsg-card-badge,
.bsg-card-location,
.bsg-card-meta,
.bsg-category-row strong,
.bsg-category-row em,
.bsg-check-row,
.bsg-filter-group h3,
.bsg-filter-heading a,
.bsg-trending-pills a{
    font-size:12px !important;
}

/* ========================================================= */
/* SHARED FLOATING MARKETPLACE HEADER                         */
/* ========================================================= */

.am-global-marketplace-shell .am-header{
    position:sticky !important;
    top:var(--bsg-shell-header-top) !important;
    z-index:1500 !important;

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

    max-width:var(--bsg-shell-master) !important;
    min-height:var(--bsg-shell-header-height) !important;

    margin:
        var(--bsg-shell-header-top)
        auto
        0
        !important;

    border:1px solid rgba(222,224,228,.96) !important;
    border-radius:17px !important;

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

    box-shadow:
        0 14px 36px rgba(16,24,40,.10),
        0 2px 8px rgba(16,24,40,.035)
        !important;

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

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

.am-global-marketplace-shell
.am-header
.am-header-inner{
    width:100% !important;
    max-width:none !important;
    min-height:var(--bsg-shell-header-height) !important;

    padding:
        0
        17px
        !important;

    display:flex !important;
    align-items:center !important;
    gap:18px !important;
}

/* Brand */
.am-global-marketplace-shell .am-logo{
    flex:0 0 auto;
    display:flex !important;
    align-items:center !important;
    gap:9px !important;
}

.am-global-marketplace-shell .am-logo-mark{
    width:31px !important;
    height:35px !important;
    flex:0 0 31px !important;
}

.am-global-marketplace-shell .am-logo-text{
    display:grid !important;
    grid-template-columns:auto auto !important;
    align-items:baseline !important;
    column-gap:2px !important;
    line-height:1 !important;
}

.am-global-marketplace-shell
.am-logo-text strong{
    font-family:var(--bsg-font-ui) !important;
    font-size:20px !important;
    font-weight:800 !important;
    letter-spacing:-.04em !important;
    color:#111827 !important;
}

.am-global-marketplace-shell
.am-logo-text b{
    font-family:var(--bsg-font-ui) !important;
    font-size:20px !important;
    font-weight:800 !important;
    letter-spacing:-.04em !important;
}

.am-global-marketplace-shell
.am-logo-text small{
    grid-column:1 / -1 !important;
    margin-top:4px !important;
    color:#7b8492 !important;
    font-size:12px !important;
    font-weight:500 !important;
    letter-spacing:0 !important;
}

/* Main nav */
.am-global-marketplace-shell .am-main-nav{
    min-width:0;
    margin-left:auto !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;
}

.am-global-marketplace-shell
.am-main-nav > a{
    position:relative;
    min-height:42px !important;
    padding:0 10px !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;

    color:#27364a !important;
    font-family:var(--bsg-font-ui) !important;
    font-size:12px !important;
    font-weight:600 !important;
    line-height:1 !important;
    white-space:nowrap !important;

    border-radius:9px !important;
    transition:
        color .16s ease,
        background .16s ease
        !important;
}

.am-global-marketplace-shell
.am-main-nav > a:hover{
    color:#111827 !important;
    background:#f7f7f6 !important;
}

.am-global-marketplace-shell
.am-main-nav > a.is-active{
    color:#1167df !important;
    background:transparent !important;
}

.am-global-marketplace-shell
.am-main-nav > a.is-active::after{
    content:"";
    position:absolute;
    left:10px;
    right:10px;
    bottom:1px;
    height:2px;
    border-radius:99px;
    background:#d29a34;
}

/* Header actions */
.am-global-marketplace-shell .am-header-actions{
    flex:0 0 auto;
    display:flex !important;
    align-items:center !important;
    gap:7px !important;
}

.am-global-marketplace-shell .am-header-icon{
    width:36px !important;
    height:36px !important;
    padding:0 !important;

    display:grid !important;
    place-items:center !important;

    border-radius:50% !important;
    color:#142238 !important;
    font-size:22px !important;
    line-height:1 !important;
}

.am-global-marketplace-shell .am-header-icon:hover{
    background:#f3f4f6 !important;
}

.am-global-marketplace-shell .am-sign-link{
    min-height:38px !important;
    padding:0 8px !important;

    display:inline-flex !important;
    align-items:center !important;

    color:#142238 !important;
    font-size:12px !important;
    font-weight:650 !important;
    white-space:nowrap !important;
}

.am-global-marketplace-shell .am-post-button{
    min-height:43px !important;
    padding:0 16px !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:7px !important;

    border:0 !important;
    border-radius:9px !important;

    background:
        linear-gradient(
            135deg,
            #112139,
            #071526
        )
        !important;

    color:#fff !important;

    box-shadow:
        0 7px 16px rgba(10,23,41,.17)
        !important;

    font-size:12px !important;
    font-weight:700 !important;
    white-space:nowrap !important;
}

.am-global-marketplace-shell
.am-post-button:hover{
    transform:translateY(-1px);
    box-shadow:
        0 10px 20px rgba(10,23,41,.21)
        !important;
}

.am-global-marketplace-shell
.am-mobile-toggle{
    display:none;
}

/* ========================================================= */
/* SHARED FLOATING / STICKY SEARCH                            */
/* ========================================================= */

.am-global-marketplace-shell
.am-global-sticky-search{
    position:sticky !important;

    top:
        calc(
            var(--bsg-shell-header-top)
            +
            var(--bsg-shell-header-height)
            +
            var(--bsg-shell-gap)
        )
        !important;

    z-index:1450 !important;
    width:100% !important;

    margin:
        var(--bsg-shell-gap)
        0
        0
        !important;

    pointer-events:none !important;
}

.am-global-marketplace-shell
.am-global-search-wrap{
    width:min(
        var(--bsg-shell-search-width),
        calc(100% - 120px)
    ) !important;

    max-width:var(--bsg-shell-search-width) !important;
    margin:0 auto !important;
    pointer-events:auto !important;
}

.am-global-marketplace-shell
.am-global-search-form{
    min-height:64px !important;
    padding:7px !important;

    display:grid !important;
    grid-template-columns:
        minmax(0,1.5fr)
        minmax(220px,.62fr)
        150px
        !important;

    align-items:center !important;

    border:1px solid rgba(221,221,218,.98) !important;
    border-radius:18px !important;

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

    box-shadow:
        0 15px 34px rgba(16,24,40,.12),
        0 3px 9px rgba(16,24,40,.04)
        !important;

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

.am-global-marketplace-shell
.am-global-search-keyword,
.am-global-marketplace-shell
.am-global-search-location{
    min-width:0 !important;
    height:50px !important;
    padding:0 18px !important;

    display:flex !important;
    align-items:center !important;
    gap:11px !important;
}

.am-global-marketplace-shell
.am-global-search-keyword{
    border-right:
        1px solid #e4e3df
        !important;
}

.am-global-marketplace-shell
.am-global-search-icon{
    width:21px !important;
    height:21px !important;
    flex:0 0 21px !important;
    color:#172338 !important;
}

.am-global-marketplace-shell
.am-global-location-icon{
    width:18px !important;
    height:18px !important;
    flex:0 0 18px !important;
    color:#b77c26 !important;
}

.am-global-marketplace-shell
.am-global-search-icon svg,
.am-global-marketplace-shell
.am-global-location-icon svg,
.am-global-marketplace-shell
.am-global-search-submit svg{
    width:100% !important;
    height:100% !important;
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:1.8 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
}

.am-global-marketplace-shell
.am-global-search-form input{
    width:100% !important;
    min-width:0 !important;

    padding:0 !important;
    border:0 !important;
    outline:0 !important;

    background:transparent !important;
    color:#142238 !important;

    font-family:var(--bsg-font-ui) !important;
    font-size:13px !important;
    font-weight:400 !important;
    line-height:1.4 !important;
}

.am-global-marketplace-shell
.am-global-search-form input::placeholder{
    color:#8a9099 !important;
    opacity:1 !important;
}

.am-global-marketplace-shell
.am-global-search-submit{
    height:50px !important;
    padding:0 18px !important;

    border:0 !important;
    border-radius:13px !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:9px !important;

    background:
        linear-gradient(
            135deg,
            #d9a443,
            #aa7021
        )
        !important;

    color:#fff !important;

    box-shadow:
        0 8px 18px rgba(169,111,31,.22)
        !important;

    font-family:var(--bsg-font-ui) !important;
    font-size:13px !important;
    font-weight:700 !important;

    cursor:pointer !important;
}

.am-global-marketplace-shell
.am-global-search-submit span{
    width:18px !important;
    height:18px !important;
    display:inline-grid !important;
    place-items:center !important;
}

/* Browse geometry stays reference-friendly while visual styling is global. */
.am-global-marketplace-shell:has(.bsg-browse-page)
.am-global-sticky-search{
    margin-top:14px !important;
    margin-bottom:-82px !important;
}

.am-global-marketplace-shell:has(.bsg-browse-page)
.am-global-search-wrap{
    width:min(850px,calc(100% - 300px)) !important;
    max-width:850px !important;
}

/* Homepage uses the wider approved global dock. */
.am-global-marketplace-shell.am-marketly-home
.am-global-search-wrap{
    width:min(
        var(--bsg-shell-search-width),
        calc(100% - 120px)
    ) !important;

    max-width:var(--bsg-shell-search-width) !important;
}

/* ========================================================= */
/* GLOBAL FOOTER TYPOGRAPHY / BRAND CONSISTENCY               */
/* ========================================================= */

.am-global-marketplace-shell .am-footer{
    font-family:var(--bsg-font-ui) !important;
}

.am-global-marketplace-shell .am-footer-copy,
.am-global-marketplace-shell .am-footer-links a{
    font-size:12px !important;
    line-height:1.4 !important;
}

/* ========================================================= */
/* RESPONSIVE                                                 */
/* ========================================================= */

@media(max-width:1180px){
    .am-global-marketplace-shell .am-main-nav{
        gap:0 !important;
    }

    .am-global-marketplace-shell
    .am-main-nav > a{
        padding:0 7px !important;
    }

    .am-global-marketplace-shell
    .am-global-search-wrap{
        width:calc(100% - 80px) !important;
        max-width:none !important;
    }

    .am-global-marketplace-shell:has(.bsg-browse-page)
    .am-global-search-wrap{
        width:min(820px,calc(100% - 180px)) !important;
        max-width:none !important;
    }
}

@media(max-width:980px){
    :root{
        --bsg-shell-header-top:8px;
        --bsg-shell-header-height:62px;
        --bsg-shell-gap:7px;
    }

    .am-global-marketplace-shell .am-header{
        width:calc(100% - 24px) !important;
        margin-top:8px !important;
        border-radius:14px !important;
    }

    .am-global-marketplace-shell .am-main-nav,
    .am-global-marketplace-shell .am-header-actions{
        display:none !important;
    }

    .am-global-marketplace-shell .am-mobile-toggle{
        margin-left:auto !important;
        width:40px !important;
        height:40px !important;

        display:grid !important;
        place-items:center !important;

        border:1px solid #e1e4e8 !important;
        border-radius:10px !important;
        background:#fff !important;
        color:#172338 !important;
        font-size:22px !important;
    }

    .am-global-marketplace-shell.am-menu-open
    .am-main-nav{
        position:absolute;
        top:calc(100% + 8px);
        left:0;
        right:0;

        padding:10px !important;

        display:grid !important;
        gap:3px !important;

        border:1px solid #e1e4e8;
        border-radius:14px;
        background:#fff;

        box-shadow:
            0 14px 32px rgba(16,24,40,.14);
    }

    .am-global-marketplace-shell.am-menu-open
    .am-main-nav > a{
        justify-content:flex-start !important;
        min-height:42px !important;
    }

    .am-global-marketplace-shell
    .am-global-search-wrap,
    .am-global-marketplace-shell:has(.bsg-browse-page)
    .am-global-search-wrap{
        width:calc(100% - 28px) !important;
        max-width:none !important;
    }

    .am-global-marketplace-shell
    .am-global-search-form{
        grid-template-columns:
            minmax(0,1fr)
            minmax(180px,.46fr)
            120px
            !important;

        min-height:58px !important;
        border-radius:16px !important;
    }

    .am-global-marketplace-shell
    .am-global-search-keyword,
    .am-global-marketplace-shell
    .am-global-search-location,
    .am-global-marketplace-shell
    .am-global-search-submit{
        height:46px !important;
    }
}

@media(max-width:640px){
    :root{
        --bsg-shell-header-top:6px;
        --bsg-shell-header-height:58px;
        --bsg-shell-gap:6px;
    }

    .am-global-marketplace-shell .am-header{
        width:calc(100% - 16px) !important;
        margin-top:6px !important;
        border-radius:13px !important;
    }

    .am-global-marketplace-shell
    .am-header
    .am-header-inner{
        padding:0 11px !important;
    }

    .am-global-marketplace-shell
    .am-logo-text strong,
    .am-global-marketplace-shell
    .am-logo-text b{
        font-size:18px !important;
    }

    .am-global-marketplace-shell
    .am-global-search-wrap,
    .am-global-marketplace-shell:has(.bsg-browse-page)
    .am-global-search-wrap{
        width:calc(100% - 16px) !important;
    }

    .am-global-marketplace-shell
    .am-global-search-form{
        min-height:54px !important;
        padding:5px !important;

        grid-template-columns:
            minmax(0,1fr)
            46px
            !important;

        border-radius:15px !important;
    }

    .am-global-marketplace-shell
    .am-global-search-location{
        display:none !important;
    }

    .am-global-marketplace-shell
    .am-global-search-keyword{
        height:44px !important;
        padding:0 11px !important;
        border-right:0 !important;
    }

    .am-global-marketplace-shell
    .am-global-search-form input{
        /*
        |--------------------------------------------------------------------------
        | 16px prevents iOS Safari from zooming when the field receives focus.
        |--------------------------------------------------------------------------
        */
        font-size:16px !important;
    }

    .am-global-marketplace-shell
    .am-global-search-submit{
        width:44px !important;
        height:44px !important;
        padding:0 !important;
        border-radius:12px !important;
        font-size:0 !important;
    }

    .am-global-marketplace-shell
    .am-global-search-submit span{
        width:20px !important;
        height:20px !important;
    }

    .bsg-type-display{
        font-size:40px !important;
    }
}
