/* 🎨 โครงสร้างพื้นฐานของหน้าเว็บ */
body {
  font-family: 'Prompt', sans-serif;
  background: #f9f9f9;
  padding: 10px;
  margin: 0;
}

h1 {
  text-align: center;
  margin: 20px 0;
  font-size: 24px;
}

/* 🛍️ กล่องสินค้า */
.product-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: left;
  box-sizing: border-box;
}

/* 🖼️ รูปภาพสินค้า */
.image-wrapper {
  width: 100%;
  max-width: 540px;
  aspect-ratio: 540 / 507;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
  margin: 0 auto 10px;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* 🏷️ ชื่อสินค้าและรายละเอียด */
.product-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.product-card p {
  margin: 4px 0;
  font-size: 14px;
}

/* 💰 ราคา (อยู่ตรงกลาง) */
.price-text {
  font-size: 14px;
  font-weight: bold;
  margin: 8px 0;
  text-align: center; /* ✅ ตรงกลาง */
}

/* 👤 ผู้ขาย (ชิดซ้าย) */
.seller-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 8px 0;
}

.seller-link {
  text-decoration: none;
  color: #333;
  display: flex;
  align-items: center;
}

.seller-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ccc;
}

.seller-name {
  font-size: 13px;
  font-weight: 500;
}

/* 🛒 ปุ่มซื้อสินค้า */
.product-card button {
  width: 100%;
  padding: 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  margin-top: 10px;
}

/* 📱 Responsive Grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr 1fr; /* ✅ บังคับ 2 ช่องแม้บนมือถือ */
  }

  .image-wrapper {
    width: 100%;
    aspect-ratio: 540 / 507;
  }
}
.stock-text, .sold-text {
  font-size: 14px;
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
  font-weight: 500;
  background-color: #f0f4f8;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stock-text::before {
  content: "📦 ";
  margin-right: 4px;
  color: #2196F3;
}

.sold-text::before {
  content: "🔥 ";
  margin-right: 4px;
  color: #FF5722;
}
