/* ===================================================================
   卡Go 全站手机端统一层 h5-nav.css   v20261110
   - 必须在 h5.css 之后加载（最终覆盖层）
   - 内容：底部三段式导航 / 顶栏精简 / 桌面端强制手机版单列 / 订单查询页
   - 不改任何业务 DOM 结构与 Smarty 钩子，仅做视觉与布局收敛
   =================================================================== */

:root {
    --h5-tb-h: 58px;
    --h5-page: 560px;
}

/* ---------------- 1. 底部三段式导航 ---------------- */
.h5-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    align-items: stretch;
    height: calc(var(--h5-tb-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .93);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    border-top: .5px solid var(--h5-line);
}

.h5-tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    text-decoration: none !important;
    color: #8e8e93 !important;
    font-size: 11px;
    line-height: 1;
    letter-spacing: .2px;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease;
}

.h5-tabbar a svg {
    width: 21px;
    height: 21px;
    display: block;
}

.h5-tabbar a.on {
    color: var(--h5-primary) !important;
    font-weight: 600;
}

.h5-tabbar a:active {
    transform: scale(.94);
}

/* 页面留白，避免被导航遮挡 */
body.h5-tb {
    padding-bottom: calc(var(--h5-tb-h) + env(safe-area-inset-bottom) + 10px) !important;
}

body.h5-tb-buy {
    padding-bottom: calc(var(--h5-tb-h) + env(safe-area-inset-bottom) + 92px) !important;
}

/* ---------------- 2. 顶栏精简（手机版观感） ---------------- */
.navbar-acg .search-input {
    display: none !important;
}

.navbar-acg .navbar-toggler {
    display: none !important;
}

.navbar-acg #navbarNav {
    display: none !important;
}

.navbar-acg .user-login-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-acg .user-login-box .btn-primary {
    display: none !important;
}

.navbar-acg .user-login-box .btn-outline-secondary {
    border-radius: 999px !important;
    padding: 6px 16px !important;
}

/* ---------------- 3. 详情页购买条让位底部导航 ---------------- */
.h5-buybar {
    bottom: calc(var(--h5-tb-h) + env(safe-area-inset-bottom)) !important;
    z-index: 1100 !important;
}

/* ---------------- 4. 订单查询页 ---------------- */
.order-query-form .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
}

.order-query-form .d-flex > div {
    width: 100% !important;
}

.order-query-form .form-control {
    height: 46px;
    border-radius: 12px !important;
}

.btn-search-query {
    width: 100%;
    height: 46px;
    border-radius: 12px !important;
}

/* 未登录时的登录引导卡 */
.h5-query-tip {
    display: block;
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--h5-line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    text-decoration: none !important;
    color: inherit !important;
}

.h5-query-tip b {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--h5-text);
    margin-bottom: 4px;
}

.h5-query-tip span {
    display: block;
    font-size: 13px;
    color: var(--h5-text-2);
    line-height: 1.5;
}

.h5-query-tip em {
    display: inline-block;
    margin-top: 10px;
    font-style: normal;
    font-size: 14px;
    font-weight: 600;
    color: var(--h5-primary);
}

/* ---------------- 5. 登录页返回提示 ---------------- */
.h5-auth-tip {
    margin: 0 0 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--h5-primary-soft);
    color: #0b63c5;
    font-size: 13px;
    line-height: 1.5;
}

/* ---------------- 6. 桌面端也按手机端呈现 ---------------- */
@media (min-width: 768px) {

    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-fluid,
    .layui-container,
    main.container {
        width: 100% !important;
        max-width: var(--h5-page) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .h5-tabbar {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        max-width: var(--h5-page);
    }

    /* 详情页：桌面不分成两列 */
    .h5-item-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    .h5-item-hero {
        aspect-ratio: 16 / 11 !important;
        max-height: 268px !important;
    }

    .h5-sku-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    /* 买家中心：侧栏竖排、内容单列 */
    .fly-user-main {
        display: block !important;
        padding: 0 0 40px !important;
    }

    .fly-user-main .layui-nav-tree {
        width: 100% !important;
        float: none !important;
        margin-bottom: 12px;
    }

    .fly-user-main .fly-panel {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 767.98px) {

    .h5-tabbar {
        height: calc(var(--h5-tb-h) + env(safe-area-inset-bottom));
    }
}

/* ---------------- 7. 用户中心功能宫格（手机端「我的」入口区） ---------------- */
.h5-uc-menu {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: #fff;
    border-radius: 18px;
    padding: 14px 8px 10px;
    margin: 0 0 12px;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    position: relative;
    z-index: 2;
}

.h5-uc-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 2px;
    border-radius: 14px;
    color: #1d1d1f !important;
    text-decoration: none !important;
    font-size: 12px;
    line-height: 1.2;
    min-width: 0;
}

.h5-uc-menu a:active {
    background: #f2f2f7;
}

.h5-uc-menu a i {
    font-size: 21px !important;
    color: #0071e3;
}

.h5-uc-menu a span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.h5-uc-menu a.h5-uc-out i {
    color: #ff3b30;
}

/* 侧栏菜单由宫格取代，全端隐藏（含桌面，避免浮层拦截点击） */
.fly-user-main .layui-nav-tree,
.fly-header .layui-nav-tree.layui-inline {
    display: none !important;
}
