.header {
    position: fixed;
    top: 2.125vw; /* サイドマージンと同じ値 */
    left: 0;
    right: 0;
    margin: auto;
    z-index: 9999;
    width: 95.75%; /* 左右マージン: 2.125vw ずつ */
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.25);
}

/* 下層ページ用 */
.page-header {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);

    .submenu {
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px 15px 40px;
}

.header-logo {
  flex-shrink: 0;
  width: 168px;
}

.logo-desktop {
  height: auto;
}

.logo-tablet {
  display: none;
}

.header-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 1072px;
}

.header-nav {
    width: 706px;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu.nav-desktop {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.nav-item {
    position: relative;
}

.nav-item a {
  color: #050505;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-item.has-submenu::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 65px; /* サブメニューとの距離と同じ高さ（固定値） */
    background: transparent;
}

@media (hover: hover) {
  .nav-item a:hover {
    color: #BA2A20;
    opacity: 1;
  }

  /* ホバー時：上から下へふわっと */
  .nav-item:hover .submenu {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
  }
}

/* サブメニュー */
.submenu {
    position: absolute;
    top: 65px;
    width: 174px;
    left: 0;
    background: #fff;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    border-radius: 16px;
    padding: 30px 20px;

    /* 最初は隠す */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px); 
    transition: all 0.3s ease;
}

/* サブメニュー */
.submenu-products {
    /* 最初は隠す */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.submenu li {
    &:nth-child(n+2) {
        margin-top: 20px;
    }
}

.submenu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #050505;
    text-decoration: none;
}

.submenu li a::after {
    content: "";
    width: 8px;   /* ???????? */
    height: 16px;
    background: url(../../images/header-arrow.svg) no-repeat center center;
    background-size: contain;
    font-size: 13px;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-evidence {
    display: block;
    border: solid 1px #BA2A20;
    border-radius: 29px;
    text-align: center;
    padding: 15px 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-evidence-img {
    display: block;
    max-width: 117px;
    height: auto;
}

.header-store {
    display: flex;
    justify-content: center;
    align-items: center;
    border: solid 1px #BA2A20;
    background: #BA2A20;
    border-radius: 29px;
    padding: 15px 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-store-txt {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFF;
    font-size: 13px;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.header-store-txt::before {
    content: "";
    width: 18px;
    height: 16px;
    background: url(../../images/header-store-icon.png) no-repeat center center;
    background-size: contain;
}


/* PCサイズではモバイル用ロゴ・×ボタンを非表示 */
.mobile-menu-logo,
.hamburger-menu-logo,
.close-menu {
    display: none;
}

.nav-menu.nav-mobile {
    display: none;
}

.header-nav-drawer {
    display: none;
}

.header-sp-box {
  display: none;
}

.menu-overlay {
    display: none;
}


/* ============================
   中間ブレークポイント (1200px〜1380px)
   デスクトップナビを縮小して表示
============================ */
@media screen and (min-width: 1201px) and (max-width: 1380px) {
    .header-container {
        padding: 10px 10px 10px 24px;
    }

    .header-logo {
        width: 130px;
    }

    .header-nav-container {
        width: auto;
        gap: 16px;
    }

    .header-nav {
        width: auto;
    }

    .nav-menu.nav-desktop {
        gap: 12px;
    }

    .nav-item a {
        font-size: 11px;
        white-space: nowrap;
    }

    .header-evidence {
        padding: 10px 12px;
    }

    .header-evidence-img {
        max-width: 85px;
    }

    .header-store {
        padding: 10px 12px;
    }

    .header-store-txt {
        font-size: 11px;
        gap: 5px;
    }

    .header-store-txt::before {
        width: 14px;
        height: 12px;
    }

    .header-right {
        gap: 6px;
    }
}

/* ============================
   SP (1200px以下)
============================ */
@media screen and (max-width: 1200px) {
    .header {
        top: 4%;
    }

    .header-container {
        display: flex;
        align-items: center;
        padding: 12px 12px 12px 40px;
    }

    .header-logo {
        width: 204px;
    }

    .logo-desktop {
        display: none;
    }

    .logo-tablet {
        display: block;
    }

    .header-nav-container {
        display: none;
    }

    .header-sp-box {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 166px;
        gap: 6px;
    }

    .header-store-sp {
        width: 80px;
        height: 46px;
        border-radius: 50px;
        background: #BA2A20;
        border: solid 1px #BA2A20;
    }

    .header-store-sp-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .header-store-sp-icon {
        display: block;
        background: #BA2A20 url(../../images/cart.svg) no-repeat center center;
        background-size: 24px 24px;
        width: 24px;
        height: 24px;
    }

    .hamburger-menu {
        display: block;
        position: relative;
        cursor: pointer;
        z-index: 1001;
        width: 80px;
        height: 46px;
        border-radius: 50px;
        padding: 0;
        background: none;
        border: solid 1px #BA2A20;
    }

    .hamburger-menu span {
        display: block;
        position: absolute;
        width: 30px;
        height: 2px;
        left: 0;
        right: 0;
        margin: auto;
        background-color: #BA2A20;
        transition: all 0.4s;
    }

    .hamburger-menu span:nth-child(1) {
        top: 30%;
    }

    .hamburger-menu span:nth-child(2) {
        top: 50%;
    }

    .hamburger-menu span:nth-child(3) {
        bottom: 25%;
    }

    /* ハンバーガーアニメ */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(8px) rotate(-45deg);
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-11px) rotate(45deg);
    }

    /* ▼ メニュー本体：初期状態（非表示） */
    .header-nav-drawer{
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: #FFF;
        margin: 0;
        /* ↓↓↓ ここを 950px → 375px に変更 */
        max-width: 375px;
        padding: 65px 45px 60px 45px;
        box-sizing: border-box;
        border-radius: 27px 0 0 0;
        z-index: 99999;

        transform: translateX(100%);
        transition: transform 0.4s ease;
        will-change: transform;
        /* ↓ overflow もこちらに移動（レイアウトジャンプ防止） */
        overflow-y: auto;
    }

    /* ▼ 表示時：右→左へスライドイン */
    .header-nav-drawer.active{
        transform: translateX(0);
        /* ← ここにあった max-width:375px; は削除してOK（上で固定化） */
    }


    header.fixed .header-nav-drawer {
        top: 0px;
        padding-top: 24px;
    }

    .nav-menu.nav-desktop {
        display: none;
    }
    .nav-menu.nav-mobile {
        display: flex;
        flex-direction: column;
        margin: 33px 0 0 0;
    }

    .nav-item {
        width: 100%;

        &:nth-child(n+2) {
            margin-top: 22px;
        }
    }

    .nav-item a {
        display: block;
        text-decoration: none;
        color: #050505;
        font-size: 18px;
        letter-spacing: 0.05em;
        text-align: left;
    }

    /* スマホ用サブメニュー */
    .sp-submenu {
        display: none;
        position: static;
        background: #fff;
        list-style: none;
        margin: 0;
    }

    .sp-submenu li a {
        display: block;
        padding: 16px 0 0 0;
        color: #858585;
        text-decoration: none;
        font-size: 14px;
    }

    /* 親メニュー（SP専用） */
    .nav-item.has-sp-submenu > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* アイコン */
    .sp-submenu-toggle-icon {
        width: 16px;
        height: 16px;
        margin-left: 8px;
        cursor: pointer;
    }

    /* オーバーレイ */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0; /* オーバーレイは画面全体を覆う */
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 999;
    }

    .menu-overlay.active {
        display: block;
    }

    .hamburger-menu-logo {
        display: block;
        width: 196px;

        a {
            display: block;
            width: 100%;
        }
    }

    /* 閉じるボタン(X) */
    .close-menu {
        display: block;
        position: absolute;
        top: 9%;
        right: 20px;
        width: 64px;
        height: 38px;
        background: none;
        cursor: pointer;
        z-index: 1010;
        border: 1px solid #BA2A20;
        border-radius: 50px;
    }
    .close-menu::before,
    .close-menu::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        margin: auto;
        width: 29px;
        height: 2px;
        background: #BA2A20;
        transform: translateY(-50%) rotate(30deg);
        transition: transform 0.3s ease;
    }
    .close-menu::after {
        transform: translateY(-50%) rotate(-30deg);
    }

    /* モバイル用ロゴ */
    .mobile-menu-logo {
        position: absolute;
        top: 20px;
        left: 20px;
        width: 120px;
    }

    .mobile-menu-logo img {
        width: 100%;
        height: auto;
    }
    
    .header {
        /* スライドアニメーション用 */
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .header.fixed {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        /* 薄い白背景サンプル */
        background-color: rgba(255, 255, 255, 0.8);
        top: -26px !important;
        padding-top: 46px;
        padding-bottom: 15px;
    }

    .header.show {
        transform: translateY(0);
        opacity: 1;
    }

    .header.hide {
        transform: translateY(-100%);
        opacity: 0;
    }

    .contact-item {
        width: 290px;
        margin: 20px 0 0 0;
    }

    .contact-item.contact-item1 {
        margin-top: 43px;
    }

    .menu-category-link {
        display: block;
        width: 100%;
    }

    /* SPドロワー内バナー画像の表示高さを固定（evidence以外） */
    .contact-item:not(.contact-item-evidence) img {
        width: 100%;
        height: 128px;
        object-fit: cover;
    }

    /* モバイルメニュー用 header-evidence */
    .contact-item-evidence {
        width: 290px;
        margin: 20px 0 0 0;
    }

    .header-evidence-sp {
        display: flex;
        justify-content: center;
        align-items: center;
        border: solid 1px #BA2A20;
        border-radius: 29px;
        padding: 12px 20px;
        position: relative;
    }

    .header-evidence-sp::after {
        content: "";
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 25.648px;
        height: 25.648px;
        background: url(../../images/Group%20282.svg) no-repeat center center;
        background-size: contain;
    }

    .header-evidence-img-sp {
        display: block;
        width: 100%;
        max-width: 134px;
        height: auto;
        margin-left: -16px;
    }

}

@media screen and (max-width: 768px) {
    .page-header {
        box-shadow: 0 0px 8px rgba(0, 0, 0, 0.08);
    }

    .header-logo {
        width: clamp(8.125rem, 5.739rem + 10.18vw, 10.625rem);
        /* 375px: 130px, 768px: 170px */
    }

    .header-sp-box {
        width: clamp(7.25rem, 4.269rem + 12.72vw, 10.375rem);
        /* 375px: 116px, 768px: 166px */
    }

    .header-store-sp,
    .hamburger-menu {
        width: clamp(3.438rem, 1.947rem + 6.36vw, 5rem);
        /* 375px: 55px, 768px: 80px */
        height: clamp(2.125rem, 1.41rem + 3.05vw, 2.875rem);
        /* 375px: 34px, 768px: 46px */
    }

    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(11px) rotate(-45deg);
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-11px) rotate(45deg);
    }
}

@media screen and (max-width: 500px) {
    .header-container {
        padding: 12px 12px 12px 20px;
    }

    .header-logo {
        width: 150px;
    }

    .header-store-sp-icon {
        background: #BA2A20 url(../../images/cart.svg) no-repeat center center;
        background-size: 24px 24px;
        width: 24px;
        height: 24px;
    }
}

@media screen and (max-width: 1024px) {
    .header {
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .header.header-hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@media screen and (max-width: 390px) {
    .header {
        width: 92.31%;
        top: 3%;
    }

    .header-container {
        padding: 8px 8px 8px 20px;
    }

    .header-store-sp-icon {
        display: block;
        background: #BA2A20 url(../../images/cart.svg) no-repeat center center;
        background-size: 24px 24px;
        width: 24px;
        height: 24px;
    }

    .header-nav-drawer.active {
        max-width: 375px;
    }

    .nav-item a {
        display: block;
        text-decoration: none;
        color: #050505;
        font-size: 18px;
        letter-spacing: 0.05em;
        text-align: left;
    }
}


