/* ===== 通用开关：桌面/手机可见性 ===== */
.only-desktop { display:block; }
.only-mobile  { display:none; }

@media (max-width:768px){
  .only-desktop { display:none !important; }
  .only-mobile  { display:block !important; }
}

/* ===== 订单详情 - 移动端商品卡片 ===== */
.gwh-mcard{
  border:1px solid #eee;
  border-radius:10px;
  padding:10px;
  margin-bottom:10px;
  background:#fff;
}
.gwh-mcard .name{font-weight:600;line-height:1.3;}
.gwh-mcard .meta{color:#888;font-size:12px;margin-top:2px;}
.gwh-mcard .price{font-size:14px;margin-top:6px;}
.gwh-mcard .total{font-weight:700;margin-top:4px;}
.gwh-mcard img{max-width:90px;height:auto;border-radius:6px;display:block;}

/* ===== 金额不换行（法/波兰的空格千位不折行） ===== */
.amount-nowrap{
  white-space: nowrap !important;
  line-height: 1;
  display: inline-block;
}
@media (max-width:360px){
  .amount-nowrap{
    font-size:16px !important;
  }
}

/* ===== 手机端购物车：只隐藏“商品名称”(第2列)，避免横向滚动 ===== */
@media (max-width:768px){

  /* 1) 主要表（我们在 cart.twig 给了 .cart-table） */
  .cart-table thead tr th:nth-child(2),
  .cart-table tbody tr td:nth-child(2){
    display: none !important;
  }

  /* 2) 兜底：即使没有 .cart-table，也只影响第一个产品表，不动下面的合计表 */
  #checkout-cart .table-responsive:first-of-type > .table tr > th:nth-child(2),
  #checkout-cart .table-responsive:first-of-type > .table tr > td:nth-child(2){
    display: none !important;
  }

  /* 恢复型号/单价为可见（如果之前隐藏过） */
  .cart-table thead tr th:nth-child(3),
  .cart-table tbody tr td:nth-child(3),
  .cart-table thead tr th:nth-child(5),
  .cart-table tbody tr td:nth-child(5){
    display: table-cell !important;
  }

  /* 缩小缩略图与数量输入区，让行更紧凑 */
  .cart-table .img-thumbnail{
    max-width:60px;
    height:auto;
  }
  .cart-table .input-group{
    max-width:140px;
  }
}

/* ===== Mobile：分类菜单默认展开，隐藏汉堡按钮 ===== */
@media (max-width:768px){

  /* 隐藏右侧三横线按钮（两种类名都兼容） */
  #menu .btn-navbar,
  #menu .navbar-toggle{
    display: none !important;
  }

  /* 强制把折叠容器设为展开（兼容两种容器类） */
  #menu .navbar-ex1-collapse,
  #menu .navbar-ex1-collapse.collapse,
  #menu .navbar-collapse,
  #menu .navbar-collapse.collapse{
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    padding: 0 !important;
  }

  /* 万一被 .collapse.in 控制高度，再保险一次 */
  #menu .collapse.in{
    height: auto !important;
  }

  /* 列表竖排更紧凑 */
  #menu .nav.navbar-nav > li{
    float: none !important;
  }
}
