/* 頁內隱藏待命；進入 layer 後顯示 */
#mbNavPopupRoot {
    display: none;
}

.layui-layer.mb-nav-layer #mbNavPopupRoot {
    display: flex !important;
}

.mb-nav-popup {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 66vh;
    max-height: 100%;
    padding: 10px 24px calc(24px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: #ffffff;
}

.mb-nav-popup__handle {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 4px;
    margin: 4px auto 28px;
    border-radius: 999px;
    background: #d9d9d9;
    cursor: grab;
    touch-action: none;
}

.mb-nav-popup__handle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 36px;
    transform: translate(-50%, -50%);
}

.mb-nav-popup__handle.is-dragging {
    cursor: grabbing;
}

.mb-nav-popup__panels {
    position: relative;
    flex: 1 1 auto;
    min-height: 320px;
    overflow: hidden;
}

.mb-nav-popup__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: transform;
    pointer-events: none;
    z-index: 0;
}

.mb-nav-popup__panel.is-active {
    pointer-events: auto;
    z-index: 2;
    transform: translateX(0);
}

.mb-nav-popup__panel.is-leaving {
    pointer-events: none;
    z-index: 1;
}

/* 主選單待命於左側；二級待命於右側 */
.mb-nav-popup__panel--main:not(.is-active) {
    transform: translateX(-100%);
}

.mb-nav-popup__panel--sub:not(.is-active) {
    transform: translateX(100%);
}

.mb-nav-popup__link {
    display: block !important;
    width: 100%;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    color: #181818 !important;
    text-decoration: none !important;
    visibility: visible !important;
    opacity: 1 !important;

    &:last-child {
        margin-bottom: 0;
    }
}

.mb-nav-popup__panel--sub .mb-nav-popup__link {
    font-size: 24px;
}

.mb-nav-popup__list {
    display: block;
    margin: 0;
    padding: 0;
}

.mb-nav-popup__list .mb-nav-popup__link:last-child {
    margin-bottom: 0;
}

.mb-nav-popup__drill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 22px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    color: #181818;
    text-align: left;
    cursor: pointer;
}

.mb-nav-popup__drill img {
    width: 24px;
    height: 24px;
}

.mb-nav-popup__back {
    display: inline-flex;
    align-items: center;
    margin: 0 0 16px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: rgba(24, 24, 24, 0.55);
    cursor: pointer;

    img {
        width: 22px;
        height: 22px;
        margin-left: -6px;
    }
}

.mb-nav-popup__panel-title {
    display: block !important;
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    color: #181818;
}

.mb-nav-popup__subnav-all {
    margin-top: 4px !important;
    font-weight: 600 !important;
    color: #1e8ce6 !important;
}

.mb-nav-popup__footer {
    margin-top: auto;
    padding-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mb-nav-popup__login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--yellow-color);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.mb-nav-popup__login svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mb-nav-popup__lang.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    padding: 4px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.mb-nav-popup__lang .language-switch__option {
    min-width: 52px;
    height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: #6b7280;
    background: transparent;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.mb-nav-popup__lang .language-switch__option.is-active {
    background: var(--main-color);
    color: #ffffff;
}
