/* ==========================================================================
   1. 【PC時】のスタイル（デフォルト / 画面幅が広いとき）
   ========================================================================== */
.new_c{
    display:none;
}
/*　ランキング開閉ボタン*/
.cat_rank summary{
    /* color: #fff; */
    background-color: cyan;
    font-size: 2rem;
    position: relative;
    padding: 1.5rem 3rem 1.5rem 2rem;
}
.cat_rank summary i{
margin-right: 10px;
}
.cat_rank {
margin-bottom:10px;
}

/* -----------------------------------------
   共通見出し（PC時）
   ----------------------------------------- */
.ranking-title,
.image-title,
.brand-title,.navi-title {
  font-size: 1.6rem;
  font-weight: bold;
  color: #333333;
  line-height: 1.4;
  margin: 45px 0 20px 0;
  padding: 5px 0 5px 12px;
  border-left: 5px solid #ff9900; /* 左側にオレンジの太線 */
}

/* -----------------------------------------
   ランキング（PC時：横5枚並び）
   ----------------------------------------- */
.ranking-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5等分 */
  gap: 20px;
  margin-bottom: 30px;
}

.ranking-item {
  position: relative;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 15px;
  background-color: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 
  【PC時の表示数制御（修正版）】
  5の倍数からはみ出た端数（6個目、11個目、16個目...）が、
  最後から4番目以内に存在する場合のみ、その端数の行を丸ごと非表示にします。
  10個ちょうど（5の倍数）のときは、はみ出た端数がないため10個すべて表示されます。
*/
.ranking-item:nth-child(5n + 6):nth-last-child(-n + 4),
.ranking-item:nth-child(5n + 6):nth-last-child(-n + 4) ~ .ranking-item {
  display: none;
}

.ranking-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  width: 100%;
  height: 100%;
}

/* 順位バッジ */
.rank-badge {
  position: absolute;
  top: -10px;
  left: 10px;
  background: #666;
  color: #fff;
  padding: 3px 10px;
  font-size: 1.8rem;
  font-weight: bold;
  border-radius: 3px;
  z-index: 10;
}

/* 上位バッジ色 */
.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; }

/* 商品画像 */
.item-image {
  margin-bottom: 15px;
  width: 100%;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.item-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 商品情報 */
.item-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  flex-grow: 1;
  text-align: center;
}

.item-name {
  font-size: 0.9rem;
  margin: 0 0 10px 0;
  line-height: 1.4;
  height: 2.8em; /* 行の高さ */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.item-price {
  font-weight: bold;
  color: #d9534f;
  font-size: 1.8rem;
  margin-top: auto;
}

/* -----------------------------------------
   バナー画像（PC時：横5枚並び）
   ----------------------------------------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4等分 */
  gap: 15px;
  margin-bottom: 25px;
}

.banner-item {
  width: 100%;
}

.banner-item a {
  display: block;
  width: 100%;
}

.banner-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.banner-item a:hover img {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
/* ブランドリスト全体の枠 */
.brand-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap; /* 横並びで、あふれたら自動折り返し */
  gap: 2px;       /* ボタン同士のすき間 */
  margin-bottom: 30px;
}

/* ブランドボタン1つ */
.brand-item {
  margin: 0;
}

.brand-item a {
  display: inline-block;
  text-decoration: none;
  color: #333;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

/* ホバー時に色を変える */
.brand-item a:hover {
  background-color: #ff9900; /* アトミックゴルフ様オレンジ */
  color: #fff;
  border-color: #ff9900;
}

/* 件数（hitnum）のテキストを少し小さくする */
.brand-hit {
  /*font-size: 0.8rem;*/
  margin-left: 3px;
  opacity: 0.8;
}

/* ==========================================================================
   2. 【スマホ（SP）時】のスタイル（画面幅 767px 以下のとき適用）
   ========================================================================== */
@media screen and (max-width: 767px) {
  /* -----------------------------------------
     共通見出し（スマホ時）
     ----------------------------------------- */
  .ranking-title,
  .image-title,
  .brand-title,
  .navi-title{
    font-size: 1.25rem;
    margin: 35px 0 15px 0;
  }

  /* -----------------------------------------
     ランキング（スマホ時：2列並び、すべて表示）
     ----------------------------------------- */
  .ranking-list {
    grid-template-columns: repeat(2, 1fr); /* 2等分 */
    gap: 15px;
  }

  .ranking-item {
    padding: 15px;
  }

   /* 
    スマホ時は、PC用でかけた「はみ出し要素の非表示ルール」を
    すべての商品（.ranking-item）に対して強制的に「表示（display: flex）」として上書きリセットします。
  */
  .ranking-item {
    display: flex !important;
  }

  .item-name {
    /*font-size: 0.85rem;*/
    height: 2.8em; /* スマホ用に2行分の高さに変更 */
    -webkit-line-clamp: 2;
  }

  .item-price {
    /*font-size: 1rem;*/
  }

  /* -----------------------------------------
     バナー画像（スマホ時：2列並び）
     ----------------------------------------- */
  .image-grid {
    grid-template-columns: repeat(2, 1fr); /* 2等分 */
    gap: 10px;
  }
}