body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9f9f9;
  color: #333;
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 28px;
  color: #111;
}

#product-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 기본: 데스크탑 6개 */
  gap: 16px;
}

/* 태블릿 이하: 4개로 */
@media screen and (max-width: 1023px) {
  #product-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 모바일: 3개로 */
@media screen and (max-width: 640px) {
  #product-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  min-height: unset;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: auto;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.product img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  background-color: #f0f0f0;
  transition: all 0.2s ease-in-out;
}

/* 📱 모바일 전용 이미지 높이 줄이기 */
@media screen and (max-width: 640px) {
  .product img {
    height: 140px; /* ✅ 줄여서 잘리는 양을 최소화 */
    object-fit: contain; /* ✅ 잘리는 대신 여백이 생겨도 전체 보여줌 */
  }
}

.product h2 {
  font-size: 15px;
  margin: 6px 0 4px;
  line-height: 1.3;
  word-break: keep-all;
  color: #222;
}

.price {
  font-size: 15px;
  font-weight: bold;
  color: #2ecc71;
  margin-top: 12px;
  margin-bottom: 1px;          /* ✅ 불필요한 여백 제거 */
}


/* 모바일 텍스트 사이즈 최적화 */
@media screen and (max-width: 640px) {
  .product h2 {
    font-size: 14px;
  }
  .price {
    font-size: 13px;
  }
}