/* PSDFA — global product grid sizing.
 * Card presentation intentionally remains in product-card-v2.css.
 * These rules only control the outer grid so the theme's desktop/tablet/mobile
 * column settings are respected everywhere product cards are listed. */

body:not(.single-product) .psdfa-global-products-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--psdfa-archive-cols, 4), minmax(0, 1fr)) !important;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

body:not(.single-product) .psdfa-global-products-grid::before,
body:not(.single-product) .psdfa-global-products-grid::after {
  display: none !important;
  content: none !important;
}

body:not(.single-product) .psdfa-global-products-grid > li.product.psdfa-product-card {
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  float: none !important;
}

/* The archive shell is narrower when its desktop sidebar is visible, so a
 * slightly tighter gap keeps the chosen column count usable without changing
 * the card itself. */
.psdfa-market-shop-results .psdfa-global-products-grid {
  gap: 13px;
}

@media (max-width: 1080px) {
  body:not(.single-product) .psdfa-global-products-grid {
    grid-template-columns: repeat(var(--psdfa-archive-tablet-cols, 3), minmax(0, 1fr)) !important;
    gap: 14px;
  }
}

@media (max-width: 760px) {
  body:not(.single-product) .psdfa-global-products-grid {
    grid-template-columns: repeat(var(--psdfa-archive-mobile-cols, 2), minmax(0, 1fr)) !important;
    gap: 10px;
  }
}
