#cafe-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: #FFF8E9;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(59, 34, 26, 0.07);
}

#cafe-bottom-nav .baritem {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    gap: 4px;
    flex: 1;
    padding: 6px 0;
    text-decoration: none;
}

#cafe-bottom-nav .baritem i {
    font-size: 22px;
    color: #999;
    transition: color 0.2s;
}

#cafe-bottom-nav .bartext {
    font-size: 11px;
    color: #999;
    transition: color 0.2s;
}

#cafe-bottom-nav .baritem.active i {
    color: #3B221A;
}

#cafe-bottom-nav .baritem.active .bartext {
    color: #3B221A;
    font-weight: 700;
}

#cafe-bottom-nav .bar-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    background: #ff3b30;
    color: #FFF8E9;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Preserve the homepage's 65px row, adding only the device safe area beneath it. */

html[data-cafe-ui="user"] {
    --cafe-nav-height: calc(65px + env(safe-area-inset-bottom, 0px));
}

#cafe-bottom-nav {
    box-sizing: border-box;
    height: var(--cafe-nav-height, 65px);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    bottom: var(--cafe-nav-keyboard-offset, 0px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#cafe-bottom-nav .baritem {
    min-width: 0;
    box-sizing: border-box;
    line-height: normal;
}

#cafe-bottom-nav .bartext {
    color: #8A7860;
    line-height: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
}

#cafe-bottom-nav .baritem:not(.active),
#cafe-bottom-nav .baritem:not(.active) i {
    color: #8A7860;
}

#cafe-bottom-nav .baritem.active .bartext {
    color: #3B221A;
}

#cafe-bottom-nav .baritem:focus-visible {
    outline: 2px solid #3B221A;
    outline-offset: -3px;
}

html[data-cafe-nav="global"] :is(.footer_menu, .app-footer:has(> .footer-nav-link), .bottom-menu-section, uni-tabbar),
html[data-cafe-nav="global"] .tabbar:has(> a.baritem):not(#cafe-bottom-nav) {
    display: none !important;
}

html[data-cafe-nav="global"] body.cafe-with-bottom-nav {
    padding-bottom: max(var(--cafe-original-bottom-padding, 0px), calc(var(--cafe-nav-height) + var(--cafe-action-clearance, 0px) + 16px)) !important;
    scroll-padding-bottom: calc(var(--cafe-nav-height) + var(--cafe-action-clearance, 0px) + 16px);
}

html[data-cafe-nav="global"] [data-cafe-fixed-action] {
    bottom: calc(var(--cafe-nav-height) + var(--cafe-action-original-bottom, 0px) + var(--cafe-nav-keyboard-offset, 0px)) !important;
}

html[data-cafe-nav="global"] :is(uni-page-body, .min-h-screen) {
    padding-bottom: calc(var(--cafe-nav-height) + var(--cafe-action-clearance, 0px) + 16px);
}

/* The same five destinations and active states are used across member pages. */

html[data-cafe-nav="global"] {
    --cafe-nav-height: calc(70px + env(safe-area-inset-bottom));
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav {
    position: fixed;
    inset: auto auto calc(7px + env(safe-area-inset-bottom) + var(--cafe-nav-keyboard-offset, 0px)) 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 18px), 462px);
    height: 56px;
    padding: 3px 5px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid #8e5423;
    border-radius: 19px;
    background: var(--cfb-coffee-gradient, linear-gradient(145deg, #672b0b, #3b160b 66%));
    box-shadow: 0 4px 10px #56210055;
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav .baritem {
    min-height: 46px;
    height: 100%;
    justify-content: center;
    padding: 2px 0;
    gap: 3px;
    border-radius: 14px;
    color: var(--cfb-white, #fff);
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav .baritem.active {
    color: #ffd374;
    background: #a54c173d;
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav .baritem :is(i, .bartext) {
    color: inherit !important;
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav .baritem i {
    font-size: clamp(17px, 4.7vw, 23px);
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav .bartext {
    font-size: clamp(9px, 2.65vw, 12px);
    white-space: nowrap;
}

.cfb-shared-nav .cfb-nav-medallion {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-top: -18px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffd374;
    background: #73350d;
    box-shadow: 0 3px 7px #1d0b05a0;
}

.cfb-shared-nav .cfb-nav-medallion img {
    width: 72%;
    height: auto;
}

.cfb-shared-nav .cfb-nav-product.active .cfb-nav-medallion {
    box-shadow: 0 0 0 2px #e99a22;
}

html[data-cafe-nav="global"] #cafe-bottom-nav.cfb-shared-nav .baritem:focus-visible {
    outline: 2px solid #ffd374;
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    #cafe-bottom-nav :is(.baritem i, .bartext) {
        transition: none;
    }
}