/* = Google翻訳バー
--------------------------------------------------- */
/* 翻訳後にGoogleが挿入する標準バーだけを隠し、ページの押し下げを戻す */
body {
  top: 0 !important;
}

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd {
  display: none !important;
  visibility: hidden !important;
}

/* Googleの挿入UIはサイズが読めないため、ナビの横幅計算に混ぜず固定フロートにする */
.google-translate-bar {
  position: fixed;
  top: var(--google-translate-float-top, 132px);
  right: 16px;
  left: auto;
  z-index: 1028;
  width: min(260px, calc(100vw - 32px));
  transition:
    top 0.3s ease,
    right 0.28s ease,
    width 0.28s ease;
}

.google-translate-bar__inner {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  min-height: 38px;
  color: #2b2b2b;
  background: #fff;
  border: 1px solid rgba(35, 35, 35, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.google-translate-bar__label {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  align-self: stretch;
  padding: 0 11px;
  color: #fff;
  background: #fa4647;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    width 0.28s ease,
    padding 0.28s ease;
  appearance: none;
}

.google-translate-bar__label i {
  color: #fff;
  font-size: 16px;
}

.google-translate-bar__label-text {
  display: inline-block;
  max-width: 3em;
  overflow: hidden;
  opacity: 1;
  transition:
    max-width 0.2s ease,
    opacity 0.18s ease;
}

.google-translate-bar__widget {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  max-width: 220px;
  min-width: 0;
  padding: 0;
  background: #f7f7f7;
  opacity: 1;
  visibility: visible;
  transition:
    max-width 0.28s ease,
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.google-translate-bar .goog-te-gadget {
  width: 100%;
  color: #555;
  font-size: 11px;
  line-height: 1.2;
}

.google-translate-bar .goog-te-gadget-simple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border-color: transparent;
  border-radius: 0;
  background: #f8f8f8;
  box-sizing: border-box;
}

.google-translate-bar .goog-te-gadget-simple span {
  color: #222 !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

.google-translate-bar .goog-te-gadget-simple a {
  display: inline-flex !important;
  align-items: center;
  color: #222 !important;
  text-decoration: none !important;
}

.google-translate-bar .goog-te-gadget-simple span[style*="border-left"] {
  display: none !important;
  border: 0 !important;
}

.google-translate-bar .goog-te-gadget-simple span[aria-hidden="true"] {
  margin-left: 6px;
  color: #9a9a9a !important;
  font-size: 12px !important;
  transform: translateY(-1px);
}

.google-translate-bar .goog-te-gadget-simple::before {
  content: "";
  display: inline-flex;
  flex: 0 0 20px;
  width: 20px !important;
  height: 20px !important;
  margin: 0 8px 0 0;
  background: url("../img/google_favicon_2025.svg") center / contain no-repeat;
}

/* GoogleのGIFスプライトや透明画像は線が混じるため、添付SVGに置き換える */
.google-translate-bar .goog-te-gadget-simple img {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

.google-translate-bar select.goog-te-combo {
  width: 100%;
  max-width: none;
  min-height: 28px;
  margin: 0;
  border: 1px solid #ced4da;
  border-radius: 8px;
  color: #222;
  background: #fff;
  font-size: 13px;
}

.google-translate-bar.is-collapsed {
  right: 0;
  left: auto;
  width: 44px;
}

.google-translate-bar.is-collapsed .google-translate-bar__inner {
  border-right: 0;
  border-radius: 12px 0 0 12px;
}

.google-translate-bar.is-collapsed .google-translate-bar__label {
  width: 43px;
  padding: 0;
}

.google-translate-bar.is-collapsed .google-translate-bar__label-text {
  max-width: 0;
  opacity: 0;
}

.google-translate-bar.is-collapsed .google-translate-bar__widget {
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 520px) {
  /* SPではフッターナビの上に固定し、ヘッダー検索の操作を邪魔しない */
  .google-translate-bar {
    top: auto;
    right: 10px;
    left: auto;
    bottom: 82px;
    width: min(248px, calc(100vw - 20px));
  }

  .google-translate-bar__inner {
    min-height: 38px;
  }

  .google-translate-bar__label {
    padding: 0 9px;
    font-size: 11px;
  }

  .google-translate-bar select.goog-te-combo {
    max-width: none;
  }

  .google-translate-bar.is-collapsed {
    right: 0;
    left: auto;
    width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .google-translate-bar,
  .google-translate-bar__label,
  .google-translate-bar__label-text,
  .google-translate-bar__widget {
    transition: none;
  }
}
