/* ============================================================
   mobile-only.css — 海昊出口网手机端样式
   【重要】所有规则都在 @media 内部，绝不影响 PC 端
   ============================================================ */

@media (max-width: 768px) {

/* ── 全局：body padding ── */
body {
    padding-top: 60px;       /* 固定 header 高 */
    padding-bottom: 64px;    /* 底部导航高 */
}

/* ============================================================
   ① 汉堡按钮 — header 容器内，左侧第一个元素
   ============================================================ */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1001; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.header-content { display: flex !important; align-items: center; gap: 8px !important; }

.mobile-menu-btn {
    display: flex !important;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    order: -1;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(233,69,96,0.35);
    transition: transform 0.15s, background 0.15s;
}
.mobile-menu-btn:active { transform: scale(0.9); background: var(--primary-dark); }
.mobile-menu-btn.active { background: var(--secondary); }

/* ── Top Bar 隐藏 ── */
.top-bar { display: none !important; }

/* ── Logo 紧凑 ── */
.header .logo { flex: 1; min-width: 0; overflow: hidden; }
.header .logo-main {
    font-size: 15px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.header .logo-sub { display: none !important; }

/* ── 桌面搜索框隐藏（手机端用独立搜索条） ── */
.header .header-search { display: none !important; }

/* ── 桌面端图标组隐藏（手机端用底部导航） ── */
/* .header-cart 在 header-content 里会随 flex 排列 */
.header .header-wishlist,
.header .header-compare { display: none !important; }

/* ── 桌面导航菜单隐藏 ── */
.main-nav { display: none !important; }

/* ============================================================
   ② 手机搜索条 — 固定在 header 下方
   ============================================================ */
.mobile-search-bar {
    display: flex !important;
    position: fixed;
    top: 60px;
    left: 0; right: 0;
    z-index: 1000;
    background: #fff;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    gap: 8px;
    align-items: center;
}
.mobile-search-bar input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: #f8f9fa;
    transition: border-color 0.2s, background 0.2s;
}
.mobile-search-bar input:focus { border-color: var(--primary); background: #fff; }
.mobile-search-bar button {
    width: 40px; height: 40px;
    background: var(--primary);
    border: none; border-radius: 50%;
    color: #fff; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; cursor: pointer;
    box-shadow: 0 2px 8px rgba(233,69,96,0.3);
}

/* 产品列表页多一行搜索条 */
body { padding-top: 108px; }

/* ============================================================
   ③ 侧滑导航面板
   ============================================================ */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s;
}
.mobile-nav-overlay.open { display: block; opacity: 1; }

.mobile-nav-panel {
    position: fixed;
    top: 0; left: -82%;
    width: 82%; max-width: 300px;
    height: 100%;
    background: #fff;
    z-index: 10003;
    overflow-y: auto;
    transition: left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.mobile-nav-panel.open { left: 0; }

/* 面板头部 */
.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--secondary);
    color: #fff;
    position: sticky; top: 0;
    z-index: 1;
}
.mobile-nav-brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; font-size: 16px;
    text-decoration: none;
}
.mobile-nav-brand i { font-size: 22px; color: var(--primary); }
.mobile-nav-close-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none; color: #fff;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* 面板内容 */
.mobile-nav-body { padding: 8px 0 110px; }
.mobile-nav-section-title {
    padding: 12px 16px 6px;
    font-size: 11px; font-weight: 700;
    color: #999; text-transform: uppercase; letter-spacing: 1px;
}
.mobile-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    color: #333; font-size: 15px; text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s, color 0.15s;
}
.mobile-nav-link:active { background: #fdf2f4; color: var(--primary); }
.mobile-nav-link i { width: 20px; text-align: center; color: #888; font-size: 16px; }
.mobile-nav-link .nav-badge {
    margin-left: auto;
    background: var(--primary); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
}
.mobile-nav-link.danger { color: #e74c3c; }
.mobile-nav-divider { height: 1px; background: #f0f0f0; margin: 8px 0; }

/* 底部货币/语言 */
.mobile-nav-footer {
    position: fixed;
    bottom: 0; left: 0;
    width: 82%; max-width: 300px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}
.mobile-nav-footer-label {
    font-size: 11px; color: #999;
    margin-bottom: 8px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.mobile-nav-currencies, .mobile-nav-langs {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.mobile-nav-currencies button, .mobile-nav-langs button {
    padding: 5px 12px; border-radius: 16px;
    border: 1.5px solid #ddd; background: #fff;
    font-size: 13px; font-weight: 500;
    cursor: pointer; color: #444;
    transition: all 0.15s;
}
.mobile-nav-currencies button:active,
.mobile-nav-langs button:active { transform: scale(0.95); }
.mobile-nav-currencies button.active,
.mobile-nav-langs button.active {
    background: var(--primary);
    border-color: var(--primary); color: #fff;
}

/* ============================================================
   ④ 底部固定导航栏
   ============================================================ */
.mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
}
.mobile-bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    text-decoration: none; color: #888;
    font-size: 10px; font-weight: 600;
    position: relative;
    transition: color 0.15s, transform 0.15s;
    background: #fff; cursor: pointer;
    border: none; -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav-item:active { color: var(--primary); transform: scale(0.93); }
.mobile-bottom-nav-item.active { color: var(--primary); }
.mobile-bottom-nav-item i { font-size: 20px; }
.mobile-bottom-nav-item .nav-icon-badge {
    position: absolute; top: 4px;
    right: calc(50% - 16px);
    background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* ============================================================
   ⑤ 产品列表页 — 筛选抽屉
   ============================================================ */
.mobile-filter-btn-wrap { display: block !important; }

.mobile-filter-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 10004;
    opacity: 0; transition: opacity 0.3s;
}
.mobile-filter-overlay.open { display: block; opacity: 1; }

.mobile-filter-drawer {
    position: fixed; top: 0;
    right: -88%; width: 85%; max-width: 320px;
    height: 100%; background: #fff;
    z-index: 10005; overflow-y: auto;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.mobile-filter-drawer.open { right: 0; }

.mobile-filter-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid #eee;
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.mobile-filter-head h3 { font-size: 16px; font-weight: 700; color: #333; margin: 0; }
.mobile-filter-close-btn {
    width: 34px; height: 34px; border-radius: 50%;
    background: #f5f5f5; border: none; font-size: 16px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mobile-filter-body { padding: 16px; }
.filter-group { margin-bottom: 20px; }
.filter-group-title {
    font-size: 12px; font-weight: 700; color: #333;
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.filter-group label {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 8px;
    cursor: pointer; font-size: 14px; color: #444;
    transition: background 0.15s;
}
.filter-group label:active { background: #fdf2f4; color: var(--primary); }
.filter-group label input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
.filter-group label .filter-count { margin-left: auto; color: #999; font-size: 12px; }

.mobile-filter-foot {
    display: flex; gap: 10px;
    padding: 14px 16px; border-top: 1px solid #eee;
    position: sticky; bottom: 0; background: #fff;
}
.mobile-filter-foot button {
    flex: 1; height: 44px; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    border: none; transition: transform 0.15s;
}
.mobile-filter-foot button:active { transform: scale(0.97); }
.mobile-filter-reset { background: #f0f0f0; color: #666; }
.mobile-filter-apply { background: var(--primary); color: #fff; }

/* 产品网格 — 手机端 2 列 */
.products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
.product-card .product-name { font-size: 13px !important; -webkit-line-clamp: 2 !important; }
.product-card .product-bottom { flex-direction: column !important; align-items: flex-start !important; gap: 6px !important; }
.product-card .price { font-size: 15px !important; }
.product-card .btn-add-cart { width: 100% !important; padding: 7px 0 !important; font-size: 12px !important; }
.products-toolbar { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; margin-bottom: 12px !important; }

/* ============================================================
   ⑥ 返回顶部按钮
   ============================================================ */
.mobile-back-to-top {
    display: flex !important;
    position: fixed; right: 14px; bottom: 78px;
    width: 42px; height: 42px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 50%;
    font-size: 16px;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(233,69,96,0.4);
    cursor: pointer; z-index: 999;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    -webkit-tap-highlight-color: transparent;
}
.mobile-back-to-top.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   ⑦ 其他页面适配
   ============================================================ */
/* 首页 */
.hero-slider { height: 220px !important; }
.hero-slider .slide { height: 220px !important; }
.category-grid { grid-template-columns: repeat(2, 1fr) !important; }
.featured-grid, .new-arrivals-grid, .best-seller-grid { grid-template-columns: repeat(2, 1fr) !important; }

/* 产品详情 */
.product-detail-grid { grid-template-columns: 1fr !important; gap: 16px !important; }

/* 博客 */
.blog-grid { grid-template-columns: 1fr !important; }

/* 购物车 */
.cart-layout { grid-template-columns: 1fr !important; }
.order-summary { position: static !important; margin-top: 16px !important; }

/* 登录/注册 */
.auth-container { padding: 16px !important; }
.auth-card { box-shadow: none !important; border: 1px solid #eee !important; border-radius: 12px !important; }

/* 表格横向滚动 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* WhatsApp — 避开底部导航 */
.whatsapp-float { right: 14px !important; left: auto !important; bottom: 80px !important; }

} /* END @media (max-width: 768px) */

@media (max-width: 375px) {
    .products-grid { gap: 8px !important; }
    .product-card .product-name { font-size: 12px !important; }
}
