/*
 * AutoMart Mobile Vehicle Detail V42.18
 *
 * GLOBAL MOBILE BOTTOM NAV CASCADE REPAIR
 *
 * - Restores the EXISTING .mobile-bottom navigation.
 * - Does NOT create a second navigation.
 * - Overrides the retired V40 hide rule with equal/higher specificity.
 * - Keeps V42.16 Call / WhatsApp / Chat dock above the nav.
 * - Mobile only.
 * - Desktop/tablet untouched.
 */

@media (max-width: 767.98px) {

    /* =========================================================
       EXISTING GLOBAL MOBILE NAV — AUTHORITATIVE RESTORE
       ========================================================= */

    html body:not(.admin-page) nav.mobile-bottom,
    html body:not(.admin-page) .mobile-bottom,
    html body:not(.admin-page) .mobile-bottom-nav,
    html body:not(.admin-page) .mobile-bottom-menu,
    html body:not(.admin-page) .am-mobile-bottom-nav,
    html body:not(.admin-page) .am-mobile-bottom-menu,
    html body:not(.admin-page) [data-mobile-bottom-nav] {

        display: flex !important;

        position: fixed !important;

        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        width: 100% !important;

        height: auto !important;

        min-width: 0 !important;
        min-height: 64px !important;

        max-width: none !important;
        max-height: none !important;

        margin: 0 !important;

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

        box-sizing: border-box !important;

        align-items: center !important;
        justify-content: space-around !important;

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

        border-top:
            1px solid #e3ebe7 !important;

        border-right: 0 !important;
        border-bottom: 0 !important;
        border-left: 0 !important;

        box-shadow:
            0 -8px 25px rgba(20, 38, 31, .10) !important;

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

        overflow: visible !important;

        visibility: visible !important;
        opacity: 1 !important;

        pointer-events: auto !important;

        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;

        /*
         * V42.16 contact dock remains above this nav.
         */
        z-index: 999980 !important;
    }


    /* =========================================================
       EXISTING NAV LINKS
       ========================================================= */

    html body:not(.admin-page) nav.mobile-bottom a,
    html body:not(.admin-page) .mobile-bottom a,
    html body:not(.admin-page) .mobile-bottom-nav a,
    html body:not(.admin-page) .mobile-bottom-menu a,
    html body:not(.admin-page) .am-mobile-bottom-nav a,
    html body:not(.admin-page) .am-mobile-bottom-menu a,
    html body:not(.admin-page) [data-mobile-bottom-nav] a {

        display: flex !important;

        min-width: 52px !important;
        min-height: 50px !important;

        flex: 1 1 0 !important;

        align-items: center !important;
        justify-content: center !important;

        visibility: visible !important;
        opacity: 1 !important;

        pointer-events: auto !important;
    }


    /* =========================================================
       EXISTING NAV ICONS / LABELS
       ========================================================= */

    html body:not(.admin-page) nav.mobile-bottom svg,
    html body:not(.admin-page) .mobile-bottom svg,
    html body:not(.admin-page) .mobile-bottom-nav svg,
    html body:not(.admin-page) .mobile-bottom-menu svg {

        display: block !important;

        visibility: visible !important;
        opacity: 1 !important;

        max-width: none !important;
        max-height: none !important;
    }


    /* =========================================================
       ACTIVE STATE
       ========================================================= */

    html body:not(.admin-page) nav.mobile-bottom .active,
    html body:not(.admin-page) .mobile-bottom .active,
    html body:not(.admin-page) .mobile-bottom-nav .active,
    html body:not(.admin-page) .mobile-bottom-menu .active {

        visibility: visible !important;
        opacity: 1 !important;
    }


    /* =========================================================
       CONTACT DOCK STACKING
       =========================================================
       V42.16 uses the existing contact dock.
       Keep it physically and visually above the nav.
       ========================================================= */

    html body:not(.admin-page) .am-v438-floating-contact,
    html body:not(.admin-page) .am-v438-floating-contact__inner {

        z-index: 999990 !important;
    }


    /* =========================================================
       PAGE SAFE CLEARANCE
       ========================================================= */

    html body:not(.admin-page) {
        padding-bottom:
            calc(76px + env(safe-area-inset-bottom, 0px));
    }


    /* =========================================================
       NEVER AFFECT DESKTOP/TABLET
       ========================================================= */

    html body:not(.admin-page) .mobile-bottom,
    html body:not(.admin-page) nav.mobile-bottom {

        touch-action: manipulation;
    }
}


/* =============================================================
   DESKTOP / TABLET — NO V42.18 RULES
   ============================================================= */

@media (min-width: 768px) {

    html body .mobile-bottom,
    html body nav.mobile-bottom {

        /* Preserve the site's desktop/tablet behavior. */
    }
}
