/*
 * Нижний таб-бар мобильной версии (ТЗ §63): пять пунктов, иконка + подпись.
 * Появляется вместе с мобильной композицией шапки — от 1024px и ниже.
 */

.tabbar {
    display: none;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-header);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 20px rgba(35, 50, 100, .06);
}

.tabbar__list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.tabbar__item {
    margin: 0;
    min-width: 0;
}

.tabbar__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--tabbar-height);
    color: var(--text-muted);
    font-size: var(--fs-micro);
    font-weight: var(--fw-semibold);
    text-align: center;
}

.tabbar__link:hover {
    color: var(--primary);
}

.tabbar__link[aria-current="page"] {
    color: var(--primary);
}

.tabbar__link--soon {
    opacity: .5;
    cursor: default;
}

.tabbar__link--soon:hover {
    color: var(--text-muted);
}

.tabbar__icon {
    display: inline-flex;
}

.tabbar__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .tabbar {
        display: block;
    }

    /*
     * Чтобы таб-бар не закрывал последние строки футера. К высоте бара
     * добавлен отступ: ровно по высоте правовые ссылки упираются в границу
     * бара и читаются как его часть.
     */
    body {
        padding-bottom: calc(var(--tabbar-height) + var(--space-5) + env(safe-area-inset-bottom, 0px));
    }
}
