/* Shared bottom navigation: admin uses six destinations; public menu keeps its own five-item layout. */

body.app-shell,
body.public-shell {
    --bottom-navigation-height: calc(72px + env(safe-area-inset-bottom));
}

body.app-shell .admin-tabbar,
body.public-shell > nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    height: calc(72px + env(safe-area-inset-bottom)) !important;
    padding: 0 0 env(safe-area-inset-bottom) !important;
    border: 0 !important;
    border-top: 1px solid #e5e5e5 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: 0 -5px 18px rgba(18, 25, 38, 0.08) !important;
    transform: none !important;
    overflow: visible !important;
    isolation: isolate;
    z-index: 40 !important;
}

body.app-shell .admin-tabbar > div {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    overflow: visible !important;
}

body.public-shell > nav > div {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    overflow: visible !important;
}

body.app-shell .admin-tabbar .nav-btn,
body.public-shell > nav .pub-nav-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 72px !important;
    padding: 0 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #9a9a9a !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, transform 160ms ease !important;
}

body.app-shell .admin-tabbar .nav-btn:hover,
body.public-shell > nav .pub-nav-btn:hover {
    color: #6f6f6f !important;
    background: transparent !important;
}

body.app-shell .admin-tabbar .nav-btn:active,
body.public-shell > nav .pub-nav-btn:active {
    transform: scale(0.96) !important;
}

body.app-shell .admin-tabbar .nav-btn:focus-visible,
body.public-shell > nav .pub-nav-btn:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: -3px;
}

body.app-shell .admin-tabbar .nav-btn .icon-wrapper,
body.public-shell > nav .pub-nav-btn .icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: currentColor !important;
    box-shadow: none !important;
    transition: color 160ms ease !important;
}

body.app-shell .admin-tabbar .nav-btn svg,
body.public-shell > nav .pub-nav-btn svg {
    width: 25px !important;
    height: 25px !important;
    stroke-width: 1.8;
}

body.app-shell .admin-tabbar .nav-btn > span:not(.admin-nav-badge),
body.public-shell > nav .pub-nav-btn > span:not([id$="-count"]) {
    display: block !important;
    width: 100% !important;
    overflow: hidden;
    font-size: 0.76rem !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.app-shell .admin-tabbar .nav-active,
body.public-shell > nav .pub-nav-active {
    color: var(--accent) !important;
}

body.app-shell .admin-tabbar .nav-active .icon-wrapper,
body.public-shell > nav .pub-nav-active .icon-wrapper {
    background: transparent !important;
    color: var(--accent) !important;
    box-shadow: none !important;
}

body.app-shell .admin-tabbar .nav-active > span:not(.admin-nav-badge),
body.public-shell > nav .pub-nav-active > span:not([id$="-count"]) {
    color: var(--accent) !important;
    font-weight: 600 !important;
}

/* The middle destination is raised like the reference navigation. */
body.app-shell .admin-tabbar .nav-primary,
body.public-shell > nav .nav-primary {
    align-self: start !important;
    height: 78px !important;
    min-height: 78px !important;
    margin-top: -14px !important;
    padding: 0 3px !important;
    border-radius: 38px 38px 20px 20px !important;
    width: 60px !important;
    justify-self: center !important;
    background: #f0f0f1 !important;
    color: #9a9a9a !important;
    box-shadow: 0 0 0 6px #ffffff, 0 3px 8px rgba(20, 20, 20, 0.03) !important;
    z-index: 2;
}

body.app-shell .admin-tabbar .nav-primary .icon-wrapper,
body.public-shell > nav .nav-primary .icon-wrapper {
    width: 33px !important;
    height: 33px !important;
    min-width: 33px !important;
    color: #989898 !important;
}

body.app-shell .admin-tabbar .nav-primary.nav-active,
body.public-shell > nav .nav-primary.pub-nav-active {
    background: #e4e5e6 !important;
    color: var(--accent) !important;
}

body.app-shell .admin-tabbar .nav-primary.nav-active .icon-wrapper,
body.public-shell > nav .nav-primary.pub-nav-active .icon-wrapper {
    color: var(--accent) !important;
}

body.public-shell > nav .nav-count-badge {
    top: -6px !important;
    right: -8px !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border: 2px solid #ffffff !important;
    border-radius: 999px !important;
    font-size: 0.64rem !important;
    line-height: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    z-index: 4 !important;
    box-shadow: 0 3px 8px rgba(18, 25, 38, 0.18) !important;
}

body.public-shell > nav .nav-count-badge--favorites {
    background: #ef5264 !important;
    color: #ffffff !important;
}

body.public-shell > nav .nav-count-badge--cart {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--accent) 32%, transparent) !important;
}

body.app-shell .admin-tabbar .admin-nav-badge {
    top: -6px !important;
    right: -8px !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border: 2px solid #ffffff !important;
    border-radius: 999px !important;
    background: #ef5264 !important;
    color: #ffffff !important;
    font-size: 0.64rem !important;
    line-height: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    z-index: 4 !important;
    box-shadow: 0 3px 8px rgba(18, 25, 38, 0.18) !important;
}

.dark body.app-shell .admin-tabbar,
.dark body.public-shell > nav {
    border-top-color: #2a2a2a !important;
    background: #171717 !important;
    box-shadow: 0 -5px 18px rgba(0, 0, 0, 0.28) !important;
}

.dark body.app-shell .admin-tabbar .nav-btn,
.dark body.public-shell > nav .pub-nav-btn {
    color: #999999 !important;
}

.dark body.app-shell .admin-tabbar .nav-active,
.dark body.public-shell > nav .pub-nav-active {
    color: var(--accent) !important;
}

.dark body.app-shell .admin-tabbar .nav-active .icon-wrapper,
.dark body.public-shell > nav .pub-nav-active .icon-wrapper,
.dark body.app-shell .admin-tabbar .nav-active > span:not(.admin-nav-badge),
.dark body.public-shell > nav .pub-nav-active > span:not([id$="-count"]) {
    color: var(--accent) !important;
}

.dark body.app-shell .admin-tabbar .nav-primary,
.dark body.public-shell > nav .nav-primary {
    background: #303133 !important;
    box-shadow: 0 0 0 6px #171717, 0 3px 8px rgba(0, 0, 0, 0.18) !important;
    color: #a3a3a3 !important;
}

.dark body.public-shell > nav .nav-count-badge {
    border-color: #171717 !important;
}

.dark body.app-shell .admin-tabbar .admin-nav-badge {
    border-color: #171717 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35) !important;
}

@media (max-width: 380px) {
    body.app-shell .admin-tabbar .nav-btn,
    body.public-shell > nav .pub-nav-btn {
        padding-inline: 0 !important;
    }

    body.app-shell .admin-tabbar .nav-btn svg,
    body.public-shell > nav .pub-nav-btn svg {
        width: 24px !important;
        height: 24px !important;
    }

    body.app-shell .admin-tabbar .nav-btn > span:not(.admin-nav-badge),
    body.public-shell > nav .pub-nav-btn > span:not([id$="-count"]) {
        font-size: 0.72rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.app-shell .admin-tabbar .nav-btn,
    body.public-shell > nav .pub-nav-btn,
    body.app-shell .admin-tabbar .nav-btn .icon-wrapper,
    body.public-shell > nav .pub-nav-btn .icon-wrapper {
        transition: none !important;
    }

    body.app-shell .admin-tabbar .nav-btn:active,
    body.public-shell > nav .pub-nav-btn:active {
        transform: none !important;
    }
}
