/* ============================================================
   许乐移动端样式（Zappos 风格）
   仅在 ≤ 768px 屏幕生效，桌面端不受影响
   ============================================================ */

/* ---------- 基础重置 ---------- */
@media (max-width: 768px) {
    html { -webkit-text-size-adjust: 100%; }
    body { font-size: 14px; padding-bottom: 64px; /* 给底部导航留位 */ }

    /* 隐藏桌面主导航，显示移动端顶部栏 */
    header nav { display: none !important; }
    .header-top { padding: 10px 14px !important; gap: 8px; flex-wrap: nowrap; }
    /* 手机端 logo 改为纯文字，不再显示蓝红图标块 */
    .logo { font-size: 14px !important; flex-shrink: 1; min-width: 0; }
    .logo-mark { display: none !important; }
    .logo .sub {
        display: flex !important;
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
        line-height: 1.3;
    }
    .logo .sub .sub-sep { display: none !important; }
    .logo .sub-url { font-size: 13px !important; color: #222 !important; font-weight: 700; }
    .logo .sub-tag { font-size: 11px !important; color: #888 !important; font-weight: 500; letter-spacing: 1px; }
    .header-icons { gap: 14px !important; font-size: 20px !important; flex-shrink: 0; }

    /* 搜索框在移动端：顶部栏内隐藏，用搜索图标展开 */
    .search-wrap { display: none !important; }

    /* 移动端汉堡按钮 */
    .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center; justify-content: center;
        width: 36px; height: 36px;
        font-size: 22px; color: #333;
        cursor: pointer; user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* 移动端搜索条 */
    .mobile-search-bar {
        display: block !important;
        padding: 8px 14px 10px;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
    }
    .mobile-search-bar input {
        width: 100%; padding: 10px 14px;
        border: 1px solid #e0e0e0; border-radius: 20px;
        font-size: 14px; box-sizing: border-box;
        background: #f7f7f7;
    }
    .mobile-search-bar input:focus { outline: none; background: #fff; border-color: #b8860b; }

    /* 横幅：全宽、缩小 */
    .banner { padding: 28px 16px !important; }
    .banner-inner { padding: 0 !important; }
    .banner h1 { font-size: 22px !important; margin-bottom: 8px !important; }
    .banner-tag { font-size: 13px !important; line-height: 1.6 !important; }
    .banner-cta { font-size: 15px !important; padding: 10px 24px !important; margin: 14px 0 !important; }
    .banner-features { flex-wrap: wrap; gap: 6px 14px !important; font-size: 12px !important; }

    /* 两栏布局变单栏 */
    .main-wrap { flex-direction: column !important; padding: 16px 12px 24px !important; gap: 16px; }
    .side-filter {
        width: 100% !important; position: static !important;
        padding: 14px !important; box-sizing: border-box;
    }
    .side-filter .az-grid { grid-template-columns: repeat(9, 1fr) !important; gap: 3px; }
    .container { max-width: 100% !important; }

    /* 商品/品牌/匠人网格：2 列 */
    .product-grid, .craftsman-grid, .promise-grid, .brand-grid,
    .link-grid, .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 20px !important; }
    .footer { padding: 30px 16px !important; }

    /* section title */
    .section-title { font-size: 18px !important; padding: 0 4px !important; }
    h1 { font-size: 24px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }

    /* 表格横向滚动（商品管理/订单管理） */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrap { overflow-x: auto; }

    /* 管理页调整 */
    .page-head { flex-direction: column; align-items: flex-start !important; gap: 10px; padding: 16px !important; }
    .head-btns { flex-wrap: wrap; }
    .filter-bar { flex-wrap: wrap; gap: 8px; padding: 12px !important; }
    .filter-bar .form-input, .filter-bar .form-select { min-width: 120px !important; }
    .status-bar { padding: 10px !important; gap: 4px !important; flex-wrap: wrap; }
    .status-tab { padding: 6px 10px !important; font-size: 13px; }
    .batch-bar { padding: 10px 12px !important; flex-wrap: wrap; gap: 8px; }

    /* 面板卡片 */
    .panel { padding: 16px !important; }
    .panel-row { flex-direction: column !important; }
    .stat-card { padding: 14px !important; }
    .stat-num { font-size: 24px !important; }

    /* 面包屑缩小 */
    .breadcrumb { padding: 10px 14px !important; font-size: 12px !important; }

    /* 弹窗适配手机 */
    .modal-box { width: 92vw !important; max-width: 380px; padding: 20px 16px !important; max-height: 85vh; overflow-y: auto; }
    .terms-modal { width: 92vw !important; max-width: 420px; }
    .pm-dialog { width: 94vw !important; }

    /* footer 文案 */
    .footer-bottom p { font-size: 11px !important; line-height: 1.8 !important; }

    /* 品类/详情页 */
    .prod-detail-wrap { flex-direction: column !important; }
    .prod-main-image { width: 100% !important; }
    .prod-info { width: 100% !important; }
    .color-swatches, .size-swatches { flex-wrap: wrap; }
    .quality-cards { grid-template-columns: 1fr !important; }

    /* 品牌详情页 */
    .brand-hero { padding: 30px 16px !important; }
}

/* ---------- 移动端底部导航 ---------- */
.mobile-bottom-nav {
    display: none; /* 桌面端隐藏 */
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: 60px;
        background: #fff;
        border-top: 1px solid #e8e8e8;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
        z-index: 200;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mbn-item {
        flex: 1;
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: #888;
        font-size: 11px;
        -webkit-tap-highlight-color: transparent;
    }
    .mbn-item .mbn-icon { font-size: 20px; line-height: 1; }
    .mbn-item.active { color: #cf3024; }
    .mbn-item:active { opacity: 0.7; }
}

/* ---------- 移动端抽屉菜单 ---------- */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 80%; max-width: 320px;
    background: #fff;
    z-index: 300;
    transform: translateX(100%);
    transition: transform .28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-mask {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 299;
}
.mobile-drawer-mask.show { display: block; }
.md-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border-bottom: 1px solid #f0f0f0;
}
.md-head .md-logo { font-size: 20px; font-weight: 700; color: #222; }
.md-close { font-size: 26px; color: #999; cursor: pointer; line-height: 1; }
.md-section { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; }
.md-section-title { font-size: 12px; color: #999; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 1px; }
.md-link {
    display: block; padding: 11px 0;
    color: #333; text-decoration: none;
    font-size: 15px; border-bottom: 1px solid #f7f7f7;
}
.md-link:last-child { border-bottom: none; }
.md-link:active { color: #cf3024; }
.md-sub { display: block; padding: 8px 0 8px 14px; color: #666; font-size: 13px; text-decoration: none; }

/* 管理页（seller/订单/商品）在桌面端隐藏底部导航，保持沉浸 */
@media (min-width: 769px) {
    body.is-admin .mobile-bottom-nav { display: none !important; }
}
