/* ========================================
   言語バー切り替えスタイル
   ======================================== */

/* フォント設定 */
body {
  font-family: "メイリオ", "Meiryo", "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", sans-serif;
}

/* 共通設定 */
.language-variations {
  display: none !important;
}

.language-variations.active {
  display: block !important;
}

/* 現在の言語バーを非表示 */
body.demo-mode .header_link,
body.demo-mode .header_link_sp {
  display: none !important;
}

/* 案1: テキスト形式を強制表示時のヘッダーリンク非表示 */
.header_link {
  display: none !important;
}

/* ========================================
   バリエーション1: テキスト形式（JA | EN）
   ======================================== */
.lang-style-text {
  width: 100%;
  display: flex !important;
  justify-content: flex-end;
  margin: 0 0 20px 0;
  height: 24px;
}

.lang-style-text ul {
  display: flex;
  align-items: center;
  gap: 0;
}

.lang-style-text li {
  position: relative;
  padding: 0 12px;
  border-right: 1px solid #999999;
}

.lang-style-text li:last-child {
  border-right: none;
  padding-right: 0;
}

.lang-style-text li:first-child {
  padding-left: 0;
}

.lang-style-text a {
  color: #666666 !important; /* グレー系デフォルト */
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.lang-style-text a:hover {
  color: #333333 !important; /* ホバー時は濃いグレー */
}

.lang-style-text a.active {
  color: #0066cc !important; /* アクティブは青系 */
  font-weight: bold !important;
}

/* SP版 */
.lang-style-text-sp {
  display: none;
}

/* ========================================
   バリエーション2: 国旗アイコン形式
   ======================================== */
.lang-style-flags {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 0 0 20px 0;
  height: 30px;
}

.lang-style-flags ul {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-style-flags li {
  position: relative;
}

.lang-style-flags a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.lang-style-flags a:hover {
  background-color: #f0f0f0;
}

.lang-style-flags a.active {
  background-color: #ff6633;
}

.lang-style-flags .flag-icon {
  width: 32px;
  height: 24px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid #e0e0e0; /* 薄いグレーのボーダー */
  border-radius: 2px; /* 角を少し丸く */
}

.lang-style-flags .lang-name {
  font-size: 13px;
  color: #333333;
}

.lang-style-flags a.active .lang-name {
  color: #ffffff;
}

/* 国旗画像（SVGファイル） */
.flag-jp {
  background-image: url("../images/flags/jp.svg");
}
.flag-en {
  background-image: url("../images/flags/gb.svg");
}
.flag-kr {
  background-image: url("../images/flags/kr.svg");
}
.flag-vn {
  background-image: url("../images/flags/vn.svg");
}
.flag-th {
  background-image: url("../images/flags/th.svg");
}
.flag-cn {
  background-image: url("../images/flags/cn.svg");
}
.flag-tw {
  background-image: url("../images/flags/tw.svg");
}
.flag-id {
  background-image: url("../images/flags/id.svg");
}
.flag-my {
  background-image: url("../images/flags/my.svg");
}

/* SP版 */
.lang-style-flags-sp {
  display: none;
}

/* ========================================
   バリエーション3: ドロップダウン形式
   ======================================== */
.lang-style-dropdown {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 0 0 20px 0;
  height: 30px;
}

.lang-dropdown-container {
  position: relative;
}

.lang-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: #f5f5f5;
  border: 1px solid #dddddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #333333;
  min-width: 140px;
  justify-content: space-between;
  transition: background-color 0.2s;
}

.lang-dropdown-toggle:hover {
  background-color: #eeeeee;
}

.lang-dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #666666;
  transition: transform 0.2s;
}

.lang-dropdown-container.open .lang-dropdown-arrow {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 140px;
  z-index: 1000;
  display: none;
}

.lang-dropdown-container.open .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-menu ul {
  padding: 4px 0;
}

.lang-dropdown-menu li {
  list-style: none;
}

.lang-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #333333;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s;
}

.lang-dropdown-menu a:hover {
  background-color: #f5f5f5;
}

.lang-dropdown-menu a.active {
  background-color: #ff6633;
  color: #ffffff;
}

/* SP版 */
.lang-style-dropdown-sp {
  display: none;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media screen and (max-width: 768px) {
  body.demo-mode .header_link {
    display: none !important;
  }

  body.demo-mode .header_link_sp {
    display: none !important;
  }

  .lang-style-text {
    display: none !important;
  }

  .lang-style-text-sp {
    display: flex !important;
    flex-wrap: wrap;
    width: 100%;
    border-top: 1px solid #cccccc;
    margin-bottom: 50px;
  }

  .lang-style-text-sp ul {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .lang-style-text-sp li {
    width: calc(100% / 3);
    box-sizing: border-box;
    border-right: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
    padding: 0;
  }

  .lang-style-text-sp a {
    display: block;
    width: 100%;
    padding: 8px 0;
    text-align: center;
    background-color: #f5f5f5 !important;
    color: #666666 !important; /* グレー系デフォルト */
    font-size: 14px;
    font-weight: 500;
  }

  .lang-style-text-sp a.active {
    background-color: #0066cc !important; /* アクティブは青系背景 */
    color: #ffffff !important;
  }

  /* 国旗アイコンSP版 */
  .lang-style-flags {
    display: none;
  }

  .lang-style-flags-sp {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-top: 1px solid #cccccc;
    margin-bottom: 50px;
  }

  .lang-style-flags-sp ul {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .lang-style-flags-sp li {
    width: calc(100% / 3);
    box-sizing: border-box;
    border-right: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
  }

  .lang-style-flags-sp a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px 0;
    background-color: transparent; /* 背景色を無効化 */
  }

  .lang-style-flags-sp a.active {
    background-color: transparent; /* 背景色を無効化 */
  }

  .lang-style-flags-sp .flag-icon {
    width: 28px;
    height: 21px;
    border: 1px solid #e0e0e0; /* 薄いグレーのボーダー */
    border-radius: 2px; /* 角を少し丸く */
  }

  .lang-style-flags-sp .lang-name {
    font-size: 12px;
  }

  /* ドロップダウンSP版 */
  .lang-style-dropdown {
    display: none;
  }

  .lang-style-dropdown-sp {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border-top: 1px solid #cccccc;
    margin-bottom: 30px;
  }

  .lang-style-dropdown-sp .lang-dropdown-container {
    width: 100%;
  }

  .lang-style-dropdown-sp .lang-dropdown-toggle {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
  }

  .lang-style-dropdown-sp .lang-dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
  }

  .lang-style-dropdown-sp .lang-dropdown-menu a {
    padding: 12px 20px;
    font-size: 16px;
  }
}
