/* ============================================================
   YITH Compare 对比页移动端适配（goodao 主题）
   仅在 ?action=yith-woocompare-view-table 请求时由 functions.php 挂载，
   因为对比页是 template_redirect 渲染的独立页面，不加载主题 style.css。

   问题：插件用 DataTables + FixedColumns 渲染对比表格，FixedColumns 会给
   .dataTables_scrollHead 设 overflow:hidden 并克隆左侧固定列（.DTFC_Left*Wrapper），
   在手机（<768px）上宽表格被裁切且无法横向滚动，右侧产品列完全看不到。

   方案：隐藏克隆的固定列，放开滚动容器，让表格整体可横向滑动。
   ============================================================ */

@media (max-width: 768px) {

  /* 放开被 FixedColumns 锁死的滚动容器 */
  .dataTables_scroll,
  .dataTables_scrollHead,
  .dataTables_scrollBody,
  .DTFC_ScrollWrapper,
  body #yith-woocompare {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* 表格保持最小宽度，产品列不被压缩变形 */
  .dataTables_scrollHeadInner,
  body #yith-woocompare table.compare-list {
    min-width: 560px !important;
  }

  /* 隐藏克隆出来的左侧固定列（原表第一列仍可滚动回来看） */
  .DTFC_LeftWrapper,
  .DTFC_LeftHeadWrapper,
  .DTFC_LeftBodyWrapper {
    display: none !important;
  }

  body #yith-woocompare table.compare-list {
    margin-left: 0 !important;
  }
}
