/* ============================================================
 * window4_mobile.css - 商家后台 / 特定模块移动端覆盖（窗口4，独占）
 * 本文件只在 <768px 时生效，处理 seller 侧栏抽屉、seller 头部等。
 * ============================================================ */

@media (max-width: 767px) {

  /* ---------- 商家工作台布局：侧栏抽屉化 ---------- */
  .seller-layout { display: block !important; }

  .seller-sidebar {
    position: fixed !important;
    left: -260px; top: 0; bottom: 0;
    width: 240px !important;
    background: #fff; z-index: 1090;
    transition: left .25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
    overflow-y: auto;
  }
  body.sidebar-open .seller-sidebar { left: 0; }

  .seller-main { margin-left: 0 !important; padding: 0 !important; }

  /* 汉堡按钮（由 JS 注入 .menu-toggle，这里兜底样式） */
  .menu-toggle {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: transparent; border: none;
    font-size: 22px; cursor: pointer;
  }

  /* 遮罩层（JS 注入） */
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 1080; opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  /* seller 头部适配 */
  .seller-header {
    display: flex !important; align-items: center;
    padding: 8px 12px !important;
    gap: 8px; flex-wrap: nowrap;
  }
  .seller-header h2 { font-size: 15px !important; flex: 1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .seller-header-actions { flex-shrink: 0; }
  .seller-header-actions .btn { min-height: 36px; padding: 4px 8px; font-size: 12px; }

  /* seller 主内容 */
  .seller-content, main.seller-content, .seller-main > main { padding: 12px !important; }

  /* seller 数据卡片 */
  .seller-card { margin-bottom: 12px; border-radius: 10px; }
  .seller-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

  /* seller 表格（兼容 .seller-table / 原生 table） */
  .seller-table-wrap, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.seller-table { min-width: 600px; }

  /* db-topbar 适配 */
  .db-topbar { padding: 8px 12px !important; flex-wrap: wrap; gap: 6px; }
  .db-title { font-size: 15px !important; flex: 1; }

  /* ---------- user 后台：底部 tab 预留 ---------- */
  .user-bottom-tab {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid #eee;
    display: flex; z-index: 900;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .user-bottom-tab a {
    flex: 1; text-align: center; padding: 8px 0;
    font-size: 11px; color: #666; text-decoration: none;
    min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .user-bottom-tab a.active { color: #667eea; }

  /* ---------- 商品详情：购买按钮固定底部 ---------- */
  .product-buy-bar {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid #eee;
    display: flex; gap: 8px; padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 800;
  }
  .product-buy-bar .btn { flex: 1; margin: 0; }
}

/* 桌面隐藏汉堡按钮 */
.menu-toggle, .sidebar-backdrop { display: none; }
