
/* Product grid */
ul.products.wmo-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 !important;
}

ul.products.wmo-products-grid::before,
ul.products.wmo-products-grid::after {
  display: none !important;
}

ul.products.wmo-products-grid li.product.wmo-product-card {
  position: relative;
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
}

/* Product card */
.wmo-product-card {
  display: flex;
  flex-direction: column;
  max-width: 400px;
  padding: 3rem 1.5rem !important;
}
/* vertical borders */
ul.products.wmo-products-grid li.product.wmo-product-card::after {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  right: 0;
  width: 2px;
  background: var(--brand-primary-color-dark);
  opacity: 0.3;
}

/* horizontal borders */
ul.products.wmo-products-grid li.product.wmo-product-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand-primary-color-dark);
  opacity: 0.3;
}

/* remove right border on every 3rd item */
ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(3n)::after {
  display: none;
}

/* optional: remove bottom border on last row */
ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(n + 4):nth-last-child(-n + 3)::before,
ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(n + 4):nth-last-child(-n + 3) ~ li.product.wmo-product-card::before {
  display: none;
}

.wmo-product-card__image-link {
  display: block;
  min-height: 200px;
  max-height: 200px;
  width: 100%;
  margin-bottom: 1.5rem;
  text-decoration: none;
}
.wmo-product-card__image-link img {
    max-height: 200px;
    object-fit: contain;
}

ul.products.wmo-products-grid li.product a img.wmo-product-card__image {
  display: block;
  width: 100%;
  max-height: 200px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.wmo-product-card__body {
  display: grid;
  grid-template-rows:
    auto      /* title */
    auto      /* desc */
    1fr       /* spacer */
    auto      /* price */
    auto;     /* button */
  height: 100%;
}

.wmo-product-card__title {
    min-height: 60px;
    max-height: 60px;
    padding-bottom: 1rem !important;
  font-size: 1.25rem !important;
  font-weight: 700;
  color: var(--brand-header-text-color);
  word-break: break-word;
}

.wmo-product-card__title a {
  color: inherit;
  text-decoration: none;
}

.wmo-product-card__title a:hover {
  color: var(--brand-accent-color);
}

.wmo-product-card__description {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wmo-product-card__description p {
  line-height: 1.5;
  margin: 0;
}

.wmo-product-card__price {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 1rem 0 !important;
    color: var(--brand-accent-color);
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 600;
    flex-direction: column;
    justify-content: flex-end;
}

.wmo-product-card__price .amount {
  color: var(--brand-accent-color);
}
.wmo-product-card__price .woocommerce-price-suffix {
  color: var(--brand-primary-text-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.wmo-product-card__price-unit {
  color: var(--brand-header-text-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.wmo-product-card__button {
  width: 100%;
  background: var(--brand-secondary-color);
  border: 0;
  color: #fff;
}

.wmo-product-card__button:hover,
.wmo-product-card__button:focus-visible {
  background: var(--brand-accent-color);
}
.wmo-product-card__button:active {
  background: var(--brand-accent-color-hover) !important;
  color: #fff !important;
}

/* Responsive */
@media (max-width: 992px) {
  ul.products.wmo-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
   ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(3n)::after {
    display: block;
  }

  ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(2n)::after {
    display: none;
  }

  ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(n + 3):nth-last-child(-n + 2)::before,
  ul.products.wmo-products-grid li.product.wmo-product-card:nth-child(n + 3):nth-last-child(-n + 2) ~ li.product.wmo-product-card::before {
    display: none;
  }
}

@media (max-width: 576px) {
  .wmo-product-card {
    padding: .5rem !important;
    padding-right: 16px !important;
  }
  .wmo-product-card__image-link {
    display: block;
    min-height: 150px;
    max-height: 150px;
  }
  .wmo-product-card__title {
      font-size: clamp(1.2rem, 2vw, 1.25rem) !important;
  }

  .wmo-product-card__description p {
      font-size: 0.9rem;
      line-height: 1.4;
  }
  .wmo-product-card__price {
      font-size: clamp(1.3rem, 2vw, 1.5rem);
  }
  .wmo-product-card__button.btn {
      font-size: clamp(0.7rem, 1vw, 0.8rem);
      margin-bottom: .5rem !important;
  }
}