/**
 * EWH CMS Products
 *
 * @author    EcoWarehouse Ltd
 * @copyright 2026 EcoWarehouse Ltd
 * @license   Proprietary. For use on EcoWarehouse Ltd PrestaShop installations only.
 */
.ewh-cp-grid {
  --ewh-cp-gap: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ewh-cp-gap);
  margin: 24px 0 32px;
  padding: 0;
}

/* Mobile: 2 per row */
.ewh-cp-card {
  flex: 0 0 calc((100% - var(--ewh-cp-gap)) / 2);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.ewh-cp-cols-1 .ewh-cp-card {
  flex-basis: 100%;
  max-width: 320px;
}

/* Tablet: up to 3 per row */
@media (min-width: 768px) {
  .ewh-cp-cols-3 .ewh-cp-card,
  .ewh-cp-cols-4 .ewh-cp-card {
    flex-basis: calc((100% - 2 * var(--ewh-cp-gap)) / 3);
  }
}

/* Desktop: up to 4 per row */
@media (min-width: 992px) {
  .ewh-cp-cols-4 .ewh-cp-card {
    flex-basis: calc((100% - 3 * var(--ewh-cp-gap)) / 4);
  }
}

@media (max-width: 479px) {
  .ewh-cp-grid {
    --ewh-cp-gap: 16px;
  }
}

.ewh-cp-reviews {
  font-size: 13px;
  line-height: 1.3;
}

.ewh-cp-reviews:empty {
  display: none;
}

.ewh-cp-image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: #fff;
}

/* Show the image at its native size (home_default, 300x300) and never upscale it. */
.ewh-cp-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.ewh-cp-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.ewh-cp-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ewh-cp-name a {
  color: inherit;
  text-decoration: none;
}

.ewh-cp-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
}

.ewh-cp-price .regular-price {
  font-weight: 400;
  font-size: 0.9em;
  color: #888;
  text-decoration: line-through;
}

.ewh-cp-cart {
  margin: auto 0 0;
}

.ewh-cp-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  text-align: center;
  white-space: normal;
}
