:root {
    --bottom-nav-max-width: 768px;
    --bottom-nav-height: 72px;

    /*
    |--------------------------------------------------------------------------
    | 하단 메뉴 위쪽 모서리 반경
    |--------------------------------------------------------------------------
    | 첨부 이미지처럼 위쪽 좌우만 크게 둥글게 처리합니다.
    |--------------------------------------------------------------------------
    */
    --bottom-nav-top-radius: 30px;
}

.bottom-nav-spacer {
    width: 100%;
    height: calc(
        var(--bottom-nav-height)
        + env(safe-area-inset-bottom)
    );
    flex: 0 0 auto;
    pointer-events: none;
}

.bottom-nav,
.bottom-nav * {
    box-sizing: border-box;
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 50%;
    z-index: 3000;

    display: flex;
    width: 100%;
    max-width: var(--bottom-nav-max-width);
    height: calc(
        var(--bottom-nav-height)
        + env(safe-area-inset-bottom)
    );

    transform: translateX(-50%);
    align-items: flex-start;
    justify-content: space-around;

    padding-bottom: env(safe-area-inset-bottom);

    /*
    |--------------------------------------------------------------------------
    | 첨부 이미지형 상단 라운드
    |--------------------------------------------------------------------------
    | 위쪽 좌우만 둥글고 아래쪽은 화면 하단에 붙는 직선입니다.
    |--------------------------------------------------------------------------
    */
    overflow: hidden;
    border: 1px solid rgba(222, 226, 230, .96);
    border-bottom: 0;
    border-radius:
        var(--bottom-nav-top-radius)
        var(--bottom-nav-top-radius)
        0
        0;

    background: rgba(255, 255, 255, .98);
    box-shadow:
        0 -8px 26px rgba(20, 35, 48, .10),
        inset 0 1px 0 rgba(255, 255, 255, .92);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /*
    |--------------------------------------------------------------------------
    | 둥근 모서리 렌더링 안정화
    |--------------------------------------------------------------------------
    */
    isolation: isolate;
    -webkit-mask-image:
        -webkit-radial-gradient(
            white,
            black
        );
}

.bottom-nav .nav-item {
    display: flex;
    height: var(--bottom-nav-height);
    flex: 1;
    min-width: 0;

    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;

    color: #8c8c8c;
    text-decoration: none;

    transition:
        color .2s ease,
        background-color .2s ease;
}

.bottom-nav .nav-item:first-child {
    padding-left: 4px;
}

.bottom-nav .nav-item:last-child {
    padding-right: 4px;
}

.bottom-nav .nav-item svg {
    display: block;
    width: 22px;
    height: 22px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav .nav-item.active {
    color: #222;
}

.bottom-nav .nav-item:active {
    background: #f7f7f7;
}

.bottom-nav .nav-text {
    max-width: 100%;
    overflow: hidden;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 500px) {
    :root {
        --bottom-nav-height: 68px;
        --bottom-nav-top-radius: 27px;
    }

    .bottom-nav .nav-item svg {
        width: 21px;
        height: 21px;
    }

    .bottom-nav .nav-text {
        font-size: 9px;
    }
}

@media (max-width: 360px) {
    :root {
        --bottom-nav-top-radius: 24px;
    }

    .bottom-nav .nav-item {
        gap: 3px;
    }

    .bottom-nav .nav-text {
        font-size: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav .nav-item {
        transition: none;
    }
}
