/* トップページ MV下の3ボタンと「牛兵衛 肉ギフトの売れ筋ランキング」専用 */
.page-top .top-action-buttons {
  padding: 1rem 0 5rem;
  background-color: #f9f8f2;
}

.page-top .top-action-buttons__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.9%;
  width: 94%;
  max-width: 112.8rem;
  margin: 0 auto;
}

.page-top .top-action-button {
  --top-action-color: #000;
  display: grid;
  /* 写真はボタン高さと同じ辺の正方形（86/393 = 21.883%） */
  grid-template-columns: 21.883% minmax(0, 1fr);
  aspect-ratio: 393 / 86;
  overflow: hidden;
  border: 1px solid var(--top-action-color);
  border-radius: .8rem;
  background-color: var(--top-action-color);
  color: #fff;
  box-sizing: border-box;
}

.page-top .top-action-button--original {
  --top-action-color: #b31f18;
}

.page-top .top-action-button--template {
  --top-action-color: #b0965e;
}

.page-top .top-action-button img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.page-top .top-action-button__copy,
.page-top .top-action-button__copy-pc,
.page-top .top-action-button__copy-sp {
  min-width: 0;
}

.page-top .top-action-button__copy {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem;
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(1.35rem, 1.32vw, 1.8rem);
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.page-top .top-action-button__copy-pc {
  display: flex;
  flex-direction: column;
}

.page-top .top-action-button__copy-pc > span {
  white-space: nowrap;
}

.page-top .top-action-button__copy-sp {
  display: none;
}

.page-top .section-topranking {
  padding: 5rem 0 8rem;
}

.page-top .section-topranking .top-ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 calc(min(3vw, 3.6rem) - 5rem) 3rem;
  /* デザイン案では金ボタンの右端がスライダー右端より内側（画像32px→約2.9rem） */
  padding-right: 2.9rem;
}

.page-top .section-topranking .top-ranking-header h2 {
  display: block;
  flex: 0 1 auto;
  margin: 0;
  border-bottom: 0;
  font-size: clamp(2.4rem, 2.3vw, 3.2rem);
  line-height: 1.4;
  white-space: nowrap;
}

.page-top .section-topranking .top-ranking-controls {
  display: grid;
  flex: 0 0 auto;
  /* デザイン画像の実測（208/208/170・高さ48・間隔7画像px）をスライダー幅比（1232画像px→1128px）で換算 */
  grid-template-columns: 19rem 19rem 15.6rem;
  gap: .6rem;
  height: 4.4rem;
  margin: 0;
}

.page-top .section-topranking .top-ranking-filter {
  position: relative;
  min-width: 0;
  margin: 0;
}

.page-top .section-topranking .top-ranking-filter select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 3.4rem 0 1.5rem;
  overflow: hidden;
  border: 1px solid #898989;
  border-radius: .3rem;
  outline-offset: 2px;
  background-color: #fff;
  background-image: none;
  color: #222;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.page-top .section-topranking .top-ranking-filter select::-ms-expand {
  display: none;
}

.page-top .section-topranking .top-ranking-filter select:not(:disabled):hover {
  border-color: #222;
}

.page-top .section-topranking .top-ranking-filter select:focus {
  border-color: #222;
  outline: 2px solid rgba(86, 83, 82, .35);
  box-shadow: 0 0 0 1px #fff;
}

.page-top .section-topranking .top-ranking-filter select:disabled {
  opacity: .45;
  cursor: wait;
}

.page-top .section-topranking .top-ranking-filter-chevron {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  width: .7rem;
  height: .7rem;
  border-right: 1.5px solid #222;
  border-bottom: 1.5px solid #222;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: opacity .2s ease;
}

.page-top .section-topranking .top-ranking-filter select:disabled + .top-ranking-filter-chevron {
  opacity: .45;
}

.page-top .section-topranking .top-ranking-product-list-button {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 1rem;
  border: 1px solid #b0965e;
  border-radius: .3rem;
  background-color: #b0965e;
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .2s ease;
}

.page-top .section-topranking .top-ranking-product-list-button:hover {
  opacity: .75;
}

.page-top .section-topranking .top-ranking-product-list-button:focus {
  outline: 2px solid rgba(86, 83, 82, .35);
  outline-offset: 2px;
}

.page-top .section-topranking .top-ranking-product-link {
  display: block;
}

/* 順位表示は画像右上の斜め帯（assets/css/rank_ribbon.css）。index.twig で本CSSと一緒に読み込む */

@media (max-width: 1100px) {
  .page-top .top-action-buttons {
    padding: 2rem 0 2.9rem;
  }

  .page-top .top-action-buttons__inner {
    gap: 1.3%;
    /* タブレット幅ではスマホ版の比率のまま中央に置く（カードが縦に大きくなりすぎないように） */
    max-width: 600px;
  }

  .page-top .top-action-button {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
  }

  .page-top .top-action-button img {
    width: 100%;
    height: auto;
    border-radius: .7rem .7rem 0 0;
  }

  .page-top .top-action-button__copy {
    width: 100%;
    aspect-ratio: 5 / 3;
    padding: .2rem;
    font-size: min(3.1vw, 18.6px);
    line-height: 1.4;
    box-sizing: border-box;
  }

  .page-top .top-action-button__copy-pc {
    display: none;
  }

  .page-top .top-action-button__copy-sp {
    display: flex;
    flex-direction: column;
  }

  .page-top .top-action-button__copy-sp > span {
    white-space: nowrap;
  }

  .page-top .top-action-button__copy-small {
    font-size: .82em;
  }

  .page-top .section-topranking {
    padding: 6rem 0 5rem;
  }

  .page-top .section-topranking .top-ranking-header {
    flex-direction: column;
    gap: 3rem;
    margin: 0 0 3rem;
    padding-right: 0;
  }

  .page-top .section-topranking .top-ranking-header h2 {
    font-size: 2.3rem;
    text-align: center;
  }

  .page-top .section-topranking .top-ranking-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .7fr);
    gap: .5rem;
    width: calc(100% - 2rem);
    height: 4.8rem;
    margin: 0 1rem;
  }

  .page-top .section-topranking .top-ranking-filter select {
    padding: 0 1.6rem 0 .6rem;
    font-size: clamp(1.2rem, 3.2vw, 1.6rem);
  }

  .page-top .section-topranking .top-ranking-filter-chevron {
    right: .7rem;
    width: .6rem;
    height: .6rem;
  }

  .page-top .section-topranking .top-ranking-product-list-button {
    padding: 0 .4rem;
    font-size: clamp(1.2rem, 3.2vw, 1.6rem);
  }
}

@media (max-width: 370px) {
  .page-top .section-topranking .top-ranking-filter select {
    padding: 0 1.6rem 0 .6rem;
    font-size: 10px;
  }

  .page-top .section-topranking .top-ranking-filter-chevron {
    right: .8rem;
  }

  .page-top .section-topranking .top-ranking-product-list-button {
    font-size: 10px;
  }
}
