/* Shared product card: one renderer for shop, taxonomy, related and Bricks loops */
.bci-product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 18px;
  width: 100%;
}

.bci-product-card,
.woocommerce ul.products > li.bci-product-card {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: none;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  color: #111315;
  font-family: var(--bci-font-family);
  font-size: 14px;
  text-align: left;
}

.bci-product-card__badges {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.bci-product-card__discount,
.bci-product-card__installment {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.bci-product-card__discount {
  background: #ffc400;
  color: #171717;
}

.bci-product-card__installment {
  background: #f0f3f5;
  color: #202428;
}

.bci-product-card__freeship {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  gap: 2px;
  color: #ff3154;
  font-weight: 700;
}

.bci-product-card__freeship i {
  font-size: 22px;
}

.bci-product-card__freeship small {
  font-size: 9px;
  line-height: 1;
}

.bci-product-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f7f8f8;
  color: inherit;
  text-decoration: none;
}

.bci-product-card__image,
.woocommerce .bci-product-card .bci-product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  transition: transform var(--bci-transition);
}

.bci-product-card:hover .bci-product-card__image {
  transform: scale(1.025);
}

.bci-product-card__online {
  position: absolute;
  bottom: 9px;
  left: 9px;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #ffad67;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.bci-product-card__online i {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #242424;
  font-size: 11px;
}

.bci-product-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding-top: 10px;
}

.bci-product-card__title {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 8px;
  overflow: hidden;
  color: #0e1012;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bci-product-card__title a {
  color: inherit;
  text-decoration: none;
}

.bci-product-card__title a:hover {
  color: var(--bci-primary);
}

.bci-product-card__prices {
  min-height: 68px;
  margin-top: auto;
}

.bci-product-card__list-price,
.bci-product-card__current-price,
.bci-product-card__saving {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  line-height: 1.45;
}

.bci-product-card__list-price {
  color: #9a9ea2;
  font-size: 12px;
}

.bci-product-card__list-price del {
  color: #9a9ea2;
}

.bci-product-card__current-price {
  color: #111315;
  font-size: 13px;
}

.bci-product-card__current-price strong {
  color: #111315;
  font-size: 15px;
  font-weight: 700;
}

.bci-product-card__saving {
  color: #21b14b;
  font-size: 12px;
  font-weight: 500;
}

.bci-product-card__actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
  margin-top: 10px;
}

.bci-product-card__buy,
.bci-product-card__cart,
.woocommerce .bci-product-card .bci-product-card__buy,
.woocommerce .bci-product-card .bci-product-card__cart {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: all var(--bci-transition);
}

.bci-product-card__buy,
.woocommerce .bci-product-card .bci-product-card__buy {
  background: #202020;
  color: #fff;
}

.bci-product-card__buy:hover,
.woocommerce .bci-product-card .bci-product-card__buy:hover {
  background: var(--bci-primary);
  color: #fff;
}

.bci-product-card__cart,
.woocommerce .bci-product-card .bci-product-card__cart {
  background: #f0f3f5;
  color: #6f767d;
}

.bci-product-card__cart:hover,
.woocommerce .bci-product-card .bci-product-card__cart:hover {
  background: var(--bci-primary-soft);
  color: var(--bci-primary);
}

/* Woo AJAX appends a "View cart" link after add-to-cart. Product cards do not need it. */
.bci-product-card .added_to_cart.wc-forward,
.bci-product-card__actions .added_to_cart.wc-forward {
  display: none !important;
}

/* Native Woo related/upsell/cross-sell loops also consume the same card renderer. */
.related.products .products,
.upsells.products .products,
.cross-sells .products {
  align-items: stretch;
}

.related.products .bci-product-card,
.upsells.products .bci-product-card,
.cross-sells .bci-product-card {
  height: 100%;
}

@media (max-width: 1199px) {
  .bci-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .bci-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .bci-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }

  .bci-product-card__badges {
    gap: 4px;
  }

  .bci-product-card__discount,
  .bci-product-card__installment {
    padding-inline: 7px;
  }

  .bci-product-card__freeship {
    display: none;
  }

  .bci-product-card__online {
    bottom: 6px;
    left: 6px;
    padding: 5px 7px;
  }

  .bci-product-card__actions {
    grid-template-columns: 1fr;
  }
}
