/* ===============================
   全体ベース
================================ */


/* ===============================
   ヘッダー
================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 1000;
}

.logo a img {
    display: block;
    height: 40px;
}

/* ===============================
   デスクトップナビ
================================ */
nav.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav.nav a, .dropbtn {
    font-weight: bold;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.dropdown {
    position: relative;
}

/* 子メニュー */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
    z-index: 1100;
}

/* 右端判定して左方向に出す */
.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: #333;
}

.dropdown-content a:hover {
    background: #f0f0f0;
}

/* ===============================
   ハンバーガー
================================ */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    margin-right: 5px;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: #0b0a0a;
    border-radius: 2px;
}

/* ===============================
   モバイルメニュー
================================ */
.mobile-menu {
    position: fixed;
    top: 80px;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - 80px);
    background: #fff;
    padding: 30px 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    box-sizing: border-box;

    overflow-y: auto;                 /* ★追加 */
    -webkit-overflow-scrolling: touch;/* ★iOS対応 */
}


.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0 0 80px; /* ★下スクロール余白 */
}

.mobile-menu ul li {
    margin-bottom: 15px;
}

.sub-menu {
    display: none;
    list-style: none;
    padding-left: 15px;
    margin-top: 10px;
}

.sub-menu li {
    margin-bottom: 10px;
}

/* ===============================
   モバイルオーバーレイ
================================ */
.menu-overlay {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(0,0,0,0.4);
    z-index: 1000;
}

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

/* ===============================
   レスポンシブ
================================ */


/* */


@media (min-width: 1020px) {

div#wrapper{
    width:100%;
    height:auto;
    margin-top:80px;
    padding:0 10px;
    box-sizing: border-box;
}

}




/* ===============================
   PC版（769px以上）
================================ */
@media (min-width: 769px) and (max-width: 1019px) {
    /* ヘッダー全体 */
    header {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* 左寄せはロゴ固定でnavを右寄せ */
        padding: 0 20px;
      
    }

    /* ロゴは左固定 */
    .logo {
        flex-shrink: 0;
    }

div#wrapper{
    width:100%;
    height:auto;
    margin-top:80px;
    padding:0 10px;
    box-sizing: border-box;
}

    /* ナビを右寄せ */
    nav.nav {
        margin-left: auto;   /* ← これが右寄せのキー */
        display: flex;
        margin-right:30px;
        gap: 20px;
        align-items: center;
        flex-wrap: nowrap;   /* 折り返さない */
        background: none;
    }

    nav.nav a,
    .dropbtn {
        font-weight: bold;
        color: #333;
        text-decoration: none;
        white-space: nowrap;
    }

    /* ドロップダウンの子メニューを右端対応 */
    .dropdown-content {
        left: auto;
        right: 0;  /* 右寄せ */
        min-width: 180px;
    }

    /* PCではハンバーガー非表示 */
    .hamburger {
        display: none;
    }

    /* SP用オーバーレイ・メニューも非表示 */
    .mobile-menu,
    .menu-overlay {
        display: none !important;
    }
}


@media (min-width: 381px) and (max-width: 768px) {
    nav.nav { display: none; }
    .hamburger { display: flex; }
 header{
        width:100%;
        height:80px;
        box-sizing: border-box;
        padding-right:3pt;
        box-sizing: border-box;
    }
div#wrapper{
    width:100%;
    height:auto;
    margin-top:80px;
    padding:0 10px;
    box-sizing: border-box;
}

}



	@media(min-width: 351px) and (max-width :380px) {
    
       header{
        width:100%;
        height:80px;
        box-sizing: border-box;
        padding-right:3pt;
        box-sizing: border-box;
    }
div#wrapper{
    width:100%;
    height:auto;
    margin-top:80px;
    padding:0 10px;
    box-sizing: border-box;
}

    }