/**
 * 公開サイト検索（Google カスタム検索）
 * css/style.css は変更せず、ヘッダ虫眼鏡・SPメニュー用の上書きのみ
 *
 * 展開枠は検索窓1行分のみ。結果エリアは出さない（オーバーレイ側）。
 */

.c-header,
.c-header .l-container,
.c-header__in,
.c-gnav-wrap {
  overflow: visible;
}

/* =========================================================
  ヘッダ：虫眼鏡アイコン
========================================================= */
.c-header-search {
  position: relative;
  flex-shrink: 0;
  margin: 0 0.75rem 0 0;
}

.c-header-search__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.c-header-search__btn:hover,
.c-header-search__btn:focus-visible {
  outline: none;
  background: #e5f4fd;
}

.c-header-search__icon {
  display: block;
  width: 22px;
  height: 22px;
  background-color: #2c3e50;
  -webkit-mask: url(../images/icon/icon_search_w.svg) center / contain no-repeat;
  mask: url(../images/icon/icon_search_w.svg) center / contain no-repeat;
}

.c-header-search__btn:hover .c-header-search__icon,
.c-header-search.is-open .c-header-search__icon {
  background-color: #0399eb;
}

.c-header-search.is-open .c-header-search__icon {
  -webkit-mask-image: url(../images/icon/icon_multiply_w.svg);
  mask-image: url(../images/icon/icon_multiply_w.svg);
}

/* 高さは入力1行＋余白（縦2文字程度） */
.c-header-search__panel {
  position: fixed;
  top: 100px;
  right: 40px;
  left: auto;
  z-index: 1100;
  width: 360px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0.5rem 0.5rem 2rem rgba(0, 0, 0, 0.1);
  overflow: visible;
  visibility: visible;
  opacity: 1;
}

.c-header-search:not(.is-open) .c-header-search__panel {
  top: 0;
  right: auto;
  left: -9999px;
  pointer-events: none;
}

.c-header-search.is-open .c-header-search__panel {
  pointer-events: auto;
}

@media screen and (max-width: 1199px) {
  .c-header-search {
    margin: 0;
  }

  .c-header-search__btn {
    position: fixed;
    top: 30px;
    right: 100px;
    z-index: 1001;
    width: 60px;
    height: 60px;
    background: #0399eb;
  }

  .c-header-search__btn:hover,
  .c-header-search__btn:focus-visible,
  .c-header-search.is-open .c-header-search__btn {
    background: #0288d1;
  }

  .c-header-search__icon,
  .c-header-search__btn:hover .c-header-search__icon,
  .c-header-search.is-open .c-header-search__icon {
    background-color: #fff;
  }

  .c-header-search.is-open .c-header-search__panel {
    top: 100px;
    left: 15px;
    right: 15px;
    width: auto;
    min-height: 0;
  }
}

@media screen and (max-width: 991px) {
  .c-header-search__btn {
    top: 25px;
    right: 90px;
  }

  .c-header-search.is-open .c-header-search__panel {
    top: 90px;
  }
}

@media screen and (max-width: 767px) {
  .c-header-search__btn {
    top: 15px;
    right: 80px;
    width: 50px;
    height: 50px;
  }

  .c-header-search.is-open .c-header-search__panel {
    top: 80px;
  }
}

@media screen and (max-width: 575px) {
  .c-header-search__btn {
    right: 76px;
  }
}

/* =========================================================
  Google CSE：薄いグレーの入力＋右に青い虫眼鏡
========================================================= */
.c-gcse {
  position: relative;
  min-height: 0;
  line-height: 1;
}

/* 右端の虫眼鏡＝検索ボタン */
.c-gcse__submit {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.c-gcse__submit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -9px 0 0 -9px;
  border: 2px solid #0399eb;
  border-radius: 50%;
  box-sizing: border-box;
}

.c-gcse__submit::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 8px;
  margin: 3px 0 0 3px;
  background: #0399eb;
  border-radius: 1px;
  transform: rotate(-45deg);
}

.c-gcse__submit:hover::after {
  border-color: #0288d1;
}

.c-gcse__submit:hover::before {
  background: #0288d1;
}

.c-gcse .gsc-control-cse,
.c-gcse .gsc-control-cse-en,
.c-gcse .gsc-control-cse-ja {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  font-family: inherit !important;
  width: 100% !important;
}

/* 結果ブロック・ブランド・余分なセルは展開枠に出さない */
.c-gcse .gsc-results-wrapper-nooverlay,
.c-gcse .gsc-results,
.c-gcse .gsc-above-wrapper-area,
.c-gcse .gsc-adBlock,
.c-gcse .gsc-branding,
.c-gcse .gcsc-branding,
.c-gcse .gcsc-more-maybe-branding-root,
.c-gcse td.gsc-clear-button,
.c-gcse .gsc-clear-button,
.c-gcse td.gsib_b,
.c-gcse .gsst_b,
.c-gcse .gscb_a {
  display: none !important;
}

.c-gcse table,
.c-gcse tbody,
.c-gcse tr,
.c-gcse td {
  border: none !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: transparent !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.c-gcse .gsc-search-box,
.c-gcse table.gsc-search-box,
.c-gcse form.gsc-search-box {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 6px !important;
  background: #f3f3f3 !important;
  overflow: hidden;
  box-sizing: border-box !important;
  table-layout: fixed !important;
}

.c-gcse table.gsc-search-box td.gsc-input {
  padding: 0 !important;
  width: calc(100% - 42px) !important;
  border: none !important;
}

.c-gcse .gsc-input-box,
.c-gcse .gsc-input-box-hover,
.c-gcse .gsc-input-box-focus {
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.c-gcse .gsc-input-box table,
.c-gcse .gsc-input-box table td.gsib_a {
  width: 100% !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

.c-gcse input.gsc-input,
.c-gcse .gsc-input {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 40px !important;
  line-height: 40px !important;
  margin: 0 !important;
  padding: 0 40px 0 12px !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent none !important;
  background-image: none !important;
  color: #2c3e50 !important;
  font-size: 16px !important;
  text-align: left !important;
  text-indent: 0 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  -webkit-appearance: textfield !important;
  appearance: textfield !important;
  box-sizing: border-box !important;
}

.c-gcse .gsc-search-button,
.c-gcse td.gsc-search-button {
  width: 42px !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

/* Google 標準ボタンは透明にして、右端のクリック領域だけ残す */
.c-gcse .gsc-search-button-v2,
.c-gcse input.gsc-search-button {
  display: block !important;
  min-width: 42px !important;
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0 !important;
  color: transparent !important;
  opacity: 0;
  pointer-events: auto !important;
  cursor: pointer;
}

.c-gcse .gsc-search-button-v2 svg,
.c-gcse .gsc-search-button-v2 path {
  display: none !important;
}

.c-gcse .gsc-search-button-v2:hover,
.c-gcse input.gsc-search-button:hover {
  background: transparent !important;
}

.gsc-modal-background-image,
.gsc-results-wrapper-overlay {
  z-index: 10050 !important;
}

.gsc-results-close-btn {
  z-index: 10051 !important;
}
