#searchForm.search-form {
  margin: 14px 0 8px 0;
}

.pc_only{
  display: none;
}

.fw-row {
  margin-bottom: 8px;
  width: 85%;
  display: flex;
  justify-content: center;
}

.search-input-wrapper {
  position: relative;
  width: min(520px, 100%);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  z-index: 1;
  pointer-events: none;
}

.q-input {
  padding: 8px 10px 8px 36px;
  width: 100%;
  box-sizing: border-box;
  font-family: "Shippori Mincho", serif;
}

.search-reset-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: color 0.2s ease, background-color 0.2s ease;
  z-index: 2;
}

.search-reset-btn:hover {
  color: #666;
  background-color: #f5f5f5;
}

.search-reset-btn:focus {
  outline: 2px solid var(--themered);
  outline-offset: 2px;
}

.form-section {
  margin: 6px 0;
}

.action-row {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  padding: 6px 30px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: "Shippori Mincho", serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--themered);
  color: white;
  border: none;
  width: 160px;
}

/* さらに表示するボタンなど、プライマリーボタンのホバー/アクティブ表現 */
.btn-primary:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  filter: brightness(0.93);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}



.btn-secondary {
  background: white;
  color: #333;
  border: 1px solid #ccc;
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: #999;
}
.cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 10%;
    justify-content: center;
    column-gap: 40px;
}
.card{
    width: 310px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
    position: relative;
    margin: 10px 0;
    transition: transform 0.2s ease;
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: scale(1.05);
  }
}
.card::after{
  content: "";
  height: 2px;
  width: 100%;
  position: absolute;
  background: var(--themered);
  bottom: 0;
  left: 0;
  transform: scaleY(.5);
}

.card_link {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 11;

}

.card_top{
  display: flex;
    width: 100%;
    height: 80px;
    gap: 10px;
}

.card_img{
  width: 80px;
  height: 80px;
  overflow: hidden;
}
.card_event{
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card_event p:nth-of-type(1){
  font-size: 15px;
  color: var(--themeblack);
  font-weight: bold;
  font-family: "Shippori Mincho", serif;
  height: 45px;
  line-height: 1.3;
  position: relative;
  text-align: start;
}

/* 1024px以上で15文字以上の時に14px */
@media (min-width: 1024px) {
  .card_event p:first-child.long-text {
    font-size: 14px;
  }
}
.card_event p:nth-of-type(1)::before{
  content: "";
  height: 1px;
  width: 100%;
  position: absolute;
  bottom: 1px;
  transform: scaleY(.5);
  display: block;
  background: var(--themered);

}

.card_event p:nth-of-type(2){
  font-size: 12px;
  color:var(--themeblack);
  font-family: "Shippori Mincho", serif;
  line-height: 1.2;
}

.card_food_items {
  font-size: 12px;
  color: var(--themeblack);
  font-family: "Shippori Mincho", serif;
  line-height: 1.2;
  margin-top: 2px;
}

.card_bottom{
  display: flex;
  gap: 5px;
  position: relative;
  margin-top: 5px;
}
p.card_genre, p.card_time {
    z-index: 12;
}

.card_genre,.card_time{
  display: inline-block;
  padding: 5px 15px;
  background: var(--beige40);
  border-radius: 15px;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}
.card_genre:hover {
  background: #d4c0a6;
}
.card_bottom p{
  font-size: 13px;
  color: var(--themered);
}

.card-genre-icon {
  width: 16px;
  height: 16px;
  margin-left: -5px;
  flex-shrink: 0;
}
.card_heart{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 27px;
  z-index: 12;
  cursor: pointer;
}


.card_heart img{
    width: 100%;
    height: 100%;
  }
.card_ticket{
    display: flex;
    align-items: center;
  }
.card_ticket img{
  height: 22px;
}

/* タブスタイル */
#searchForm {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-tabs {
  margin: 8px auto;
  width: min(520px, 85%);
}

.tab-buttons {
  display: flex;
  background: #f5f5f5;
  border-radius: 20px;
  padding: 4px;
  margin-bottom: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  width: 320px;
}

/* 選択中フィルタ（横スクロール） */
.active-filters-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 10px 4px;
  margin-bottom: 0;
  min-height: 40px; /* 何も選択していない時も高さを確保 */
}

/* 条件リセットボタン */
.filter-reset-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 8px 4px;
  margin-bottom: 8px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.filter-reset-btn {
  padding: 4px 8px;
  font-size: 11.5px;
  font-family: "Shippori Mincho", serif;
  background: #fff; /* 非アクティブは白背景 */
  color: var(--themered);
  border: 1px solid var(--themered);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* マウス操作の環境のみホバー色を適用（スマホでホバーが残る問題を回避） */
@media (hover: hover) and (pointer: fine) {
  .filter-reset-btn:hover {
    background: var(--beige40);
    color: var(--themered);
  }
}

.filter-reset-btn:focus { 
  outline: none; 
}
.filter-reset-btn:focus-visible { 
  outline: 2px solid var(--themered); 
  outline-offset: 2px; 
}

.active-filters-label {
  font-size: 10px;
  font-family: "Shippori Mincho", serif;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.active-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE, Edge */
  flex: 1;
}

/* Chrome, Safari用のスクロールバーを非表示 */
.active-filters::-webkit-scrollbar {
  display: none;
}
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid;
}

/* ジャンルのチップ */
.active-chip[data-type*="genres_sub"] {
  background: #fdeff2; /* 薄いピンク調 */
  color: #9d3b4b;      /* 赤系文字 */
  border-color: #f1c5cf;
}

/* 日程のチップ */
.active-chip[data-type*="days"] {
  background: #e3f2fd; /* 薄い青 */
  color: #1565c0;      /* 濃い青 */
  border-color: #bbdefb;
}

/* 時間のチップ */
.active-chip[data-type="time"] {
  background: #f3e5f5; /* 薄い紫 */
  color: #7b1fa2;      /* 濃い紫 */
  border-color: #e1bee7;
}

/* 場所のチップ */
.active-chip[data-type*="places"] {
  background: #e8f5e8; /* 薄い緑 */
  color: #2d5a2d;      /* 濃い緑 */
  border-color: #c8e6c8;
}
.active-chip .chip-remove {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.tab-button {
  padding: 7px 12px;
  border: none;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: "Shippori Mincho", serif;
  transition: all 0.2s ease;
  color: var(--themered);
  width: 50%;
}

.tab-button.active {
  background: var(--themered);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button:hover:not(.active) {
  background: var(--beige40);
  color: #374151;
}

.tab-content {
  display: none;
  padding: 8px 0;
}

.tab-content.active {
  display: block;
}

.action-row {
  justify-content: center;
}

/* チェックボックススタイル調整 */
.tab-content label {
  display: inline-block;
  margin: 4px 7px 4px 0;
  padding: 4px 8px;
  background: #f8f9fa;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tab-content label:hover {
  background: #e9ecef;
}

.tab-content input[type="checkbox"] {
  margin-right: 6px;
}

.tab-content strong {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
}

/* ===== チップ型チェックボックス（日時・場所） ===== */
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--beige40);
  color: var(--themered);
  user-select: none;
}

.chip-input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.chip span {
  pointer-events: none;
}

.chip-input:checked + span {
  color: #fff;
}

.chip:has(.chip-input:checked) {
  background: var(--themered);
}

/* JSでも視覚同期できるよう冗長指定 */
.chip.selected {
  background: var(--themered);
}
.chip.selected span {
  color: #fff;
}

.chip:has(.chip-input:focus-visible) {
  outline: 2px solid #555;
  outline-offset: 2px;
}

/* ===== ジャンルタブ：大分類→小分類の縦並び ===== */
.genre-group {
  padding: 8px 0 8px 0;
  border-bottom: 1px solid var(--themered);
}

.genre-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.genre-title {
  font-size: 16px;
  font-weight: 700;
  font-family: "Shippori Mincho", serif;
  color: var(--themered);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.genre-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.select-all-btn {
  padding: 4px 8px;
  font-size: 10px;
  font-family: "Shippori Mincho", serif;
  background: #fff; /* 非アクティブは白背景 */
  color: var(--themered);
  border: 1px solid var(--themered);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* マウス操作の環境のみホバー色を適用（スマホでホバーが残る問題を回避） */
@media (hover: hover) and (pointer: fine) {
  .select-all-btn:hover {
    background: var(--beige40);
    color: var(--themered);
  }
}

.select-all-btn:focus { outline: none; }
.select-all-btn:focus-visible { outline: 2px solid var(--themered); outline-offset: 2px; }

/* すべて選択状態（= すべてチェック済み）の見た目 */
.select-all-btn.is-active {
  background: var(--themered);
  color: #fff;
}

.genre-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
}

.genre-subs.none {
  color: #888;
  font-size: 13px;
}

/* ===== ジャンル：アコーディオン ===== */
.genre-accordion-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}


.accordion-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: "Shippori Mincho", serif;
  border-radius: 8px;
  border: 1px solid var(--themered);
  background: var(--themered);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.accordion-toggle.is-active {
  background: #fff;
  color: var(--themered);
}

.accordion-text {
  flex: 1;
}

.accordion-arrow {
  font-size: 12px;
  font-weight: bold;
  transition: transform 0.2s ease;
  display: inline-block;
  min-width: 12px;
  text-align: center;
  transform: rotate(180deg);
}

.accordion-toggle[aria-expanded="false"] .accordion-arrow {
  transform: rotate(0deg);
}

.genre-accordion-body {
  transition: max-height .25s ease, padding .25s ease;
}

.genre-accordion-body.is-open {
  max-height: 2000px;
}

.genre-accordion-body.is-closed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}


.pager{
  justify-content: center;
}

.card_surr img{
  width: 80px;
  height: 80px;
  overflow: hidden;
}

#result-meta{
  margin:20px 10% 0;
  color:#666;
}

/* 1024px以上で検索フォームを左側に固定 */
@media (min-width: 1024px) {
  #searchForm.search-form {
    position: fixed;
    left: 0;
    top: 0;
    width: 350px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    z-index: 1000;
    padding: 60px 20px 60px 20px;
    box-sizing: border-box;
    margin: 0;
    background: var(--themewhite);
    /* スクロールバーを非表示 */
    -ms-overflow-style: none;  /* IE, Edge */
    scrollbar-width: none;  /* Firefox */
    border-right: 10px solid #ECE3D7;
  }
  
  /* Chrome, Safari用のスクロールバーを非表示 */
  #searchForm.search-form::-webkit-scrollbar {
    display: none;
  }
  
  /* キーワード検索、選択中の条件、タブ部分を固定 */
  #searchForm.search-form .fw-row {
    position: sticky;
    top: 0;
    background: var(--themewhite);
    z-index: 1003;
    padding: 30px 0 8px 0;
    margin: -10px 0 0 0;
  }
  
  .pc_only{
    display: block;
  }

  .active-filters-container-wrapper{
    background: var(--themewhite);
    position: sticky;
    top: 70px;
    z-index: 1004;
    padding-bottom: 3px;
  }

  .active-filters-container {
    position: sticky;
    top: 70px; /* キーワード検索の下（パディング30px + 高さ40px） */
    background: var(--themewhite);
    z-index: 1002;
    padding: 10px 0;
    margin: -10px 0 5px 0;
  }
  
  .tab-buttons {
    position: sticky;
    top: 110px; /* 選択中の条件の下（キーワード70px + 選択中の条件60px） */
    background: var(--themewhite);
    z-index: 1001;
    padding: 10px 0;
    margin: -10px auto 15px;
  }
  
  /* メインコンテンツを右側に配置 */
  body {
    margin-left: 340px;
    width: calc(100vw - 340px);
    overflow-x: hidden;
  }
  
  /* 検索フォーム内の要素を調整（上記のstickyスタイルと併用） */
  #searchForm.search-form .fw-row {
    width: 100%;
    justify-content: flex-start;
    display: flex;
  }
  
  #searchForm.search-form .search-input-wrapper {
    width: 100%;
  }
  
  #searchForm.search-form .search-tabs {
    width: 100%;
  }
  
  #searchForm.search-form .action-row {
    justify-content: flex-start;
  }
  .cards{
    padding: 0 5%;
    column-gap: 30px;
    row-gap: 10px;
  }
  .tab-buttons{
    width: 280px;
  }
  .genre-group {
    padding: 8px 0 12px 0;
  }
.select-all-btn{
  font-size: 12px;
}
.all-day-btn {
  font-size: 12px;
}
.filter-reset-btn {
  font-size: 12px;
}
.tab-content label {
  margin: 4px 10px 4px 0;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 15px;
}
.active-chip{
  font-size: 14px;
}
  /* 模擬店コンテスト誘導ボタンのレイアウト調整 */
  .contest-promotion {
    width: 100%;
    flex-basis: 100%;
    margin: 0 auto 20px;
    text-align: center;
  }
  .contest-promotion .btn {
    display: inline-block;
  }
  
  /* おすすめ企画ボタンのレイアウト調整 */
  .recommendation-promotion {
    width: 100%;
    flex-basis: 100%;
    margin: 0 auto 20px;
    text-align: center;
  }
  .recommendation-promotion .btn {
    display: inline-block;
  }
  
  /* MAP検索誘導ボタンのレイアウト調整 */
  .map-promotion {
    width: 85%;
    margin: 0 auto ;
    text-align: center;
  }
  .map-promotion .btn {
    display: inline-block;
  }
}

/* 時間選択UI */
.time-input-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 14px;
  background: var(--beige40);
  color: var(--themered);
  min-width: 100px;
  font-family: "Shippori Mincho", serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-select:hover {
  background: #e9ecef;
}

.time-select:focus {
  outline: none;
  border-color: var(--themered);
  box-shadow: 0 0 0 2px rgba(174, 57, 35, 0.2);
}

.time-select option:disabled {
  color: #ccc;
  background-color: #f5f5f5;
}

/* 終日開催ボタン */
.all-day-btn {
  padding: 4px 8px;
  font-size: 10px;
  font-family: "Shippori Mincho", serif;
  background: #fff; /* 非アクティブは白背景 */
  color: var(--themered);
  border: 1px solid var(--themered);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* マウス操作の環境のみホバー色を適用（スマホでホバーが残る問題を回避） */
@media (hover: hover) and (pointer: fine) {
  .all-day-btn:hover {
    background: var(--beige40);
    color: var(--themered);
  }
}

.all-day-btn:focus { 
  outline: none; 
}
.all-day-btn:focus-visible { 
  outline: 2px solid var(--themered); 
  outline-offset: 2px; 
}

/* アクティブ状態（= 終日開催を除く状態）の見た目 */
.all-day-btn.active {
  background: var(--themered);
  color: #fff;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  /* MAP検索誘導ボタンのモバイル表示 */
  .map-promotion {
    margin:0 auto;
    text-align: center;
  }
  .map-promotion .btn {
    display: inline-block;
  }
}

/* 1024px以上の固定レイアウトでの調整 */
@media (min-width: 1024px) {
  .active-chip {
    padding: 1px 6px;
  }
  .active-filters-container {
    min-height: 45px;
  }
  .all-day-btn {
    font-size: 14px;
  }
}