/* 全域設定 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f7f7f7;
  color: #333;
  margin: 0;
  padding: 20px;
  line-height: 1.6;
}

/* 商品格線 (首頁) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

/* 商品卡片 (首頁) */
.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card h3 {
  font-size: 18px;
  margin: 15px 12px 5px;
}

.card p {
  margin: 0 12px 15px;
  font-weight: bold;
  color: #d12c1f;
}

.card a {
  display: block;
  margin: 0 12px 15px;
  padding: 12px;
  text-align: center;
  background: #000;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
}

.card a:hover {
  background: #333;
}

/* 商品詳情頁佈局 */
#product {
  max-width: 600px;
  margin: 20px auto;
  background: #fff;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

#product img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
}

/* 規格清單與按鈕 */
.variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.variant-list button {
  padding: 10px 16px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  border-radius: 6px;
}

.variant-list button.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* 結帳按鈕 */
.buy-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 25px;
  padding: 16px;
  background: #ff5000;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
}

.note {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 15px;
}

/* 手機優化 */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  .card img {
    height: 180px;
  }
}