@media (max-width:480px){
  /* Ensure product grid images and meta block span the full width on very small screens */
  .product-grid .grid-item img,
  .product-grid .grid-item-meta{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* Keep product-row as 4 columns between 768px and 1199px (tablet / small-desktop range).
   This prevents the rule from forcing 4 columns on large desktop viewports (e.g. 1920px). */
@media (min-width:769px) and (max-width:1199px){
  .product-row{
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(20px, 3vw, 50px);
    align-items: start;
    box-sizing: border-box;
  }

  /* ensure items are centered inside their cells on wider screens */
  .product-row .product-item{
    justify-self: center;
  }
}

/* Mobile spacing for product-row (smartphone sizes) */
@media (max-width:767px){
  /* Override: on small screens prefer single-column stacking so items center
     (this prevents conflicting 2-column behavior from earlier rules). */

  /* Increase vertical spacing on mobile for the top navigation */
  .gnav{ padding: 1.75rem 1rem; }
  .product-row{
    display: block; /* let style.css handle stacking or use single-column grid */
    width: 100%;
    box-sizing: border-box;
    padding-top: clamp(12px, 3.2vw, 28px);
    padding-bottom: clamp(12px, 3.2vw, 28px);
  }

  .product-row .product-item{
    display:block;
    width:100%;
    max-width:420px; /* keep a nice reading width */
    margin: 0 auto;
    padding-top: clamp(6px, 2.2vw, 12px);
    padding-bottom: clamp(6px, 2.2vw, 12px);
  }

  /* ensure images fill their container and center */
  .product-row .product-item img{
    width:100%;
    max-width:100%;
    height:auto;
    display:block;
    margin:0 auto;
  }

  .product-row .product-caption{
    margin-top: 6px;
    text-align:center;
  }

  .product-row .product-more{
    margin-top: 10px;
    display: block;
    text-align: center;
  }
}
