/* Mobile bottom navigation — overrides legacy main.css (.bottonAppBar) */

@media (min-width: 992px) {
    .bottom_bar {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .bottom_bar {
        display: block !important;
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 998;
        pointer-events: none;
        font-size: 0.7rem !important;
        line-height: 1.1 !important;
    }

    body {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    }

    .footer-modern__bottom.bottom-footer,
    .bottom-footer {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .cookies-card {
        margin-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    }

    /* 5 equal slots — no flex-wrap stacking */
    .bottom_bar .bottonAppBar.bottom-app-bar,
    .bottom_bar .bottonAppBar,
    .bottom_bar nav.bottom-app-bar {
        pointer-events: auto;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 999;
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        grid-template-rows: 1fr !important;
        align-items: center !important;
        justify-items: center !important;
        gap: 0 !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        width: 100% !important;
        height: auto !important;
        min-height: 3.75rem !important;
        max-height: none !important;
        padding: 0.4rem 0.15rem calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
        background: hsl(var(--base)) !important;
        box-shadow: 0 -4px 18px hsl(var(--black) / 0.22);
        overflow: visible !important;
    }

    .bottom_bar .bottonAppBar > *,
    .bottom_bar nav.bottom-app-bar > * {
        grid-row: 1 !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .bottom_bar .bottonAppBar > :nth-child(1),
    .bottom_bar nav.bottom-app-bar > :nth-child(1) {
        grid-column: 1 !important;
    }

    .bottom_bar .bottonAppBar > :nth-child(2),
    .bottom_bar nav.bottom-app-bar > :nth-child(2) {
        grid-column: 2 !important;
    }

    .bottom_bar .bottonAppBar > :nth-child(3),
    .bottom_bar nav.bottom-app-bar > :nth-child(3) {
        grid-column: 3 !important;
    }

    .bottom_bar .bottonAppBar > :nth-child(4),
    .bottom_bar nav.bottom-app-bar > :nth-child(4) {
        grid-column: 4 !important;
    }

    .bottom_bar .bottonAppBar > :nth-child(5),
    .bottom_bar nav.bottom-app-bar > :nth-child(5) {
        grid-column: 5 !important;
    }

    .bottom_bar .bottom-item {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .bottom_bar .bottom-item a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.15rem !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0.15rem 0.1rem !important;
        color: hsl(var(--white)) !important;
        text-decoration: none !important;
        font-size: 0.62rem !important;
        line-height: 1.1 !important;
    }

    .bottom_bar .bottom-item a i {
        font-size: 1rem !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
    }

    .bottom_bar .bottom-item a span,
    .bottom_bar .bottom-item a p {
        display: block !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: center !important;
        font-size: inherit !important;
        margin: 0 !important;
    }

    /* Home FAB — perfect circle (not stretched by grid column) */
    .bottom_bar .tapTo-hom,
    .bottom_bar .bottom-app-bar__home,
    .bottom_bar .bottonAppBar .tapTo-hom {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateY(-0.85rem) !important;
        justify-self: center !important;
        align-self: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        font-size: 0 !important;
        line-height: 0 !important;
        z-index: 2 !important;
    }

    .bottom_bar .tapTo-hom .tap-box,
    .bottom_bar .bottom-app-bar__home .tap-box,
    .bottom_bar .tapTo-hom > a.tap-box {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
        box-sizing: border-box !important;
        width: 3rem !important;
        height: 3rem !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
        max-width: 3rem !important;
        max-height: 3rem !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border-radius: 50% !important;
        background: hsl(var(--base)) !important;
        border: 3px solid hsl(var(--body-bg)) !important;
        box-shadow: 0 4px 14px hsl(var(--black) / 0.28) !important;
        font-size: 0 !important;
        line-height: 0 !important;
        overflow: hidden !important;
    }

    .bottom_bar .tapTo-hom .tap-box a,
    .bottom_bar .tapTo-hom > a.tap-box {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        width: 3rem !important;
        height: 3rem !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
        max-width: 3rem !important;
        max-height: 3rem !important;
        aspect-ratio: 1 / 1 !important;
        padding: 0 !important;
        border-radius: 50% !important;
        color: hsl(var(--white)) !important;
        font-size: 0 !important;
        line-height: 0 !important;
        text-decoration: none !important;
    }

    .bottom_bar .tapTo-hom i,
    .bottom_bar .tapTo-hom .tap-box i,
    .bottom_bar .tapTo-hom .tap-box a i,
    .bottom_bar .tapTo-hom > a.tap-box i {
        font-size: 1.1rem !important;
        line-height: 1 !important;
        color: hsl(var(--white)) !important;
    }

    .bottom_bar .tapTo-hom span,
    .bottom_bar .tapTo-hom .tap-box span,
    .bottom_bar .tapTo-hom .tap-box a span {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        font-size: 0 !important;
    }

    /* Scroll to top — clear of bar and purchase buttons */
    .scroll-top {
        right: 0.65rem !important;
        bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px)) !important;
        width: 2.6rem !important;
        height: 2.6rem !important;
        z-index: 1001 !important;
    }

    .scroll-top i {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        font-size: 0.9rem !important;
    }

    /* Tawk chat bubble — keep off the green nav bar */
    .tawk-min-container,
    .tawk-button,
    #tawk-bubble-container,
    div[aria-label="Chat widget"] {
        z-index: 997 !important;
    }

    .tawk-min-container {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)) !important;
        left: 0.5rem !important;
    }
}

@media (max-width: 425px) {
    .bottom_bar {
        font-size: 0.65rem !important;
    }

    .bottom_bar .bottom-item a {
        font-size: 0.58rem !important;
    }

    .bottom_bar .bottom-item a i {
        font-size: 0.92rem !important;
    }

    .bottom_bar .tapTo-hom .tap-box,
    .bottom_bar .tapTo-hom > a.tap-box {
        width: 2.85rem !important;
        height: 2.85rem !important;
        min-width: 2.85rem !important;
        min-height: 2.85rem !important;
        max-width: 2.85rem !important;
        max-height: 2.85rem !important;
    }

    .scroll-top {
        bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Mobile dock refinement: retain existing links and menu behavior. */
@media(max-width:991px){
 .bottom_bar{--dock-bg:rgba(255,255,255,.96);--dock-ink:#52635e;--dock-line:rgba(20,65,48,.12)}
 body.dark .bottom_bar{--dock-bg:hsl(var(--dark) / .98);--dock-ink:#bac2d6;--dock-line:rgba(180,196,230,.14)}
 .bottom_bar .bottonAppBar.bottom-app-bar{left:12px!important;right:12px!important;bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;width:calc(100% - 24px)!important;min-height:70px!important;padding:7px 5px!important;background:var(--dock-bg)!important;border:1px solid var(--dock-line)!important;border-radius:23px!important;box-shadow:0 8px 32px #00000026!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
 .bottom_bar .bottom-item a{min-height:54px!important;gap:5px!important;color:var(--dock-ink)!important;border-radius:15px;font-family:Arial,sans-serif;font-size:10px!important;font-weight:600;transition:background .16s,color .16s}
 .bottom_bar .bottom-item a i{font-size:23px!important}
 .bottom_bar .bottom-item a:hover,.bottom_bar .bottom-item a[aria-current="page"]{color:hsl(var(--base))!important;background:hsl(var(--base)/.10)}
 .bottom_bar a:focus-visible{outline:2px solid hsl(var(--base));outline-offset:2px}
 .bottom_bar .bottom-app-bar__home{transform:translateY(-8px)!important}
 .bottom_bar .bottom-app-bar__home>a.tap-box{width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important;max-width:52px!important;max-height:52px!important;border-radius:18px!important;border:3px solid var(--dock-bg)!important;box-shadow:0 5px 13px hsl(var(--base)/.3)!important}
 .bottom_bar .bottom-app-bar__home>a.tap-box i{font-size:25px!important}
 .scroll-top{bottom:calc(105px + env(safe-area-inset-bottom,0px))!important}
}
@media(prefers-reduced-motion:reduce){.bottom_bar .bottom-item a{transition:none}}
