/* =============================================================================
 * CarParts — Mobile bottom nav  v1.2
 *
 * Floating dock: inset rounded bar hovering over the page (not a flat strip
 * glued to the screen edge). Active tab = filled brand-red pill with white
 * icon + red bold label — compact, never a raised block.
 * PDP sticky add-to-cart bar parks above this dock (product.css bottom offset)
 * — keep the two geometries in sync if the dock height changes.
 * ========================================================================== */

.carparts-mobile-bottom-nav{
    display: none;
}

@media (max-width: 768px){
    body{
        padding-bottom: 88px !important;
    }

    .carparts-mobile-bottom-nav{
        position: fixed;
        bottom: calc(10px + env(safe-area-inset-bottom));
        right: 10px;
        left: 10px;
        width: auto;
        z-index: 99999;
        background: rgba(255,255,255,.96);
        backdrop-filter: saturate(1.1) blur(10px);
        -webkit-backdrop-filter: saturate(1.1) blur(10px);
        border: 1px solid #eef0f3;
        border-radius: 18px;
        box-shadow: 0 10px 34px rgba(20,24,31,.16);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 7px 4px;
        direction: rtl;
    }

    .carparts-bottom-nav__item{
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #7a808a;
        text-decoration: none;
        padding: 0 4px;
        transition: color .2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .carparts-bottom-nav__item:active .carparts-bottom-nav__icon-wrap{
        transform: scale(.92);
    }

    .carparts-bottom-nav__icon-wrap{
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 30px;
        border-radius: 999px;
        transition: background .2s ease, color .2s ease, transform .15s ease;
    }

    .carparts-bottom-nav__item svg{
        width: 22px;
        height: 22px;
        stroke: currentColor;
        stroke-width: 2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .cp-nav-cart-badge{
        position: absolute;
        top: -4px;
        right: -2px;
        min-width: 16px;
        height: 16px;
        border-radius: 50px;
        background-color: #eb2500;
        color: #fff;
        border: 1.5px solid #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        line-height: 1;
        font-size: 10px;
        font-weight: bold;
        box-sizing: border-box;
    }

    .cp-nav-cart-badge--empty{
        display: none;
    }

    .carparts-bottom-nav__label{
        font-size: 10.5px;
        font-weight: 600;
        margin-top: 4px;
        color: inherit;
        line-height: 1.2;
        white-space: nowrap;
    }

    /* active tab: filled red pill, white icon, red bold label */
    .carparts-bottom-nav__item--active{
        color: #eb2500;
    }
    .carparts-bottom-nav__item--active .carparts-bottom-nav__icon-wrap{
        background: #eb2500;
        color: #fff;
        box-shadow: 0 4px 12px rgba(235,37,0,.30);
    }
    .carparts-bottom-nav__item--active .carparts-bottom-nav__label{
        font-weight: 700;
    }

    /* Theme's own scroll-to-top button (i.backtotop, xtra core.css) is a
       dark circle fixed at the same bottom-right corner our dock occupies
       once scrolled — confirmed via fixed-element probe: both sit at the
       same bottom offset, same z-index range, overlapping. Our dock already
       covers navigation; the theme button adds nothing our nav doesn't, so
       hide it here instead of trying to fit both. */
    i.backtotop{
        display: none !important;
    }

    /* Rahkar AI chat goes full-screen on mobile at z-index 10000 — below our
       99999 dock, which then floats over the chat and buries its message
       input. While the chat is open, lift it above the dock; when closed the
       container is opacity:0/pointer-events:none so nothing else changes. */
    .rahkar_component_ai_support #rahkar_support_widget_container.rahkar_show{
        z-index: 100000;
    }
}
