/* Base grid — works for both desktop and mobile */
.eu-vendor-grid {
  display: grid !important;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Desktop: 5 columns, 1 row */
.eu-vendor-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* Equal height cards - applies to all breakpoints */
.eu-vendor-grid li.product {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}

/* Fixed-ratio image so all cards align regardless of source image size */
.eu-vendor-grid li.product a img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
}

/* Push price/button to bottom so text-length differences don't break height */
.eu-vendor-grid li.product .woocommerce-loop-product__title {
  flex-grow: 1;
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 1.3;
}

.eu-vendor-grid li.product .price {
  margin-top: auto;
  font-weight: 600;
}

/* Mobile: 2 columns x 2 rows = show only 4 products, hide the 5th */
@media (max-width: 767px) {
  .eu-vendor-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .eu-vendor-grid li.product:nth-child(5) {
    display: none !important;
  }

  .eu-vendor-grid li.product a img {
    height: 130px; /* slightly shorter on small screens, still equal across all cards */
  }
}