/* ---------- Product Grid Layout ---------- */
.products.products--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 4 columns on desktop */
  gap: 20px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* ---------- Product Card ---------- */
.products.products--grid .product {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #eee;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0; /* remove default figure margin */
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.products.products--grid .product:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

/* ---------- Product Image Wrapper ---------- */
.products.products--grid .product__image {
  flex-shrink: 0;
  height: 300px;
  display: flex;
  align-items: center; /* center image vertically */
  justify-content: center; /* center horizontally */
  overflow: hidden; /* ensure no overflow */
  background-color: #f9f9f9;
  width: 100%;
  position: relative;
}

.products.products--grid .product__image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ensures full image is visible inside container */
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

/* optional — disable zoom on hover if it causes overflow */
.products.products--grid .product:hover .product__image img {
  transform: none;
}

/* ---------- Product Info ---------- */
.products.products--grid .product__info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 10px;
}

.products.products--grid .product__title h3 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 8px;
}

.products.products--grid .product__title a {
  color: #222;
  text-decoration: none;
}

.products.products--grid .product__title a:hover {
  text-decoration: underline;
}

/* ---------- Call-to-Action Button ---------- */
.products.products--grid .product__cta {
  margin-top: auto;
}

.products.products--grid .button.button--theme--primary {
  display: inline-block;
  padding: 8px 14px;
  background-color: #0072ce;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.products.products--grid .button.button--theme--primary:hover {
  background-color: #005da3;
}

/* ---------- Fix Figure Width ---------- */
.products.products--grid figure.product {
  min-width: 100% !important;
}

.products.products--grid .product__image .img-wrap {
  width: 100% !important;
  clear: unset !important;
  margin: 0 !important;
  height: inherit !important;
  background: #fff !important;
}

.products.products--grid .product__image a {
  height: inherit !important;
}

.products.products--grid .product__cta {
  margin: 0 !important;
}
/* ---------- Responsive Breakpoints ---------- */

/* 3 columns on medium screens */
@media (max-width: 1200px) {
  .products.products--grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2 columns on tablets */
@media (max-width: 900px) {
  .products.products--grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column on phones */
@media (max-width: 600px) {
  .products.products--grid {
    grid-template-columns: 1fr;
  }

  .products.products--grid .product__image {
    height: 250px;
  }
}