:root {
  --footer-h: 64px;
}

/* 下固定検索に被らないように */
main {
  padding-bottom: calc(var(--footer-h) + 16px);
}

.siteFooterSearch {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--footer-h);
  background: rgba(255, 235, 59, 0.35);
  border-top: 1px solid #e6e6e6;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
}

.siteFooterSearch__inner {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 12px;
}

#globalSearchForm {
  display: block;
}

.searchWrap {
  position: relative;
}

.searchWrap input {
  width: 100%;
  font: inherit;
  padding: 10px 12px 10px 36px; /* 左アイコン分 */
  border-radius: 999px;
  border: 1px solid #ddd;
}

.searchIcon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}

/* ===== 検索結果パネル ===== */
.searchPanel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--footer-h);
  z-index: 49;
  background: rgba(255, 235, 59, 0.15);
  border-top: 1px solid #e6e6e6;
  backdrop-filter: blur(8px);
  max-height: min(60vh, 520px);
  overflow: auto;
}

.searchPanel__inner {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px;
}

.searchPanel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.searchMeta {
  font-size: 12px;
  opacity: 0.7;
}

.searchClose {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.searchResults a {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.searchResults a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.searchResults .hitTitle {
  font-weight: 600;
}

/* ===== iOS safe-area 対応 ===== */
.siteFooterSearch {
  padding-bottom: env(safe-area-inset-bottom);
}

.searchPanel {
  bottom: calc(var(--footer-h) + env(safe-area-inset-bottom));
}

.searchWrap input {
  -webkit-appearance: none;
  appearance: none;
  background: #ffffff;
  color: #111;
  box-shadow: none;
}

.searchWrap input::-webkit-search-decoration,
.searchWrap input::-webkit-search-cancel-button,
.searchWrap input::-webkit-search-results-button,
.searchWrap input::-webkit-search-results-decoration {
  display: none;
}

/* 検索ボックス：×が下に落ちないようにする */
.searchWrap {
  position: relative;
  width: 100%;
}

/* 入力欄は右側に×のスペースを確保 */
#globalSearchInput {
  width: 100%;
  box-sizing: border-box;
  padding-right: 52px; /* ←×ボタン分 */
}

/* ×ボタンを入力の右端に固定 */
#clearBtn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);

  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 1;

  display: grid;
  place-items: center;

  border: 1px solid #111;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;

  border: none;
  font-size: 1.7em;
  color: #222;
}
