/**
 * Equal product image heights + keep images inside the card
 * Homepage + product list (desktop & mobile)
 */

/* Clip everything to the purple card corners */
.card-product.fl-item,
.card-product {
  overflow: hidden !important;
  border-radius: 13px !important;
}

/* Fixed square image box — padding trick works on all browsers */
.card-product .card-product-wrapper {
  position: relative !important;
  display: block !important;
  width: auto !important;
  height: 0 !important;
  padding: 0 0 100% 0 !important; /* 1:1 square */
  margin: 14px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  z-index: 1;
}

/* Image link fills the square box */
.card-product .card-product-wrapper .product-img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

/* All product images stay inside and cover the box equally */
.card-product .card-product-wrapper .product-img img,
.card-product .card-product-wrapper img.img-product,
.card-product .card-product-wrapper img.img-hover,
.card-product .card-product-wrapper img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

.card-product .card-product-wrapper .img-hover {
  opacity: 0;
  z-index: 2;
}

.card-product .card-product-wrapper:hover .img-hover {
  opacity: 1;
}

.card-product .card-product-wrapper:hover .img-product {
  opacity: 0;
}

/* Badge stays inside image box */
.card-product .card-product-wrapper .product-badge,
.card-product .product-img .product-badge {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 15 !important;
}

.card-product .card-product-wrapper .list-product-btn,
.card-product .card-product-wrapper .on-sale-wrap {
  z-index: 15;
}

/* Mobile */
@media (max-width: 767px) {
  .card-product .card-product-wrapper {
    margin: 8px !important;
    padding-bottom: 100% !important;
    height: 0 !important;
    overflow: hidden !important;
    border-radius: 10px !important;
  }

  .card-product .card-product-wrapper .product-img,
  .card-product .card-product-wrapper .product-img img,
  .card-product .product-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
  }
}

@media (max-width: 480px) {
  .card-product .card-product-wrapper {
    margin: 6px !important;
    padding-bottom: 100% !important;
    height: 0 !important;
  }
}

/* Homepage swiper + list page grids */
.tf-sw-product-sell .card-product,
.wrap-sw-over .card-product,
.grid-layout .card-product,
#products-container .card-product,
.loadmore-item .card-product {
  overflow: hidden !important;
  border-radius: 13px !important;
}

.tf-sw-product-sell .card-product .card-product-wrapper,
.wrap-sw-over .card-product .card-product-wrapper,
.grid-layout .card-product .card-product-wrapper,
#products-container .card-product .card-product-wrapper,
.loadmore-item .card-product .card-product-wrapper {
  height: 0 !important;
  padding-bottom: 100% !important;
  overflow: hidden !important;
}

/* Product card review stars — dark yellow */
.product-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
  line-height: 1;
}

.product-card-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.product-card-stars .icon-star {
  font-size: 13px;
  color: #E6D29A;
  line-height: 1;
}

.product-card-stars .icon-star.filled {
  color: #C9A227;
}

.product-card-rating-text {
  font-size: 12px;
  font-weight: 600;
  color: #B8860B;
}

.product-card-rating-text span {
  color: #8a7a3d;
  font-weight: 500;
}

@media (max-width: 767px) {
  .product-card-stars .icon-star {
    font-size: 12px;
  }

  .product-card-rating-text {
    font-size: 11px;
  }
}

/* Homepage category "View More" button */
.homepage-category-view-more {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 22px;
  padding: 0 15px;
  text-align: center;
}

.homepage-view-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 12px 34px;
  border-radius: 8px;
  background-color: #4F3267 !important;
  border: 1px solid #4F3267 !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none !important;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.homepage-view-more-btn:hover {
  background-color: #3c165d !important;
  border-color: #3c165d !important;
  color: #fff !important;
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .homepage-category-view-more {
    margin-top: 16px;
  }

  .homepage-view-more-btn {
    min-width: 140px;
    padding: 10px 28px;
    font-size: 14px;
  }
}
