/* =========================================================
   SPメインナビ（完全版CSS）
   - 元デザイン寄せ（背景/罫線）
   - 商品詳細：アコーディオン（閉→＋ / 開→−）
     ※開いた状態は p.js-accordionBtn に .open が付与される前提
   - 下ナビ：2列グリッド（可変幅）
   - 右端 › 表示
   - 外部リンク：元サイト準拠 PNGアイコン（/img/shared/ico-blank-blue.png）
   - PCでは非表示（min-width: 768px）
   ========================================================= */

/* ===== 色（必要ならここだけ調整） ===== */
:root {
  --nav-bg: #bde8ff;
  /* 背景 */
  --nav-border: #57bcfe;
  /* 罫線 */
  --nav-border2: #d9d9d9;
  /* 商品詳細内の薄い区切り */
  --text: #1a1a1a;
  --arrow: #7a7a7a;
  --white: #ffffff;

  /* 元サイト外部リンクアイコン */
  --ext-icon-url: url(/img/shared/ico-blank-blue.png);
  --ext-icon-size: 10px;
}

/* ===== SPでは表示（デフォルト） ===== */
.spmainNav {
  display: block;
  width: 100%;
  max-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP",
    "Hiragino Kaku Gothic ProN", Meiryo, Arial, sans-serif;
  color: var(--text);
}

.spmainNav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ===== PCでは非表示（必要に応じて 769px/1024px に変更） ===== */
@media screen and (min-width: 768px) {
  .spmainNav {
    display: none !important;
  }
}

/* =========================================================
   商品詳細（アコーディオン）
========================================================= */
.spmainNav .accordion>li {
  /* border: 1px solid var(--nav-border); */
  overflow: hidden;
  background: var(--nav-bg);
}

/* 見出し（商品詳細） */
.spmainNav .js-accordionBtn {
  margin: 0;
  position: relative;
  padding: 12px 56px 12px 15px;
  /* 右側に＋/−のスペース */
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

/* ＋（デフォルト：閉）… 横線と縦線を疑似要素で作る */
.spmainNav .js-accordionBtn::before,
.spmainNav .js-accordionBtn::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 20px;
  height: 3px;
  background-color: #212121;
  transform: translateY(-50%);
}

/* 縦線（回転） */
.spmainNav .js-accordionBtn::after {
  transform: translateY(-50%) rotate(90deg);
}

/* 開いた状態（pに open が付いたら − にする：縦線を消す） */
.spmainNav .js-accordionBtn.open::after {
  opacity: 0;
}

/* 中身（表示/非表示は既存JSに任せる）
   ※ここで display:block を強制すると「初期閉」を崩すので入れない */
.spmainNav .js-accordionDetail {
  background: var(--white);
}

/* 商品詳細内リンク */
.spmainNav .js-accordionDetail>li {
  border-bottom: 1px solid var(--nav-border2);
}

.spmainNav .js-accordionDetail>li:last-child {
  border-bottom: 0;
}

.spmainNav .js-accordionDetail a {
  display: block;
  position: relative;
  padding: 12px 44px 12px 15px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.25;
  background: var(--white);
}

/* 商品詳細内の右矢印 */
.spmainNav .js-accordionDetail a::after {
  content: "›";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--arrow);
  line-height: 1;
}

/* =========================================================
   下ナビ（2列・可変）
========================================================= */
.spmainNav .nav {
  /* margin-top: 10px; */
  /* border: 1px solid var(--nav-border); */
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* background: var(--nav-bg); */
}

.spmainNav .nav>li {
  border-right: 1px solid var(--nav-border);
  border-bottom: 1px solid var(--nav-border);
  min-height: 44px;
  display: flex;
  background: var(--nav-bg);
}

.spmainNav .nav>li:nth-child(2n) {
  border-right: 0;
}

/* セル内リンク */
.spmainNav .nav>li>a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 10px;
  padding-right: 36px;
  /* ›分 */
  text-align: center;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
  background: var(--nav-bg);
}

/* 右端 › */
.spmainNav .nav>li>a::after {
  content: "›";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--arrow);
  line-height: 1;
}

/* 外部リンク（target=_blank）に元サイト準拠アイコンを追加 */
.spmainNav .nav a[target="_blank"] {
  padding-right: 56px;
  /* アイコン＋›分 */
}

/* 外部アイコンは › の左に配置 */
.spmainNav .nav a[target="_blank"]::before {
  content: "";
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--ext-icon-size);
  height: var(--ext-icon-size);
  background: var(--ext-icon-url) no-repeat 0 0;
  background-size: var(--ext-icon-size) var(--ext-icon-size);
}

/* 空セル */
.spmainNav .nav>li.no_link {
  /* background: var(--nav-bg); */
  background: none;
  height: 42.55px;
  border-bottom: 0;
}

/* ログイン（全幅） */
.spmainNav .nav>li.login {
  grid-column: 1 / -1;
  border-right: 0;
  background: var(--white);
}

.spmainNav .nav>li.login>a {
  background: var(--white);
  font-weight: 700;
}

/* ログインに矢印/外部アイコンを出したくない場合はON */
/*
.spmainNav .nav > li.login > a::after,
.spmainNav .nav > li.login > a::before{
  content: none !important;
}
*/

/* 超狭幅フォールバック（任意） */
@media (max-width: 320px) {
  .spmainNav .nav {
    grid-template-columns: 1fr;
  }

  .spmainNav .nav>li {
    border-right: 0;
  }
}

/* SP時だけ非表示 */
@media screen and (max-width: 767px) {
  #header .pcGlobalNav {
    display: none !important;
  }
}