/* ============================================================
   AUTOMART V45.2
   PREMIUM MOBILE NEW / USED MARKET SHEETS

   Mobile only.
   Existing URLs and filtering remain untouched.
   ============================================================ */

@media screen and (max-width:767px) {

    /* ========================================================
       MAIN SHEET
       ======================================================== */

    .am-v452-mobile-market-panel {

        position:fixed !important;

        left:50% !important;

        top:
            calc(
                var(--am-v414-header-height, 72px)
                +
                10px
            )
            !important;

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

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

        max-width:430px !important;

        height:auto !important;

        max-height:none !important;

        margin:0 !important;

        padding:
            14px 14px 0
            !important;

        transform:
            translateX(-50%)
            !important;

        box-sizing:border-box !important;

        overflow-x:hidden !important;
        overflow-y:auto !important;

        overscroll-behavior:contain !important;

        -webkit-overflow-scrolling:touch;

        background:
            linear-gradient(
                180deg,
                #ffffff 0%,
                #fbfcfc 100%
            )
            !important;

        border:
            1px solid
            #e0e8e4
            !important;

        border-radius:
            24px
            !important;

        box-shadow:
            0 24px 60px
            rgba(12,28,21,.22)
            !important;

        z-index:
            2147482600
            !important;

        scrollbar-width:none;
    }


    .am-v452-mobile-market-panel::-webkit-scrollbar {

        display:none;
    }


    /* ========================================================
       PREMIUM TOP BLOCK
       ======================================================== */

    .am-v452-mobile-market-panel
    .am-v452-sheet-head {

        position:relative;

        margin:
            -2px 0 12px;

        padding:
            4px 2px 0;
    }


    .am-v452-sheet-eyebrow {

        display:flex;

        align-items:center;

        gap:7px;

        margin-bottom:5px;

        color:#158056;

        font-size:10px;

        line-height:1.2;

        font-weight:800;

        letter-spacing:.12em;

        text-transform:uppercase;
    }


    .am-v452-sheet-eyebrow::before {

        content:"";

        width:19px;
        height:2px;

        flex:0 0 19px;

        border-radius:999px;

        background:#13a667;
    }


    .am-v452-sheet-title-row {

        display:flex;

        align-items:flex-start;

        justify-content:space-between;

        gap:12px;
    }


    .am-v452-sheet-title {

        margin:0;

        color:#111c2d;

        font-size:22px;

        line-height:1.1;

        font-weight:850;

        letter-spacing:-.025em;
    }


    .am-v452-sheet-subtitle {

        max-width:275px;

        margin:
            5px 0 0;

        color:#718096;

        font-size:12px;

        line-height:1.45;

        font-weight:500;
    }


    .am-v452-sheet-badge {

        flex:0 0 auto;

        display:inline-flex;

        align-items:center;

        min-height:27px;

        padding:
            5px 10px;

        border-radius:999px;

        background:#e8f7ef;

        color:#087a49;

        font-size:10px;

        line-height:1;

        font-weight:800;
    }


    /* ========================================================
       NEW / USED SEGMENT
       ======================================================== */

    .am-v452-market-switch {

        display:grid;

        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            );

        gap:4px;

        margin-top:13px;

        padding:4px;

        border:
            1px solid
            #e1e9e5;

        border-radius:13px;

        background:#f3f6f5;
    }


    .am-v452-market-switch a {

        min-height:42px;

        display:flex;

        align-items:center;

        justify-content:center;

        gap:6px;

        padding:
            7px 10px;

        border-radius:9px;

        color:#4d5a6d;

        text-decoration:none;

        font-size:12px;

        line-height:1;

        font-weight:800;

        transition:
            background .16s ease,
            color .16s ease,
            box-shadow .16s ease;
    }


    .am-v452-market-switch a.is-active {

        background:#fff;

        color:#087b4a;

        box-shadow:
            0 5px 14px
            rgba(16,40,29,.09);
    }


    .am-v452-market-switch a.is-active::before {

        content:"✓";

        width:17px;
        height:17px;

        display:grid;

        place-items:center;

        border-radius:50%;

        background:#0aa15d;

        color:#fff;

        font-size:9px;
    }


    /* ========================================================
       REMOVE OLD DETACHED INTRO COPY
       ======================================================== */

    .am-v452-mobile-market-panel
    .am-v452-native-intro {

        display:none !important;
    }


    /* ========================================================
       QUICK ACTIONS
       ======================================================== */

    .am-v452-mobile-market-panel
    .am-v452-quick-grid {

        display:grid !important;

        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            )
            !important;

        gap:8px !important;

        margin:
            13px 0 18px
            !important;
    }


    .am-v452-mobile-market-panel
    .am-v452-quick-grid
    > a,

    .am-v452-mobile-market-panel
    .am-v452-quick-grid
    > button {

        position:relative;

        min-width:0 !important;

        min-height:58px !important;

        display:flex !important;

        flex-direction:column !important;

        align-items:flex-start !important;

        justify-content:center !important;

        gap:3px !important;

        padding:
            10px 11px
            !important;

        box-sizing:border-box !important;

        border:
            1px solid
            #dfe8e3
            !important;

        border-radius:
            13px
            !important;

        background:
            linear-gradient(
                145deg,
                #ffffff,
                #f8faf9
            )
            !important;

        color:#172334 !important;

        text-align:left !important;

        text-decoration:none !important;

        font-size:11px !important;

        line-height:1.3 !important;

        font-weight:750 !important;

        box-shadow:
            0 3px 10px
            rgba(18,40,29,.035)
            !important;
    }


    .am-v452-mobile-market-panel
    .am-v452-quick-grid
    > a:first-child {

        border-color:#cce8da !important;

        background:
            linear-gradient(
                145deg,
                #f1fbf6,
                #ffffff
            )
            !important;

        color:#087b49 !important;
    }


    /* ========================================================
       SECTION HEADINGS
       ======================================================== */

    .am-v452-mobile-market-panel
    .am-v452-section-heading {

        position:relative;

        display:flex !important;

        align-items:center !important;

        justify-content:space-between !important;

        gap:10px !important;

        margin:
            4px 0 9px
            !important;

        padding:
            0 1px
            !important;

        color:#101b2b !important;

        font-size:12px !important;

        line-height:1.3 !important;

        font-weight:850 !important;
    }


    .am-v452-mobile-market-panel
    .am-v452-section-heading::before {

        content:"";

        width:17px;
        height:2px;

        flex:0 0 17px;

        margin-right:3px;

        border-radius:999px;

        background:#13a667;
    }


    /* ========================================================
       BODY STYLE GROUP
       ======================================================== */

    .am-v452-mobile-market-panel
    .am-v452-body-grid {

        display:grid !important;

        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            )
            !important;

        gap:8px !important;

        margin-bottom:19px !important;
    }


    .am-v452-mobile-market-panel
    .am-v452-body-grid
    > a,

    .am-v452-mobile-market-panel
    .am-v452-body-grid
    > button {

        min-width:0 !important;

        min-height:48px !important;

        display:flex !important;

        align-items:center !important;

        justify-content:flex-start !important;

        gap:9px !important;

        padding:
            8px 11px
            !important;

        border:
            1px solid
            #dfe7e3
            !important;

        border-radius:
            12px
            !important;

        background:#fff !important;

        color:#1a2636 !important;

        text-decoration:none !important;

        font-size:11px !important;

        font-weight:750 !important;
    }


    .am-v452-mobile-market-panel
    .am-v452-body-grid
    > a::before,

    .am-v452-mobile-market-panel
    .am-v452-body-grid
    > button::before {

        content:"";

        width:21px;
        height:12px;

        flex:0 0 21px;

        border:
            1.7px solid
            #0b9960;

        border-radius:
            7px 9px 4px 4px;

        transform:
            skewX(-9deg);

        box-sizing:border-box;
    }


    /* ========================================================
       BRAND GRID
       ======================================================== */

    .am-v452-mobile-market-panel
    .am-v452-brand-grid {

        display:grid !important;

        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            )
            !important;

        gap:8px !important;

        margin-bottom:16px !important;
    }


    .am-v452-mobile-market-panel
    .am-v452-brand-grid
    > a,

    .am-v452-mobile-market-panel
    .am-v452-brand-grid
    > button {

        min-width:0 !important;

        min-height:44px !important;

        display:flex !important;

        align-items:center !important;

        justify-content:flex-start !important;

        gap:8px !important;

        padding:
            7px 10px
            !important;

        border:
            1px solid
            #e1e8e5
            !important;

        border-radius:
            11px
            !important;

        background:
            #fbfcfc
            !important;

        color:#263346 !important;

        text-align:left !important;

        text-decoration:none !important;

        font-size:10px !important;

        line-height:1.25 !important;

        font-weight:750 !important;
    }


    .am-v452-brand-mark {

        width:26px;
        height:26px;

        flex:0 0 26px;

        display:grid;

        place-items:center;

        border:
            1px solid
            #dce6e1;

        border-radius:
            8px;

        background:#fff;

        color:#087c4b;

        font-size:8px;

        line-height:1;

        font-weight:850;
    }


    /* ========================================================
       STICKY ACTION
       Always sits ABOVE mobile bottom navigation.
       ======================================================== */

    .am-v452-sheet-footer {

        position:sticky;

        left:0;
        right:0;
        bottom:0;

        z-index:20;

        margin:
            6px -14px 0;

        padding:
            11px 14px
            calc(
                11px
                +
                env(safe-area-inset-bottom)
            );

        border-top:
            1px solid
            #e1e8e5;

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

        backdrop-filter:
            blur(16px);

        -webkit-backdrop-filter:
            blur(16px);
    }


    .am-v452-sheet-footer a {

        min-height:48px;

        display:flex;

        align-items:center;

        justify-content:center;

        gap:9px;

        width:100%;

        border-radius:12px;

        background:
            linear-gradient(
                135deg,
                #0bad65,
                #078b50
            );

        color:#fff;

        text-decoration:none;

        font-size:12px;

        font-weight:850;

        box-shadow:
            0 8px 19px
            rgba(7,139,80,.19);
    }


    .am-v452-sheet-footer a::after {

        content:"→";

        font-size:17px;
    }


    .am-v452-hide-native-cta {

        display:none !important;
    }


    /* ========================================================
       NEW CARS VARIANT
       ======================================================== */

    .am-v452-mobile-market-panel[
        data-am-v452-mode="new"
    ]
    .am-v452-sheet-badge {

        background:#eaf8f1;

        color:#067747;
    }


    .am-v452-mobile-market-panel[
        data-am-v452-mode="new"
    ]
    .am-v452-sheet-badge::before {

        content:"✦";

        margin-right:4px;

        font-size:8px;
    }


    /* ========================================================
       VERY SMALL DEVICES
       ======================================================== */

    @media screen and (max-width:390px) {

        .am-v452-mobile-market-panel {

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

            padding:
                12px 12px 0
                !important;

            border-radius:
                21px
                !important;
        }


        .am-v452-sheet-title {

            font-size:20px;
        }


        .am-v452-sheet-footer {

            margin:
                6px -12px 0;

            padding-left:12px;
            padding-right:12px;
        }

    }

}
