/*
 * ANAP Holdings モバイルメニュースタイル
 * ハンバーガーメニューの実装
 */

/* ========================================
   モバイルメニューオーバーレイ
   ======================================== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   モバイルメニューコンテナ
   ======================================== */
.mobile-menu-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 375px;
    height: 100%;
    background-color: #F5F5F5;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu-container {
    transform: translateX(0);
}

/* ========================================
   モバイルメニューヘッダー
   ======================================== */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E0E0E0;
    position: relative;
}

.mobile-logo {
    display: block;
    max-width: 120px;
}

.mobile-logo img {
    width: 100%;
    height: auto;
}

.mobile-menu-close {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #131313;
}

.mobile-menu-close:hover {
    opacity: 0.7;
}

.mobile-lang-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #131313;
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.mobile-lang-btn:hover {
    opacity: 0.8;
}

/* ========================================
   モバイルメニューナビゲーション
   ======================================== */
.mobile-menu-nav {
    flex: 1;
    padding: 20px 0;
}

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

.mobile-menu-item {
    border-bottom: 1px solid #E0E0E0;
}

.mobile-menu-item > a,
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #131313;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-menu-item > a:hover,
.mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* サブメニュー矢印アイコン */
.submenu-arrow {
    transition: transform 0.3s ease;
}

.mobile-menu-item.active .submenu-arrow {
    transform: rotate(180deg);
}

/* サブメニュー */
.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.03);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu-item.active .mobile-submenu {
    max-height: 500px;
}

.mobile-submenu li {
    border-bottom: 1px solid #E0E0E0;
}

.mobile-submenu li:last-child {
    border-bottom: none;
}

.mobile-submenu a {
    display: block;
    padding: 12px 20px 12px 40px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #131313;
    text-decoration: none;
    transition: background-color 0.2s;
}

.mobile-submenu a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ========================================
   モバイルメニューフッター
   ======================================== */
.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid #E0E0E0;
    background-color: #FFFFFF;
}

.mobile-menu-footer a {
    display: block;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #131313;
    text-decoration: none;
    padding: 8px 0;
}

.mobile-menu-footer a:hover {
    opacity: 0.7;
}

/* ========================================
   ハンバーガーメニューボタン（既存のheaderに存在）
   ======================================== */
.menuBar {
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.menuBar span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #131313;
    transition: all 0.3s ease;
}

/* ハンバーガーメニューアクティブ時のアニメーション */
.menuBar.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

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

.menuBar.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   レスポンシブ表示
   ======================================== */
@media (max-width: 768px) {
    .menuBar {
        display: flex;
    }

    /* デスクトップメニューを非表示 */
    .nav_wrap {
        display: none;
    }
}

/* 小型スマートフォン */
@media (max-width: 375px) {
    .mobile-menu-container {
        width: 90%;
    }

    .mobile-menu-item > a,
    .mobile-menu-toggle {
        font-size: 15px;
        padding: 14px 18px;
    }

    .mobile-submenu a {
        font-size: 13px;
        padding: 10px 18px 10px 36px;
    }
}

/* デスクトップでモバイルメニューを完全に非表示 */
@media (min-width: 769px) {
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* ========================================
   ボディスクロール制御
   ======================================== */
body.mobile-menu-open {
    overflow: hidden;
}
