/* =========================================================
   Постоянное нижнее меню TERRA ICON
   ========================================================= */

.app-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9000;

    padding:
        7px
        max(8px, env(safe-area-inset-right))
        calc(7px + env(safe-area-inset-bottom))
        max(8px, env(safe-area-inset-left));

    border-top: 1px solid rgba(212, 175, 55, 0.32);

    background:
        linear-gradient(
            180deg,
            rgba(7, 7, 6, 0.9),
            rgba(3, 3, 3, 0.98)
        );

    box-shadow:
        0 -14px 34px rgba(0, 0, 0, 0.52),
        0 -1px 0 rgba(255, 221, 137, 0.04);

    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.app-bottom-nav-inner {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;

    width: min(100%, 760px);
    margin-inline: auto;
}


.app-bottom-nav-inner.has-four-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-bottom-nav-item {
    position: relative;

    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;

    min-width: 0;
    min-height: 58px;
    padding: 6px 2px;

    border: 1px solid transparent;
    border-radius: 14px;

    color: rgba(222, 211, 183, 0.62);
    background: transparent;

    text-decoration: none;

    transition:
        color 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.app-bottom-nav-item:hover {
    color: var(--color-gold-light);

    background: rgba(212, 175, 55, 0.06);
}

.app-bottom-nav-item:active {
    transform: scale(0.96);
}

.app-bottom-nav-item:focus-visible {
    outline: 2px solid var(--color-gold-light);
    outline-offset: -2px;
}

/*
 * Верхний золотой индикатор активной вкладки.
 */
.app-bottom-nav-item::before {
    content: "";

    position: absolute;
    top: -7px;
    left: 50%;

    width: 0;
    height: 2px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #f6d784,
            transparent
        );

    box-shadow: 0 0 16px rgba(225, 181, 75, 0.7);

    transform: translateX(-50%);

    transition: width 180ms ease;
}

.app-bottom-nav-item.is-active {
    color: var(--color-gold-light);

    border-color: rgba(212, 175, 55, 0.18);

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(212, 175, 55, 0.13),
            rgba(212, 175, 55, 0.025) 68%
        );
}

.app-bottom-nav-item.is-active::before {
    width: 42%;
}

.app-bottom-nav-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-bottom-nav-label {
    display: block;
    overflow: hidden;

    width: 100%;

    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;

    white-space: nowrap;
    text-align: center;
    text-overflow: ellipsis;
}

/*
 * Так как меню fixed, добавляем место внизу страницы,
 * чтобы оно не закрывало контент.
 */
.site-main {
    padding-bottom:
        calc(120px + env(safe-area-inset-bottom));
}


/* =========================================================
   Очень маленькие телефоны
   ========================================================= */

@media (max-width: 360px) {
    .app-bottom-nav {
        padding-right: 4px;
        padding-left: 4px;
    }

    .app-bottom-nav-inner {
        gap: 0;
    }

    .app-bottom-nav-item {
        min-height: 56px;
        padding-right: 1px;
        padding-left: 1px;
    }

    .app-bottom-nav-icon {
        width: 23px;
        height: 23px;
    }

    .app-bottom-nav-label {
        font-size: 9px;
    }
}


/* =========================================================
   Компьютерная версия
   Меню также остаётся постоянным, но становится компактнее.
   ========================================================= */

@media (min-width: 760px) {
    .app-bottom-nav {
        right: auto;
        bottom: 16px;
        left: 50%;

        width: min(720px, calc(100% - 32px));
        padding: 7px 10px;

        border: 1px solid rgba(212, 175, 55, 0.32);
        border-radius: 24px;

        transform: translateX(-50%);
    }

    .app-bottom-nav-item {
        min-height: 61px;
    }

    .app-bottom-nav-label {
        font-size: 11px;
    }

    .site-main {
        padding-bottom: 145px;
    }
}