/* oxford-cart-fix.css - C 方案 /cart/ 页面定制样式
 * 强制桌面 6 列布局 + 修复 sub-total 对齐 + 修复 coupon input 错位
 */

body.woocommerce-cart.woocommerce-page .page-header,
body.woocommerce-cart.woocommerce-page .entry-header,
body.woocommerce-cart.woocommerce-page header.page-header {
  display: none !important;
}

body.woocommerce-cart.woocommerce-page .site-main {
  padding-top: 20px;
}

body.woocommerce-cart.woocommerce-page .woocommerce {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Cart 标题居左 */
body.woocommerce-cart.woocommerce-page h2:first-of-type,
body.woocommerce-cart.woocommerce-page .woocommerce > h2 {
  font-size: 28px;
  font-weight: 700;
  color: #421B57;
  margin-bottom: 20px;
  text-align: left;
  border-bottom: 2px solid #FFD375;
  padding-bottom: 10px;
}

/* 关键:强制表格始终水平布局(无视 < 768px 的响应式块) */
body.woocommerce-cart.woocommerce-page table.shop_table {
  border: 1px solid #EEEEEE !important;
  border-radius: 0 !important;
  overflow: visible;
  width: 100%;
  background: #fff;
  display: table !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
  margin-bottom: 0 !important;
}

body.woocommerce-cart.woocommerce-page table.shop_table thead {
  display: table-header-group !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tbody {
  display: table-row-group !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tr {
  display: table-row !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table th,
body.woocommerce-cart.woocommerce-page table.shop_table td {
  display: table-cell !important;
  border-bottom: 1px solid #EEEEEE !important;
  border-right: 1px solid #EEEEEE !important;
  vertical-align: middle !important;
  padding: 14px 12px !important;
  float: none !important;
  text-align: left;
  word-wrap: break-word;
}

/* th 表头居中,加紫色底 */
body.woocommerce-cart.woocommerce-page table.shop_table th {
  background: #F5F0FA !important;
  color: #421B57 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-align: center !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  letter-spacing: 0.3px;
}

/* 表头文 - 显示具体列名(把 sr-only 强制可见) */
body.woocommerce-cart.woocommerce-page table.shop_table thead .screen-reader-text {
  position: static !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  clip-path: none !important;
  overflow: visible !important;
  white-space: normal !important;
  font-size: 13px !important;
  color: #421B57 !important;
  font-weight: 700 !important;
  text-transform: uppercase;
}

/* 各列宽度 - 用 table-layout: fixed */
body.woocommerce-cart.woocommerce-page table.shop_table colgroup col,
body.woocommerce-cart.woocommerce-page table.shop_table thead th:nth-child(1),
body.woocommerce-cart.woocommerce-page table.shop_table tbody td:nth-child(1) {
  width: 8% !important;
  text-align: center !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table thead th:nth-child(2),
body.woocommerce-cart.woocommerce-page table.shop_table tbody td:nth-child(2) {
  width: 14% !important;
  text-align: center !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table thead th:nth-child(3),
body.woocommerce-cart.woocommerce-page table.shop_table tbody td:nth-child(3) {
  width: 38% !important;
  text-align: left !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table thead th:nth-child(4),
body.woocommerce-cart.woocommerce-page table.shop_table tbody td:nth-child(4),
body.woocommerce-cart.woocommerce-page table.shop_table thead th:nth-child(6),
body.woocommerce-cart.woocommerce-page table.shop_table tbody td:nth-child(6) {
  width: 13% !important;
  text-align: right !important;
  white-space: nowrap !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table thead th:nth-child(5),
body.woocommerce-cart.woocommerce-page table.shop_table tbody td:nth-child(5) {
  width: 14% !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* td 内部 dl 包装:移除 wc 模板里的 "Product:" / "Price:" / "Subtotal:" / "Quantity:" 标签 */
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl,
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl dt,
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl dd,
body.woocommerce-cart.woocommerce-page table.shop_table tbody td p,
body.woocommerce-cart.woocommerce-page table.shop_table tbody td small {
  margin: 0 !important;
  padding: 0 !important;
  display: inline !important;
  font-size: 14px !important;
  color: inherit !important;
  font-weight: inherit !important;
  background: none !important;
  border: none !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl {
  display: block !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl dt {
  display: none !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl dd {
  display: inline !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tbody td dl dd p {
  display: inline !important;
}

/* 商品图 */
body.woocommerce-cart.woocommerce-page td.product-thumbnail img {
  width: 90px !important;
  height: 90px !important;
  object-fit: cover !important;
  border-radius: 4px;
  border: 1px solid #EEEEEE;
  display: inline-block;
}

/* 商品名 */
body.woocommerce-cart.woocommerce-page td.product-name a {
  color: #421B57;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

/* 移除 X 按钮 */
body.woocommerce-cart.woocommerce-page td.product-remove a {
  color: #C381FF !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  display: inline-block;
  line-height: 1;
}
body.woocommerce-cart.woocommerce-page td.product-remove a:hover {
  color: #421B57 !important;
}

/* 数量输入框 */
body.woocommerce-cart.woocommerce-page input.qty {
  border: 1px solid #C381FF !important;
  border-radius: 4px !important;
  padding: 6px 8px !important;
  width: 60px !important;
  text-align: center;
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
}

/* 数量加减按钮容器(若有) */
body.woocommerce-cart.woocommerce-page .quantity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 价格 / Subtotal 字体 - 不加冒号 */
body.woocommerce-cart.woocommerce-page td.product-price,
body.woocommerce-cart.woocommerce-page td.product-subtotal {
  font-weight: 600;
  color: #421B57;
  font-size: 14px;
}

/* Update Cart 按钮 - 紫色 */
body.woocommerce-cart.woocommerce-page button[name="update_cart"],
body.woocommerce-cart.woocommerce-page button[name="apply_coupon"] {
  background: linear-gradient(135deg, #C381FF 0%, #7B2D77 100%) !important;
  color: #fff !important;
  border-radius: 4px !important;
  padding: 10px 22px !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 13px;
}

/* Coupon input - 修复错位,小一点 */
body.woocommerce-cart.woocommerce-page input[name="coupon_code"] {
  border: 1px solid #C381FF !important;
  border-radius: 4px !important;
  padding: 6px 10px !important;
  width: 160px !important;
  font-size: 13px !important;
  vertical-align: middle;
  margin-right: 6px;
}

/* actions 行 - 修复 coupon 错位 */
body.woocommerce-cart.woocommerce-page table.shop_table tr td.actions {
  border-bottom: 1px solid #EEEEEE !important;
  text-align: left !important;
  padding: 16px 12px !important;
  background: #FAF7FC;
}
body.woocommerce-cart.woocommerce-page table.shop_table tr td.actions .coupon {
  display: inline-flex !important;
  align-items: center;
  margin-right: 12px !important;
  float: left !important;
  vertical-align: middle;
  white-space: nowrap;
  gap: 6px;
}
body.woocommerce-cart.woocommerce-page table.shop_table tr td.actions .coupon label {
  display: none !important;
}
body.woocommerce-cart.woocommerce-page table.shop_table tr td.actions button[name="update_cart"] {
  display: inline-block !important;
  width: auto !important;
  margin-top: 0 !important;
  float: right;
}

/* Cart Totals 区域 */
body.woocommerce-cart.woocommerce-page .cart_totals {
  background: #FAF7FC !important;
  border: 1px solid #EEEEEE !important;
  border-radius: 8px;
  padding: 20px !important;
  margin-top: 30px;
  width: 100% !important;
  float: none !important;
}
body.woocommerce-cart.woocommerce-page .cart_totals h2 {
  font-size: 22px !important;
  color: #421B57 !important;
  border-bottom: 1px solid #C381FF !important;
  padding-bottom: 8px;
  margin-top: 0 !important;
}
body.woocommerce-cart.woocommerce-page .cart_totals table th,
body.woocommerce-cart.woocommerce-page .cart_totals table td {
  padding: 10px 8px !important;
  border: none !important;
  background: transparent !important;
}
body.woocommerce-cart.woocommerce-page .cart_totals table th {
  text-align: left !important;
  color: #5B4D75 !important;
  font-weight: 500 !important;
}
body.woocommerce-cart.woocommerce-page .cart_totals table td {
  text-align: right !important;
  color: #421B57 !important;
  font-weight: 600 !important;
}
body.woocommerce-cart.woocommerce-page .cart_totals .order-total th,
body.woocommerce-cart.woocommerce-page .cart_totals .order-total td {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #421B57 !important;
  border-top: 2px solid #C381FF !important;
  padding-top: 14px !important;
}

/* Proceed to Checkout 按钮 */
body.woocommerce-cart.woocommerce-page .wc-proceed-to-checkout {
  text-align: right !important;
  padding: 16px 0 !important;
}
body.woocommerce-cart.woocommerce-page .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-cart.woocommerce-page a.checkout-button {
  background: linear-gradient(135deg, #C381FF 0%, #7B2D77 100%) !important;
  color: #fff !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  padding: 14px 32px !important;
  display: inline-block !important;
  text-align: center !important;
  text-transform: uppercase;
  font-size: 15px !important;
  text-decoration: none !important;
  border: none !important;
  cursor: pointer;
  letter-spacing: 0.5px;
}
body.woocommerce-cart.woocommerce-page .wc-proceed-to-checkout a.checkout-button:hover,
body.woocommerce-cart.woocommerce-page a.checkout-button:hover {
  background: linear-gradient(135deg, #7B2D77 0%, #421B57 100%) !important;
}

/* 隐藏 Elementor cart 模板用 ::before 注入的 data-title 标签
 * Elementor Pro 的 widget-woocommerce-cart 用 td::before { content: attr(data-title) } 显示列标题
 * 桌面端不应该出现,只用于移动端 fallback。强制隐藏避免和实际产品名连成 "Product:Tesamorelin" */
body.woocommerce-cart.woocommerce-page table.shop_table td::before,
body.woocommerce-cart.woocommerce-page table.shop_table th::before {
  display: none !important;
  content: none !important;
}
