/* ==========================================================================
   mpf-mobile.css — 移动底部快捷栏（.mpf-mobile-tabbar）+ 平板/手机兜底
   底栏由 functions.php::mpf_mobile_tabbar() 输出；≤860px 显示，桌面隐藏。
   若 G7 启用 Kadence 原生移动 Header/底部购物车条，用 mpf_enable_mobile_tabbar 过滤器关闭本栏，二选一。
   ========================================================================== */

.mpf-mobile-tabbar { display: none; }

@media (max-width: 860px) {
  body { padding-bottom: 64px; }

  .mpf-mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
    background: rgba(255, 255, 255, .98); border-top: 1px solid var(--mpf-line);
    box-shadow: 0 -4px 18px rgba(44, 62, 80, .10);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    backdrop-filter: saturate(1.2);
  }
  .mpf-mobile-tabbar .mpf-tab {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 4px 0; color: var(--mpf-ink-500); font-size: 11px; font-weight: 600;
    position: relative; min-width: 0;
  }
  .mpf-mobile-tabbar .mpf-tab svg { width: 22px; height: 22px; stroke-width: 2; }
  .mpf-mobile-tabbar .mpf-tab.is-active { color: var(--mpf-ink); }
  .mpf-mobile-tabbar .mpf-tab.is-active svg { color: var(--mpf-coral-deep); }
  .mpf-mobile-tabbar .mpf-tab.is-active::before {
    content: ""; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 0 0 3px 3px;
    background: var(--mpf-coral);
  }
  /* 购物车角标 */
  .mpf-mobile-tabbar .mpf-cart-count {
    position: absolute; top: -2px; left: calc(50% + 7px); min-width: 17px; height: 17px; padding: 0 5px;
    background: var(--mpf-coral); color: var(--mpf-ink); border-radius: var(--mpf-radius-pill);
    font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; display: none;
    border: 1.5px solid #fff; box-sizing: content-box;
  }
  .mpf-mobile-tabbar .mpf-cart-count.is-visible { display: inline-flex; align-items: center; justify-content: center; }

  /* 购物车 / 结账页隐藏底栏，避免遮挡 WC 主操作按钮 */
  body.mpf-cart .mpf-mobile-tabbar,
  body.mpf-checkout .mpf-mobile-tabbar { display: none; }
  body.mpf-cart, body.mpf-checkout { padding-bottom: 0; }

  /* Header 紧凑 */
  .custom-logo, .site-logo img { max-height: 40px; }
  .header-action a, .search-toggle, .kadence-header-account a { width: 38px; height: 38px; }
  .site-header-cart .cart-contents { width: 38px; height: 38px; }

  /* 容器边距 */
  .site-container, .content-wrap, .entry-content-wrap { padding-left: 16px; padding-right: 16px; }

  /* 通用按钮在窄屏更易点 */
  .button, button.button, a.button, .wp-block-button__link { min-height: 48px; }

  /* PDP 加购区 */
  .single-product .cart { gap: 10px; }
  .single-product .quantity { width: 100%; justify-content: space-between; }
  .single-product .quantity input.qty { flex: 1; }

  /* 结账/购物车表格横向滚动兜底（卡片化由 mpf-cart-checkout.css 在 560 处理） */
  .woocommerce-checkout #order_review table.shop_table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 560px) {
  body { padding-bottom: 60px; }
  .mpf-mobile-tabbar .mpf-tab span { font-size: 10.5px; }
  .mpf-mobile-tabbar .mpf-tab svg { width: 21px; height: 21px; }

  /* 标题与区块间距 */
  .mpf-section { padding: 36px 0; }
  .woocommerce-products-header__title { font-size: 26px; }
  .single-product .product_title.entry-title { font-size: 25px; }

  /* 表单两列改单列 */
  .woocommerce-checkout .form-row-first, .woocommerce-checkout .form-row-last { width: 100%; }

  /* 博客/内容页图片圆角 */
  .entry-content img, .entry-content .wp-block-image { border-radius: var(--mpf-radius-md); }
}

/* 超小屏（≤360px）进一步压缩 */
@media (max-width: 360px) {
  .mpf-mobile-tabbar .mpf-tab span { display: none; }
  .mpf-mobile-tabbar .mpf-tab { padding: 6px 0; }
}
