/* Mobile-only: Cart page alignment fixes */
@media (max-width: 767.98px) {
  /* Hide table header on mobile */
  #cart_page table thead { display: none; }

  /* Card-like rows */
  #cart_page table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "product" "qty" "totals" "actions";
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
  }

  /* Product cell */
  #cart_page table tbody tr td:nth-child(1) { grid-area: product; }
  #cart_page table tbody tr td:nth-child(1) .flex { align-items: center; gap: 12px; }
  #cart_page table tbody tr td:nth-child(1) img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
  #cart_page table tbody tr td:nth-child(1) .font-medium { font-size: 15px; }

  /* Qty cell */
  #cart_page table tbody tr td:nth-child(3) { grid-area: qty; }
  #cart_page table tbody tr td:nth-child(3) .flex { justify-content: flex-start; gap: 12px; }
  #cart_page table tbody tr [data-qty] { width: 48px; height: 48px; border-radius: 10px; }
  #cart_page table tbody tr td:nth-child(3) span { min-width: 36px; text-align: center; font-weight: 600; }

  /* Price + Total stacked */
  #cart_page table tbody tr td:nth-child(2),
  #cart_page table tbody tr td:nth-child(4) { grid-area: totals; }
  #cart_page table tbody tr td:nth-child(2),
  #cart_page table tbody tr td:nth-child(4) { display: flex; justify-content: space-between; align-items: baseline; }
  #cart_page table tbody tr td:nth-child(2) span,
  #cart_page table tbody tr td:nth-child(4) span { font-variant-numeric: tabular-nums; }

  /* Actions (Remove) */
  #cart_page table tbody tr td:nth-child(5) { grid-area: actions; }
  #cart_page table tbody tr td:nth-child(5) { display: flex; justify-content: flex-end; }
  #cart_page table tbody tr td:nth-child(5) [data-remove] {
    min-width: 48px; min-height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 14px; border-radius: 10px;
  }

  /* Spacing consistency */
  #cart_page .px-3, #cart_page .py-3, #cart_page .p-2 { padding: 12px !important; }
}
