@charset "UTF-8";

.ranking-wrap{
  margin: 0 auto;
  padding: 0 10px;
}

.ranking-head{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ranking-title{
  font-size: 20px;
  margin: 0;
  flex: 1;
}

/* ▼ カテゴリタグ */
.ranking-tabs{
  width: 100%;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ranking-tab{
  appearance: none;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  margin-bottom:0;
  text-shadow:none;
}

button:hover,.ranking-tab:hover{
  background: #c5afb0 !important;
border:solid 1px #c5afb0 !important;
}

.ranking-tab.is-active{
  border-color: #a08687;
  background: #a08687;
  color: #fff;
  font-weight: 700;
}

/* ▼ 見出し（タグ群の下に出す） */
.ranking-subhead{
  width: 100%;
  margin-top: 6px;     /* タグの下の余白 */
  margin-bottom: 8px;  /* リストとの余白 */
}

.ranking-kind{
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.ranking-period{
  margin: 2px 0 0;
  font-size: 12px;
  opacity: .8;
  line-height: 1.4;
}
  .rankinglink{
    width: 352px;
    margin:20px auto;
  }

/* スマホは横スクロール（任意） */
@media (max-width: 640px){
  .ranking-tabs{
    /*
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    */
  }
  .ranking-tab{
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .rankinglink{
    padding:10px 3px 10px 3px !important;
    font-size: 1.2em;
  }

}

/* ▼ ランキング本体 */
.ranking-list{
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
  align-items: stretch;
}

.ranking-list li{ min-width: 0; }

.ranking-list li a{
  display: grid;
  grid-template-rows: auto auto 1fr; /* ①画像 ②コード ③商品名 */
  gap: 5px;
  padding: 2px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.rproduct-img{
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #f6f6f6;
  border: solid 1px #eee;
}

.rproduct-img::before{
  content: "";
  display: block;
  padding-top: 100%;
}

.rproduct-img img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rrank{
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0;
  background: #a08687;
  color:#FFF;
  font-weight: 700;
  font-size: 12px;
  backdrop-filter: blur(2px);
}

.rproduct-code{
  font-size: 12px;
  opacity: .8;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rproduct-name{
  font-size: 12px;
  line-height: 115%;
  height:2.2em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ranking-empty{
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed #ddd;
  border-radius: 12px;
  opacity: .8;
}

/* 上位色 */
.rrank.rank-1{
  background: linear-gradient(135deg, #f7d358, #f1c40f);
  border-color: #e1b600;
  color: #5a4200;
  font-weight: 800;
}
.rrank.rank-2{
  background: linear-gradient(135deg, #f2f2f2, #dcdcdc);
  border-color: #bfbfbf;
  color: #444;
  font-weight: 700;
}
.rrank.rank-3{
  background: linear-gradient(135deg, #e0a060, #c97a3a);
  border-color: #b36a2e;
  color: #4a2c14;
  font-weight: 700;
}

/* レスポンシブ */
@media (max-width: 900px){
  .ranking-list{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .ranking-list{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}