{
  "id": "product-card",
  "name": "Product Card",
  "category": "cards",
  "tags": [
    "ecommerce",
    "shop",
    "add to cart",
    "wishlist",
    "rating",
    "price"
  ],
  "description": "An e-commerce product card with an image, wishlist button, star rating, price and add-to-cart button.",
  "url": "https://copy-css.com/snippets/product-card",
  "markdown": "https://copy-css.com/snippets/product-card.md",
  "html": "<article class=\"shop-card\">\n  <div class=\"shop-card-media\">\n    <img src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 25'%3E%3Crect width='40' height='25' fill='%23e0e7ff'/%3E%3Crect x='14' y='7' width='12' height='14' rx='2' fill='%236366f1'/%3E%3Cpath d='M17 8V6a3 3 0 0 1 6 0v2' fill='none' stroke='%234338ca' stroke-width='1.4'/%3E%3C/svg%3E\" alt=\"Indigo canvas tote bag\" width=\"200\" height=\"125\">\n    <button class=\"shop-card-wish\" type=\"button\" aria-label=\"Add to wishlist\">\n      <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M12 20.5 4.1 12.8A5 5 0 0 1 12 6.6a5 5 0 0 1 7.9 6.2Z\"/></svg>\n    </button>\n  </div>\n  <div class=\"shop-card-body\">\n    <h3><a href=\"#\">Canvas Tote</a></h3>\n    <p class=\"shop-card-rating\"><span aria-hidden=\"true\">★</span> 4.8 <span>(212 reviews)</span></p>\n    <div class=\"shop-card-foot\">\n      <strong>$48</strong>\n      <button type=\"button\">Add to cart</button>\n    </div>\n  </div>\n</article>",
  "css": ".shop-card {\n  width: 200px;\n  overflow: hidden;\n  border-radius: 16px;\n  background: #fff;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px -8px rgba(0, 0, 0, 0.15);\n  color: #1c1917;\n  font-family: system-ui, sans-serif;\n}\n\n.shop-card-media {\n  position: relative;\n}\n\n.shop-card-media img {\n  display: block;\n  width: 100%;\n  height: auto;\n  aspect-ratio: 8 / 5;\n  object-fit: cover;\n}\n\n.shop-card-wish {\n  position: absolute;\n  top: 8px;\n  right: 8px;\n  display: grid;\n  place-items: center;\n  width: 32px;\n  height: 32px;\n  padding: 0;\n  border: 0;\n  border-radius: 50%;\n  background: #fff;\n  color: #e11d48;\n  cursor: pointer;\n}\n\n.shop-card-wish svg {\n  width: 16px;\n  height: 16px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 2;\n}\n\n.shop-card-wish:hover svg {\n  fill: currentColor;\n}\n\n.shop-card-body {\n  padding: 12px 14px 14px;\n}\n\n.shop-card h3 {\n  margin: 0;\n  font-size: 15px;\n}\n\n.shop-card h3 a {\n  color: inherit;\n  text-decoration: none;\n}\n\n.shop-card-rating {\n  margin: 2px 0 10px;\n  font-size: 12px;\n}\n\n.shop-card-rating span:first-child {\n  color: #f59e0b;\n}\n\n.shop-card-rating span:last-child {\n  color: #78716c;\n}\n\n.shop-card-foot {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.shop-card-foot strong {\n  font-size: 18px;\n}\n\n.shop-card-foot button {\n  padding: 7px 12px;\n  border: 0;\n  border-radius: 8px;\n  background: #1c1917;\n  color: #fff;\n  font: 600 13px system-ui, sans-serif;\n  cursor: pointer;\n}\n\n.shop-card-foot button:hover {\n  background: #44403c;\n}\n\n.shop-card a:focus-visible,\n.shop-card button:focus-visible {\n  outline: 2px solid #6366f1;\n  outline-offset: 2px;\n}",
  "features": [
    "box shadows",
    "CSS Grid",
    "Flexbox",
    "aspect-ratio",
    "keyboard focus styles"
  ],
  "customProperties": []
}
