@charset "utf-8";

.products-section {
  width: 100%;
  margin: 40px 0;
}

.products-section h3 {
  font-size: 1.2rem;
  color: #333;
  margin: 20px 0;
  padding-left: 5px;
}

.products-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px
}

.product-card {
  width: 100%;
  max-width: 160px; 
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.product-icon {
  width: 100%;
  aspect-ratio: 1/1;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
  margin-bottom: 8px;
}

.product-icon img {
  width: 60%;
  height: auto;
  display: block;
}

.product-name {
  font-size: .8rem;
  font-weight: bold;
  color: #333;
  line-height: 1.3;
}

.product-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* --- カテゴリーボックス全体の基本設定 --- */
.category-box {
  border-radius: 20px;   /* 角丸の大きさ */
  padding: 30px;         /* 内側の余白 */
  margin-bottom: 40px;   /* ボックス同士の間の余白 */
}

/* --- 各カテゴリーの背景色 --- */
.bg-blue {
  background-color: #e6f2ff; /* 薄い青 */
}

.bg-green {
  background-color: #eef9ef; /* 薄い緑 */
}

.bg-orange {
  background-color: #fff4e6; /* 薄いオレンジ */
}

/* --- 見出し(h3)の調整 --- */
.category-box h3 {
  margin-top: 0;         /* ボックス内の上部余白をリセット */
  margin-bottom: 25px;   /* 下（商品一覧）との隙間 */
  font-size: 1.2rem;
  color: #333;
}

/* --- (修正) aタグのリンク下線を消し、ブロック要素にする --- */
a.product-card {
  text-decoration: none;
  display: flex;
}

/* ===== レスポンシブ調整 ===== */
@media (min-width: 1050px) {
  .products-container {
    grid-template-columns: repeat(5, 1fr);
    gap: 40px 50px;
  }
}

@media (max-width: 1049px) and (min-width: 851px) {
  .products-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 35px 40px;
  }
}

@media (max-width: 850px) and (min-width: 601px) {
  .products-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 30px;
  }
}

@media (max-width: 600px) {
  .products-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 20px; /* スマホでは隙間を少しタイトに */
  }
  
  .product-card {
    max-width: 140px;
  }
}