/*--------------------------------------------------------------
# Modern Bottom Navigation (Mobile)
--------------------------------------------------------------*/
:root {
    --bn-height: 3.75rem;
}

.bottom-nav {
    --bn-bg: rgba(255, 255, 255, 0.92);
    --bn-text: var(--vr-gray-700);
    --bn-label: var(--vr-gray-500);
    --bn-border: var(--vr-gray-200);
    --bn-accent: var(--vr-theme-color, #4f46e5);

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background-color: var(--bn-bg);
    border-top: 1px solid var(--bn-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    backdrop-filter: blur(14px) saturate(180%);
    transform: translateZ(0);
}

html[data-bs-theme="dark"] .bottom-nav {
    --bn-bg: rgba(17, 17, 20, 0.94);
    --bn-text: var(--vr-gray-300);
    --bn-label: var(--vr-gray-400);
    --bn-border: var(--vr-gray-800);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}

.bottom-nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    min-height: var(--bn-height);
}

.bottom-nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem 0.4375rem;
    min-height: var(--bn-height);
    background: none;
    border: 0;
    color: var(--bn-label);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
}

.bottom-nav-item:focus-visible {
    outline: 2px solid var(--bn-accent);
    outline-offset: -3px;
    border-radius: 0.5rem;
}

.bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.375rem;
    height: 1.75rem;
    border-radius: 999px;
    color: var(--bn-text);
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.bottom-nav-label {
    display: block;
    max-width: 100%;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s ease;
}

.bottom-nav-item:active .bottom-nav-icon {
    transform: scale(0.92);
}

/* Search overlay is open */
.bottom-nav-item.is-search-open {
    color: var(--bn-accent);
}

.bottom-nav-item.is-search-open .bottom-nav-icon {
    background-color: var(--bn-accent);
    color: #ffffff;
}

/* Suppressed while the on-screen keyboard is visible */
.bottom-nav {
    transition: transform 0.2s ease;
}

.bottom-nav.is-suppressed {
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0)));
    pointer-events: none;
}

/* Brief pressed state while touching the bar */
.bottom-nav.is-pressed {
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.12);
}

.bottom-nav-item.is-active,
.bottom-nav-item[aria-current="page"] {
    color: var(--bn-accent);
}

.bottom-nav-item.is-active .bottom-nav-icon,
.bottom-nav-item[aria-current="page"] .bottom-nav-icon {
    background-color: var(--bn-accent);
    color: #ffffff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--bn-accent) 45%, transparent);
}

.bottom-nav-item.is-active .bottom-nav-label,
.bottom-nav-item[aria-current="page"] .bottom-nav-label {
    color: var(--bn-accent);
}

/* Keep content, footer and the scroll-up button clear of the bar */
@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(var(--bn-height) + env(safe-area-inset-bottom, 0));
    }

    .btn-scroll-up {
        bottom: calc(var(--bn-height) + 1.25rem + env(safe-area-inset-bottom, 0));
    }

    /* The cookie consent banner must sit on top of the bar, not behind it */
    #cc-wrapper #cc-banner {
        bottom: calc(var(--bn-height) + env(safe-area-inset-bottom, 0));
    }
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav-item,
    .bottom-nav-icon,
    .bottom-nav-label {
        transition: none;
    }
}

/* Print: never show the app bar */
@media print {
    .bottom-nav {
        display: none !important;
    }
}
