/* ==========================
   CM2 Shop Styles (Pro)
   ========================== */
.cm2-cat-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* mượt trên iOS */
  padding: 10px 0;
  scroll-snap-type: x mandatory; /* auto snap */
}

.cm2-cat-item {
  flex: 0 0 auto; /* giữ item theo kích thước riêng, không co */
  width: 90px;    /* bạn chỉnh theo thiết kế */
  text-align: center;
  scroll-snap-align: start;
}

.cm2-cat-item img,
.cm2-cat-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
}

.cm2-marketplace {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 12px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: #111827;
}

/* Tiêu đề section */
.cm2-marketplace h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 20px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f3f4f6;
}

.cm2-marketplace h3 {
  font-size: 18px;
  margin: 20px 0 12px;
  color: #374151;
}

/* Grid sản phẩm */
.cm2-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; /* ⭐ giảm gap cho card sát nhau hơn */
}

/* Card sản phẩm */
.cm2-product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}

.cm2-product-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Ảnh sản phẩm – giữ tỷ lệ vuông */
.cm2-product-card img {
  width: 100%;
  aspect-ratio: 1 / 1; /* ⭐ luôn vuông, không dẹp */
  object-fit: cover;
  background: #f9fafb;
  transition: transform 0.3s ease;
}

.cm2-product-card:hover img {
  transform: scale(1.05);
}

/* Nội dung card */
.cm2-product-card a {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 10px;
  text-decoration: none;
  color: inherit;
}

/* Tiêu đề sản phẩm – rút gọn 2 dòng */
.cm2-product-card h4 {
  font-size: 14px;
  font-weight: 500;
  margin: 8px 0 6px;
  color: #111827;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

/* Giá sản phẩm – luôn căn đều */
.cm2-product-card .price {
  margin-top: auto;
  font-size: 15px;
  font-weight: 600;
  color: #dc2626;
  min-height: 22px;
}
/* Giá sản phẩm */
.cm2-product-card .price {
  margin-top: auto;
  font-size: 15px;
  font-weight: 600;
  display: block;
}

.cm2-product-card .price-old {
  color: #9ca3af;
  text-decoration: line-through;
  margin-right: 6px;
}

.cm2-product-card .price-sale {
  color: #dc2626;
  font-weight: 700;
}

.cm2-product-card .price-normal {
  color: #111827;
}

.cm2-product-card .price-contact {
  color: #6b7280;
  font-style: italic;
}

.cm2-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
}
.cm2-meta span {
  display: inline-flex;
  align-items: center;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .cm2-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* ⭐ nhỏ lại nhưng vẫn ≥3 cột */
    gap: 12px;
  }
  .cm2-product-card h4 {
    font-size: 13px;
    min-height: 36px;
  }
  .cm2-product-card .price {
    font-size: 14px;
  }
}

/* Phân trang */
.cm2-pagination {
  margin-top: 24px;
  text-align: center;
}
.cm2-pagination a,
.cm2-pagination span {
  display: inline-block;
  margin: 0 3px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  transition: all 0.2s ease;
}
.cm2-pagination a:hover {
  background: #111827;
  color: #fff;
}
.cm2-pagination .current {
  background: #111827;
  color: #fff;
  font-weight: 600;
}
/* ========== Giá sản phẩm ========== */
.cm2-product-card .price-row {
  margin-top: auto; /* đẩy xuống đáy */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-height: 26px;
}

.cm2-product-card .sale-price {
  font-size: 15px;
  font-weight: 600;
  color: #dc2626;
}

.cm2-product-card .old-price {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
}

/* ========== Meta (likes, comments, shares) ========== */
.cm2-product-card .meta-row {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
  display: flex;
  gap: 12px;
}

.cm2-product-card .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Hover làm icon rõ hơn */
.cm2-product-card:hover .meta-item {
  color: #374151;
}
.cm2-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
  text-align: center;
}
.cm2-cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  transition: transform .2s ease, color .2s ease;
}
.cm2-cat-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 6px;
  background: #f3f4f6;
}
.cm2-cat-item:hover {
  transform: translateY(-3px);
  color: #111827;
  font-weight: 600;
}
.cm2-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.cm2-cat-item {
  text-decoration: none;
  color: #374151;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease;
}

.cm2-cat-item:hover {
  transform: translateY(-3px);
}

.cm2-cat-item img,
.cm2-cat-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 20px;
  color: #6b7280;
}

.cm2-cat-item span {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}
.cm2-product-card{
  background:#fff;
  border:1px solid #eee;
  border-radius:10px;
  overflow:hidden;
  position:relative;
  transition:all .2s ease;
}
.cm2-thumb-wrap{
  display:block;
  position:relative;
}
.cm2-thumb-wrap img{
  display:block;
  width:100%;
  height:auto;
  border-bottom:1px solid #eee;
}

.cm2-meta-overlay{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  background:rgba(0,0,0,0.55);
  color:#fff;
  font-size:13px;
  padding:3px 6px;
  text-align:center;
}

