/* =========================================
   MY ROUTINE header custom
========================================= */

.myr-header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
  z-index: 1000;
}

.myr-header__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px 0;
  box-sizing: border-box;
  position: relative;
}

.myr-header__top {
  position: relative;
  min-height: 56px;
}

/* ロゴ */
.myr-header__logo {
  text-align: center;
}

.myr-header__logo a {
  display: inline-block;
  line-height: 1;
  text-decoration: none;
}

.myr-header__logo img {
  width: 240px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* PC右：カート */
.myr-header__icons {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
}

.myr-header__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.myr-header__icon:hover,
.myr-header__icon:focus {
  color: #c8102e;
  text-decoration: none;
  opacity: 1;
}

.myr-header__icon--cart {
  padding-right: 4px;
}

.myr-header__cart-img {
  display: block;
  width: 32px;
  height: 32px;
}

.myr-header__cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c8102e;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
}

/* PCナビ */
.myr-header__nav {
  margin-top: 20px;
  border-top: 1px solid #ededed;
  padding-top: 14px;
}

.myr-header__menu {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: 0;
}

.myr-header__menu li {
  display: inline-block;
  vertical-align: middle;
  margin: 0 18px;
}

.myr-header__menu a {
  display: inline-block;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  background: transparent;
}

.myr-header__menu a:hover,
.myr-header__menu a:focus {
  color: #c8102e;
  border-bottom-color: #c8102e;
  text-decoration: none;
  opacity: 1;
}

/* スマホ左：初期非表示 */
.myr-header__mobile-left {
  display: none;
}

/* スマホ右：初期非表示 */
.myr-header__mobile-right {
  display: none;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  align-items: center;
  gap: 14px;
}

/* ハンバーガー */
.myr-header__mobile-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 28px;
  height: 24px;
  cursor: pointer;
}

.myr-header__mobile-toggle span {
  display: block;
  width: 28px;
  height: 2px;
  background: #111;
  margin: 6px 0;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.2s ease;
}

.myr-header__mobile-toggle:hover span,
.myr-header__mobile-toggle:focus span {
  background: #c8102e;
}

/* スマホメニュー */
.myr-header__mobile-menu {
  display: none;
  width: 100%;
  border-top: 1px solid #e5e5e5;
  margin-top: 14px;
  padding-top: 12px;
}

.myr-header__mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.myr-header__mobile-menu li {
  border-bottom: 1px solid #f0f0f0;
}

.myr-header__mobile-menu a {
  display: block;
  padding: 12px 0;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.myr-header__mobile-menu a:hover,
.myr-header__mobile-menu a:focus {
  color: #c8102e;
  text-decoration: none;
  background: #fafafa;
}

.myr-header.is-open .myr-header__mobile-menu {
  display: block;
}

.myr-header.is-open .myr-header__mobile-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.myr-header.is-open .myr-header__mobile-toggle span:nth-child(2) {
  opacity: 0;
}

.myr-header.is-open .myr-header__mobile-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* =========================================
   検索フォーム
========================================= */

.myr-header-search {
  display: flex;
  align-items: center;
  height: 40px;
  background: #ffffff;
  border: 1px solid #dddddd;
  overflow: hidden;
}

.myr-header-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: #222222;
}

.myr-header-search__input::placeholder {
  color: #999999;
}

.myr-header-search__button {
  flex: 0 0 auto;
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: #222222;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.myr-header-search__button:hover {
  background: #444444;
}

/* PC検索フォーム：カートにかぶらないよう少し左へ */
.myr-header-search--pc {
  position: absolute;
  top: 50%;
  right: 86px;
  transform: translateY(-50%);
  width: 360px;
}

/* スマホ・タブレット用検索フォームはPCでは非表示 */
.myr-header-search--sp {
  display: none;
}

/* =========================================
   タブレット・スマホ表示
   1024px以下はスマホヘッダー
========================================= */

@media screen and (max-width: 1024px) {
  .myr-header__inner {
    padding: 10px 14px;
  }

  .myr-header__top {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  /* ロゴ中央 */
  .myr-header__logo {
    text-align: center;
    padding: 0;
  }

  .myr-header__logo img {
    width: 150px;
    max-width: 42vw;
    margin: 0 auto;
  }

  /* PC用は非表示 */
  .myr-header__nav,
  .myr-header__icons,
  .myr-header-search--pc {
    display: none;
  }

  /* 左：ハンバーガー */
  .myr-header__mobile-left {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    align-items: center;
  }

  .myr-header__mobile-toggle {
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    width: 28px;
    height: 24px;
    cursor: pointer;
  }

  .myr-header__mobile-toggle span {
    display: block;
    width: 27px;
    height: 2px;
    background: #111;
    margin: 6px 0;
  }

  /* 右：アイコン3つ */
  .myr-header__mobile-right {
    display: flex;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    align-items: center;
    gap: 9px;
  }

  .myr-header__icon {
    width: 23px;
    height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .myr-header__cart-img,
  .myr-header__icon-img {
    display: block;
    width: 22px;
    height: 22px;
  }

  .myr-header__cart-badge {
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
  }

  .myr-header__mobile-menu {
    margin-top: 10px;
  }

  /* スマホ・タブレット：メニュー内検索 */
  .myr-header-search--sp {
    display: flex;
    width: 100%;
    height: 42px;
    margin: 0 0 16px;
  }

  .myr-header-search__input {
    font-size: 14px;
  }

  .myr-header-search__button {
    padding: 0 16px;
    font-size: 13px;
  }
}



/* =========================================================
   Header additions: category dropdown / mobile hierarchy
   - PC: 商品一覧をドロップダウン化
   - SP: 商品一覧をアコーディオン化
   - SP: メニューをページ上に重ねて表示（下のコンテンツを押し下げない）
========================================================= */
.myr-header__menu-item {
  position: relative;
}

.myr-header__submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 50;
  display: none;
  min-width: 220px;
  padding: 10px 0;
  margin: 0;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
  transform: translateX(-50%);
}

.myr-header__menu-item:hover .myr-header__submenu,
.myr-header__menu-item:focus-within .myr-header__submenu {
  display: block;
}

.myr-header__submenu li {
  display: block;
  margin: 0;
  list-style: none;
}

.myr-header__submenu a {
  display: block;
  padding: 12px 18px;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 0;
}

.myr-header__submenu a:hover,
.myr-header__submenu a:focus {
  background: #f7f7f7;
  color: #111;
  border-bottom: 0;
}

.myr-header__mobile-parent-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 14px 0;
  border: none;
  background: none;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.myr-header__mobile-parent-button::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
}

.myr-header__mobile-parent.is-open .myr-header__mobile-parent-button::after {
  content: "−";
}

.myr-header__mobile-submenu {
  display: none;
  margin: 0;
  padding: 0 0 8px;
  background: #f7f7f7;
}

.myr-header__mobile-parent.is-open .myr-header__mobile-submenu {
  display: block;
}

.myr-header__mobile-submenu li {
  list-style: none;
  border-bottom: 0;
}

.myr-header__mobile-submenu a {
  display: block;
  padding: 12px 16px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

@media screen and (max-width: 1024px) {
  .myr-header {
    position: relative !important;
    z-index: 1000 !important;
  }

  .myr-header__mobile-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999 !important;
    display: none !important;
    width: 100% !important;
    margin-top: 0 !important;
    padding: 14px 16px 16px !important;
    background: #fff !important;
    border-top: 1px solid #eee !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .06) !important;
  }

  .myr-header.is-open .myr-header__mobile-menu {
    display: block !important;
  }

  .myr-header__mobile-menu > ul {
    margin: 0 !important;
    padding: 0 !important;
  }

  .myr-header__mobile-menu li {
    list-style: none !important;
    border-bottom: 1px solid #eee !important;
  }

  .myr-header__mobile-menu a,
  .myr-header__mobile-parent-button {
    padding: 14px 0 !important;
    color: #111 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: left !important;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
  }

  .myr-header__mobile-submenu a {
    padding: 12px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }
}

@media screen and (max-width: 767px) {
  .myr-header__cart-img,
  .myr-header__icon-img {
    width: 28px;
    height: auto;
    max-height: 28px;
    object-fit: contain;
  }
}

@media screen and (max-width: 767px) {
  .myr-header__icon--cart {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .myr-header__cart-img {
    width: 28px;
    height: auto;
    max-height: 28px;
    object-fit: contain;
  }

  .myr-header__cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 999px;
  }
}