/* New product card styling */
.product-item {
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background: white;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px !important;
  display: flex;
  flex-direction: column;
  height: auto; /* 允许自然高度 */
  float: left; /* 添加这一行，确保Masonry布局正常工作 */
}

.product-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  background: white; /* 明确保持白色背景 */
}

/* Product link styling to prevent background color changes */
.product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-link:hover {
  background-color: transparent;
  color: inherit;
}

.image-container {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  flex-shrink: 0;
}

.product-item__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #012169;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 10;
  font-size: 0.75rem;
}

.mvp-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #28a745;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 10;
  font-size: 0.75rem;
}

.product-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 1.2em; /* 添加最小高度确保即使为空也保留空间 */
}

.product-name-en {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.1;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
  margin-bottom: 2px;
}

.price {
  font-size: 0.95rem;
  font-weight: bold;
  color: #012169;
}

.packaging {
  font-size: 0.80rem;
  color: #777;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

.sku-row {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  margin-bottom: 1px;
  font-size: 0.65rem;
}

.sku {
  color: #777;
}

.discount {
  color: #E53935;
  font-weight: 500;
}

.region-tags {
  margin-top: 2px;
  margin-bottom: 0;
  line-height: 1;
  display: flex;
  flex-wrap: wrap;
}

.product-tag {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  margin-right: 4px;
}

.product-tag.w {
  background-color: rgb(219, 234, 254);
  color: rgb(30, 64, 175);
}

.product-tag.e {
  background-color: rgb(254, 226, 226);
  color: rgb(185, 28, 28);
}