/* =========================================
   Logo
========================================= */
#h_logo .M_ShopLogo {
  max-width: inherit;
}

/* =========================================================
   TOP PAGE: Ranking Section
========================================================= */

/* Ranking Table & Section */
.up-d_top-ranking {
  max-width: 1000px;
  margin-inline: auto;
  margin-block: 40px;
  padding-inline: 20px;
}

.up-d_section-title {
  font-size: 26px;
  color: #2D1819;
  text-align: center;
  letter-spacing: 0.1em;
}

.up-d_ranking-tabs {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 2px solid #2D1819;
  padding-bottom: 0;
}
.up-d_tab-btn {
  max-width: 150px;
  width: 15%;
  padding: 12px 0;
  background-color: #fff;
  border: 1px solid #2D1819;
  border-bottom: none;
  color: #2D1819;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 8px 8px 0 0;
  text-align: center;
}
.up-d_tab-btn.active {
  background-color: #2D1819;
  color: #fff;
}
.up-d_ranking-contents {
  margin-top: 40px;
}
.up-d_ranking-panel {
  display: none;
}
.up-d_ranking-panel.active {
  display: block;
}

.up-d_ranking-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

[data-element-id] .up-d_ranking-grid > div[data-collection-list-content] {
  display: contents;
}

.up-d_ranking-card {
  position: relative;
  text-align: center;
  counter-increment: ranking-count;
}

.up-d_ranking-card::before {
  content: "No."counter(ranking-count);
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #2D1819;
  padding-bottom: 5px;
  border-bottom: 2px solid #2D1819;
  line-height: 1.2;
}

.up-d_ranking-card a {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #333;
  transition: opacity 0.3s;
}
.up-d_ranking-card a:hover {
  opacity: 0.7;
}

.up-d_rank-img {
  width: 100%;
}
.up-d_rank-img img {
  max-width: 100%;
  height: auto;
  max-height: 124px;
  border: none;
}
.up-d_rank-name {
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  line-height: 1.4;
}

.up-d_rank-price {
  margin-top: 5px;
  font-size: 13px;
  color: #666;
  font-weight: bold;
}
.up-d_rank-link {
  display: none;
}

/* Responsive Ranking */
@media (max-width: 768px) {
  .up-d_section-title {
  font-size: 20px;
  }
  
  .up-d_ranking-tabs {
    margin-top: 15px;
  }
  .up-d_tab-btn {
    font-size: 12px;
  }
  .up-d_ranking-contents {
    margin-top: 25px;
  }
  .up-d_ranking-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  .up-d_rank-num {
    font-size: 22px;
  }
}

@media (max-width: 500px) {
  .up-d_ranking-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .up-d_tab-btn {
    width: 32%;
  }
}
