/* =========================================================
   ПЛАВНОЕ ИСЧЕЗНОВЕНИЕ КОНТЕНТА
   ========================================================= */

.bottom-navigation-fade {
    position: fixed;

    z-index: 899;

    left: 0;
    right: 0;
    bottom: 0;

    height:
        calc(
            135px +
            env(
                safe-area-inset-bottom
            )
        );

    background:
        linear-gradient(
            180deg,

            var(
                --nav-fade-start
            )
            0%,

            color-mix(
                in srgb,
                var(--nav-fade-end)
                12%,
                transparent
            )
            18%,

            color-mix(
                in srgb,
                var(--nav-fade-end)
                34%,
                transparent
            )
            38%,

            color-mix(
                in srgb,
                var(--nav-fade-end)
                68%,
                transparent
            )
            60%,

            color-mix(
                in srgb,
                var(--nav-fade-end)
                92%,
                transparent
            )
            80%,

            var(
                --nav-fade-end
            )
            100%
        );

    pointer-events: none;
}


/* =========================================================
   НИЖНЯЯ НАВИГАЦИЯ
   ========================================================= */

.bottom-navigation {
    position: fixed;

    z-index: 900;

    left: 16px;
    right: 16px;

    bottom:
        calc(
            10px +
            env(
                safe-area-inset-bottom
            )
        );

    height: 72px;

    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(
                0,
                1fr
            )
        );

    align-items: stretch;

    gap: 4px;

    box-sizing: border-box;

    padding: 5px;

    border:
        1px solid
        var(
            --app-border
        );

    border-radius: 27px;

    background:
        var(
            --nav-bg
        );

    box-shadow:
        var(
            --app-shadow
        );

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        Inter,
        Arial,
        sans-serif;

    -webkit-font-smoothing:
        antialiased;

    text-rendering:
        geometricPrecision;

    touch-action: none;
}


/* =========================================================
   КНОПКА РАЗДЕЛА
   ========================================================= */

.bottom-navigation__item {
    min-width: 0;

    height: 100%;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 2px;

    box-sizing: border-box;

    margin: 0;

    padding:
        5px
        5px
        4px;

    border:
        1px solid
        transparent;

    border-radius: 22px;

    outline: none;

    color:
        var(
            --nav-icon
        );

    background:
        transparent;

    font-family: inherit;

    cursor: pointer;

    user-select: none;

    appearance: none;
    -webkit-appearance: none;

    -webkit-tap-highlight-color:
        transparent;

    touch-action: manipulation;

    transition:
        transform 90ms ease,
        opacity 90ms ease,
        color 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}


/* =========================================================
   ИКОНКА
   ========================================================= */

.bottom-navigation__icon {
    flex: 0 0 auto;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 25px;
    height: 25px;

    color:
        currentColor;

    font-size: 25px;
    line-height: 1;

    font-variation-settings:
        "FILL" 0,
        "wght" 500,
        "GRAD" 0,
        "opsz" 26;

    transition:
        color 180ms ease,
        transform 180ms ease,
        font-variation-settings 180ms ease;
}


/* =========================================================
   НАЗВАНИЕ РАЗДЕЛА
   ========================================================= */

.bottom-navigation__label {
    min-width: 0;

    max-width: 100%;

    overflow: hidden;

    color:
        currentColor;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        Inter,
        Arial,
        sans-serif;

    font-size: 12px;
    font-weight: 600;

    line-height: 1;

    letter-spacing: -0.02em;

    text-align: center;

    white-space: nowrap;

    text-overflow: ellipsis;

    -webkit-font-smoothing:
        antialiased;

    text-rendering:
        geometricPrecision;
}


/* =========================================================
   АКТИВНЫЙ РАЗДЕЛ
   ========================================================= */

.bottom-navigation__item.is-active {
    color:
        var(
            --app-green-ui
        );

    border-color:
        var(
            --nav-active-border
        );

    background:
        var(
            --nav-active-bg
        );

    box-shadow:
        inset
        0
        1px
        0
        rgba(
            255,
            255,
            255,
            0.04
        );
}


.bottom-navigation__item.is-active
.bottom-navigation__icon {
    font-variation-settings:
        "FILL" 0,
        "wght" 600,
        "GRAD" 0,
        "opsz" 26;
}


.bottom-navigation__item.is-active
.bottom-navigation__label {
    font-weight: 700;
}


/* =========================================================
   НАЖАТИЕ
   ========================================================= */

.bottom-navigation__item:active,
.bottom-navigation__item.is-pressed {
    transform:
        scale(
            0.97
        );

    opacity:
        0.80;
}


/* =========================================================
   ФОКУС
   ========================================================= */

.bottom-navigation__item:focus {
    outline: none;
}


.bottom-navigation__item:focus-visible {
    box-shadow:
        0
        0
        0
        3px
        color-mix(
            in srgb,
            var(--app-green-ui)
            15%,
            transparent
        );
}


/* =========================================================
   ОТСТУП СПИСКА ПОД НАВИГАЦИЮ
   ========================================================= */

.habits-v2-list {
    padding-bottom:
        calc(
            105px +
            env(
                safe-area-inset-bottom
            )
        );
}


/* =========================================================
   УЗКИЕ ЭКРАНЫ
   ========================================================= */

@media (
    max-width: 370px
) {

    .bottom-navigation-fade {
        height:
            calc(
                125px +
                env(
                    safe-area-inset-bottom
                )
            );
    }


    .bottom-navigation {
        left: 12px;
        right: 12px;

        height: 68px;

        padding: 4px;

        border-radius: 25px;
    }


    .bottom-navigation__item {
        gap: 1px;

        padding:
            4px
            4px
            3px;

        border-radius: 21px;
    }


    .bottom-navigation__icon {
        width: 23px;
        height: 23px;

        font-size: 23px;

        font-variation-settings:
            "FILL" 0,
            "wght" 500,
            "GRAD" 0,
            "opsz" 24;
    }


    .bottom-navigation__label {
        font-size: 11.5px;
    }


    .habits-v2-list {
        padding-bottom:
            calc(
                98px +
                env(
                    safe-area-inset-bottom
                )
            );
    }
}


/* =========================================================
   УМЕНЬШЕННАЯ АНИМАЦИЯ
   ========================================================= */

@media (
    prefers-reduced-motion: reduce
) {

    .bottom-navigation__item,
    .bottom-navigation__icon {
        transition: none;
    }
}