/* ==========================================================================
   MEAT FAIR 2026 ソート機能・絞り込みパネル 追加CSS（整理版）
   既存の niku2026.css に追記、またはこのファイルを別途読み込んでください
   ========================================================================== */
:root {
  --color-main: #ea5539;
  --color-second: #fdd108;
  --color-bg: #4e361c;
}

/* ── コントロールパネル（見出し・リード文） ── */
.controls {
  padding: 40px 20px 20px;
  width: 94%;
  max-width: 1200px;
  margin: 0 auto 60px;
  background-color: var(--color-second);
  position: relative;
}

.controls__lead {
  margin: 0 0 20px;
  padding: 0;
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  color: var(--color-main);
  line-height: 1;
}

.sp {
  display: none;
}
.pc {
  display: block;
}

.controls__text {
  font-size: 20px;
  text-align: center;
  margin: 0 auto 28px;
  color: var(--color-main);
}

/* ── ファーストビューの絞り込みパネル（.controls の中身） ── */
.niku2026 .controls .filter-group {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

.filter-btn {
  display: block;
  align-items: center;
  gap: 7px;
  padding: 20px;
  border-radius: 0;
  border: none;
  background: #fff;
  color: var(--color-bg);
  cursor: pointer;
  transition: all 0.18s;
  width: calc((100% - 60px) / 4);
  /* border は transition 対象から外す（切り替え時の枠線チラつき防止） */
  transition:
    opacity 0.18s,
    background-color 0.18s,
    color 0.18s;
}

.filter-btn:hover {
  opacity: 0.6;
}

.sort__btn {
  margin: 5px auto;
  font-size: 20px;
  line-height: 1.2;
}

.sort__img {
  width: 50%;
  margin: 0 auto 10px;
}
.sort__img img {
  width: 100%;
}
.btn__img.pc img {
  width: 100%;
}

.sort__title {
  width: 94%;
  margin: 40px auto;
  text-align: center;
}
.sort__title img {
  height: 60px;
  width: auto;
}

.sort__word {
  height: 30px;
  width: auto;
  margin: 0 auto;
}
#sort__anchor {
  scroll-margin-top: 110px; /* ← ここの数値 */
}
/* ── .filter-btn の状態（ドット・チェック・ホバー） ── */
.niku2026 .filter-btn .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: #ccc;
}

.niku2026 .filter-btn .check {
  margin-left: 2px;
  font-size: 0.78rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.niku2026 .filter-btn.active .check {
  opacity: 1;
}

/* ── アクティブ時の枠線（ファーストビュー用／5カテゴリ共通） ──
   /* 右固定パネル（.filter-panel-inner）のボタンには当たらないよう */
.niku2026 .controls .filter-btn.active {
  background: var(--color-main);
  color: var(--color-second);
}

/* ── 右固定フィルターパネル（スクロール後に表示） ── */
.filter-panel-inner {
  position: fixed;
  top: 90px;
  right: 10px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  z-index: 1;
  min-width: 104px;
}

.filter-panel-inner.visible {
  opacity: 1;
  pointer-events: auto;
}

.filter-panel-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 2px;
  padding-left: 2px;
}

.filter-divider {
  height: 1px;
  background: #eee;
  margin: 3px 0;
}

.filter-panel-inner .filter-btn {
  padding: 9px 0px 9px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  background: none;
  border: none;
}

.filter-panel-inner .filter-btn .right__btn {
  text-align: center;
  font-weight: bold;
  color: var(--color-main);
  font-size: 12px;
  margin-bottom: 4px;
}

.right__btn.pc {
  display: block;
}

.right__btn.sp {
  display: none;
}

.filter-panel-inner .filter-btn .right__btn__img {
  width: 90px;
  height: 90px;
  background-color: #fff;
  border-radius: 50px 0 0 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.filter-panel-inner .filter-btn .right__btn__img img {
  width: 70px;
}

.filter-panel-inner .filter-btn .check {
  margin-left: auto;
}

/* アクティブ時：右固定パネルでは枠線を消し、アイコン背景を着色（5カテゴリ共通）
   .visible の有無に関わらず常に無効化し、表示切り替えのタイミング差による
   枠線のチラつきを防ぐ */
.niku2026 .filter-panel-inner .filter-btn[data-cat="all"].active,
.niku2026 .filter-panel-inner .filter-btn[data-cat="牛"].active,
.niku2026 .filter-panel-inner .filter-btn[data-cat="豚"].active,
.niku2026 .filter-panel-inner .filter-btn[data-cat="鶏"].active,
.niku2026 .filter-panel-inner .filter-btn[data-cat="羊"].active {
  border: none;
}

.niku2026 .filter-btn[data-cat="all"].active .right__btn__img,
.niku2026 .filter-btn[data-cat="牛"].active .right__btn__img,
.niku2026 .filter-btn[data-cat="豚"].active .right__btn__img,
.niku2026 .filter-btn[data-cat="鶏"].active .right__btn__img,
.niku2026 .filter-btn[data-cat="羊"].active .right__btn__img {
  background-color: var(--color-main);
}

.niku2026 .filter-btn[data-cat="all"].active .right__btn,
.niku2026 .filter-btn[data-cat="牛"].active .right__btn,
.niku2026 .filter-btn[data-cat="豚"].active .right__btn,
.niku2026 .filter-btn[data-cat="鶏"].active .right__btn,
.niku2026 .filter-btn[data-cat="羊"].active .right__btn {
  color: #fff;
}

/* ── ページトップへ戻るボタン（右固定パネル内） ── */
.pagetop-btn {
  padding: 30px 0px 10px;
  color: var(--color-second);
  background-color: var(--color-bg);
  cursor: pointer;
  transition: all 0.18s;
  width: calc(100% - 12px);
  margin: 15px 0px 0 12px;
  border-radius: 50px 0 0 50px;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  font-size: 12px;
  position: relative;
}

.pagetop-btn::before {
  position: absolute;
  content: "";
  width: 26px;
  height: 16px;
  background-image: url(../images/arrow.svg);
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: center;
  top: 10px;
  left: 50%;
  transform: translate(-50%, 0);
}

.pagetop-btn:hover {
  opacity: 0.6;
}

/* トップへ戻るボタン（別スタイル） */
.back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid #ddd;
  background: transparent;
  color: #888;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
}

.back-to-top:hover {
  border-color: #d92e3e;
  color: #d92e3e;
}

.back-to-top svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

/* ── カードの絞り込み非表示制御 ── */
.wrap_shops .card.is-filtered-out {
  display: none !important;
}

/* ── モーダル内 <dt> カラー（棟別） ── */
.modal dt.dt-towers {
  background-color: #ea5539;
  color: #fff;
}

.modal dt.dt-gate {
  background-color: #4e361c;
  color: #fff;
}

/* ==========================================================================
   メディアクエリ（max-width: 1180px → 768px → 767px の順に統合）
   ========================================================================== */

@media screen and (max-width: 1180px) {
  .controls {
    margin: 0;
    padding: 40px 10px 20px;
    width: calc(100% - 20px);
  }
  .controls__lead {
    font-size: 20px;
    margin-bottom: 20px;
  }
  .controls__text {
    font-size: 12px;
    line-height: 1.4;
    margin: 0 auto 20px;
  }
  .niku2026 .controls .filter-group {
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 0 10px;
  }
  .niku2026 .filter-btn {
    padding: 24px 14px 8px;
    font-size: 0.82rem;
  }
  .sort__btn {
    margin: 0 auto;
    font-size: 12px;
  }
  .sort__img {
    width: 30%;
    margin: 0 auto;
  }

  .filter-btn img {
    width: 100%;
    height: auto;
  }
  img.sort__word {
    height: 18px;
    width: auto;
  }
}

@media screen and (max-width: 768px) {
  .sp {
    display: block;
  }
  #sort__anchor {
    scroll-margin-top: 40px; /* ← ここの数値 */
  }
}

@media screen and (max-width: 767px) {
  .pc {
    display: none;
  }
  /* ファーストビューの絞り込みボタン */
  .filter-btn {
    width: 48%;
  }
  .sort__title {
    margin: 30px auto 20px;
  }
  .sort__title img {
    height: 20px;
    width: auto;
  }

  .niku2026 .filter-btn {
    border-radius: 20px;
    padding: 16px 0px 4px;
    position: relative;
  }
  .niku2026 .controls .filter-group .filter-btn::before {
    position: absolute;
    content: "";
    width: 24px;
    height: 24px;
    background-size: 24px;
    background-image: url(../images/cate_arrow.png);
    bottom: 0;
    right: 0;
  }

  /* 右固定パネル → 下部固定・横一列レイアウトに切り替え */
  .filter-panel-inner {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 10px 0 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    min-width: unset;
    width: 100%;
    transform: translateX(0);
    /* セーフエリア対応（iPhoneホームバー） */
    /* padding-bottom: calc(10px + env(safe-area-inset-bottom)); */
  }

  /* ラベルと区切り線はSPでは非表示 */
  .filter-panel-label,
  .filter-divider {
    display: none;
  }

  /* ボタンを横並び・コンパクトに */
  .filter-panel-inner .filter-btn {
    padding: 10px 0px 0;
    font-size: 0.78rem;
    width: calc((100% - 40px) / 5);
    flex-direction: row;
    white-space: nowrap;
    margin: 0 4px 0;
  }
  .right__btn.pc {
    display: none;
  }
  .right__btn.sp {
    display: block;
  }
  .filter-btn.active .right__btn {
    color: #fff;
  }
  .filter-panel-inner .filter-btn .right__btn__img {
    width: auto;
    height: 70px;
    border-radius: 40px 40px 0 0;
    flex-direction: column;
    justify-content: end;
  }
  .filter-panel-inner .filter-btn .right__btn__img img {
    width: 50px;
  }

  .pagetop-btn {
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 30px 0 10px;
  }
  .pagetop-btn::before {
    content: none;
    padding: 20px 0;
  }
  .pagetop-btn .span {
    position: relative;
  }
  .pagetop-btn span::before {
    position: absolute;
    content: "";
    width: 26px;
    height: 16px;
    background-image: url(../images/arrow.svg);
    background-size: 24px;
    background-repeat: no-repeat;
    background-position: center;
    top: 10px;
    left: 50%;
    transform: translate(-50%, 0);
  }
  .cmn-footer--link_list {
    flex-direction: column;
    justify-content: flex-start;
    padding: 16px 0 66px 20px;
    margin-bottom: 0;
    border-top: #cbcbcb solid 1px;
  }
  .cmn-footer--copyright_wrapper {
    padding: 24px 0 100px;
    background-color: #00192d;
    text-align: center;
  }
  .cmn-footer {
    border: none !important;
    padding-bottom: 54px;
  }
}
