/* Products page: four products per row on every screen, like the homepage shelf.
   On phones each card becomes a small tile: photo, two-line name, price and an icon-only add button. */
#productsGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 639px) {
  #productsGrid { gap: 6px; }
  #productsGrid .product-item { padding: 4px; border-radius: 12px; }
  #productsGrid .product-item > div:first-child { border-radius: 8px; }
  #productsGrid .product-item > div:first-child > span { font-size: 9px; line-height: 12px; padding: 2px 4px; top: 4px; right: 4px; border-radius: 4px; }
  #productsGrid .product-item > p.truncate { display: none; }
  #productsGrid .product-item h3 { font-size: 11px; line-height: 16px; min-height: 32px; margin-top: 6px; }
  #productsGrid .product-item > div:last-child { flex-direction: column; align-items: stretch; gap: 4px; padding-top: 4px; margin-top: auto; }
  #productsGrid .product-item > div:last-child p { font-size: 13px; line-height: 18px; }
  #productsGrid .product-item button[data-add] { font-size: 0; height: 30px; margin-top: 2px; border-radius: 8px; gap: 0; }
  #productsGrid .product-item button[data-add] .material-symbols-outlined { font-size: 18px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  #productsGrid { gap: 10px; }
  #productsGrid .product-item h3 { font-size: 13px; }
}
