﻿/* ******************** */
/* サイドバー バージョン切替（V1・V2 共通） */
/* ******************** */
.sidebar-version-switch {
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    /* border-top: solid 1px #234376; */
    border-top: solid 1px #98cfff;
    font-size: 0.8rem;
    color: #fff;
}

.sidebar-version-switch-item {
    color: #cfe6ff;
    text-decoration: underline;
}

    .sidebar-version-switch-item:hover {
        color: #fff;
    }

    .sidebar-version-switch-item.current {
        color: #fff;
        font-weight: bold;
        text-decoration: none;
        pointer-events: none;
    }

/* V1・V2: 切替はスクロール領域の外に置き、常に最下部に表示する */
.sidebar-version-switch {
    flex: 0 0 auto;
    background-color: var(--primary);
}

/* V1: ラッパー（メニュー本体 + 切替を縦に並べる） */
.sidebar-wrap {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: calc(100vh - 3.3rem - 2rem);
    min-height: 0;
    overflow: hidden;
}

    /* 高さはラッパーが持つため、メニュー本体は残りを使う（sidebar.css の高さ指定を上書き） */
    .sidebar-wrap > #SidebarMenu.ver-1 {
        /* flex-basis を 0 にして、展開による内容の高さに引きずられず、残りの高さに収める */
        flex: 1 1 0;
        min-height: 0;
        max-height: 100%;
        height: auto !important;
    }

/* ハンバーガー時（site.css と同じ幅）: V1 本体が全幅オーバーレイになるため、従来どおりの挙動に戻す */
@media (max-width: 575.20px) {
    .sidebar-wrap {
        display: contents;
    }

        .sidebar-wrap > #SidebarMenu.ver-1 {
            height: calc(100vh - 3.3rem - 2rem) !important;
        }

        .sidebar-wrap > .sidebar-version-switch {
            display: none;
        }
}

/* ******************** */
/* サイドバー V2（クリックで子メニューを右側に表示） */
/* ******************** */
#SidebarMenu.ver-2 {
    direction: rtl;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 12rem;
    height: calc(100vh - 3.3rem - 2rem) !important;
    z-index: 10001;
}

    /* 親メニュー一覧（縦スクロール） */
    #SidebarMenu.ver-2 .sv2-scroll {
        flex: 1 1 auto;
        overflow-y: auto;
    }

    #SidebarMenu.ver-2 .sv2-scroll li {
       direction: ltr;
    }

    #SidebarMenu.ver-2 a.text-light:hover {
        color: white !important;
    }

    #SidebarMenu.ver-2 #CustomerQuickSearch {
        border-bottom: solid 1px #234376;
        padding-bottom: 0.25rem;
    }

    #SidebarMenu.ver-2 .sv2-top > li {
        border-top: #98cfff solid 1px;
    }
    #SidebarMenu.ver-2 .sv2-top,
    #SidebarMenu.ver-2 .sv2-list{
        padding: 0;
    }

        #SidebarMenu.ver-2 .sv2-top > li:not(:first-child) {
            border-bottom: solid 1px #234376;
        }

        #SidebarMenu.ver-2 .sv2-top > li.active,
        #SidebarMenu.ver-2 .sv2-top > li.sv2-open {
            background-color: var(--secondary);
        }

        #SidebarMenu.ver-2 .sv2-top > li:hover {
            background-color: var(--secondary);
        }

        #SidebarMenu.ver-2 .sv2-top > li.sv2-divider {
            height: 0.5rem;
            border-top: none;
        }

    #SidebarMenu.ver-2 .nav-link {
        width: 100%;
        text-align: left;
    }

    /* 子を持つ親メニュー（右向き矢印付き） */
    #SidebarMenu.ver-2 .sv2-parent {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    #SidebarMenu.ver-2 .sv2-chevron {
        font-size: 0.75rem;
    }

    /* 子メニュー表示領域 */
    #SidebarMenu.ver-2 .sv2-flyouts {
        position: absolute;
        top: 0;
        left: 100%;
        height: 100%;
    }

    #SidebarMenu.ver-2 .sv2-panel {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        min-width: 13rem;
        max-width: max-content;
        height: 100%;
        overflow-y: auto;
        background-color: var(--primary);
        border-left: solid 1px #234376;
        box-shadow: 4px 0 8px rgba(0, 0, 0, 0.3);
        padding-bottom: 1rem;
    }

        #SidebarMenu.ver-2 .sv2-panel.show {
            display: block;
        }

    #SidebarMenu.ver-2 .sv2-panel-title {
        padding: 0.5rem 1rem;
        color: #fff;
        font-weight: bold;
        font-size: 1.5rem;
        /* border-bottom: #98cfff solid 1px; */
        background-color: var(--secondary);
    }

    #SidebarMenu.ver-2 .sv2-list > li:hover > a {
        background-color: var(--secondary);
    }

    /* 入れ子グループ */
    #SidebarMenu.ver-2 .sv2-group-title {
        padding: 0.5rem 1rem 0.25rem 1rem;
        color: #cfe6ff;
        font-size: 1.2rem;
        border-top: solid 2px #cfe6ff;
        border-bottom: solid 2px #234376;
    }

    #SidebarMenu.ver-2 .sv2-group > .sv2-list {
        padding-left: 1rem;
    }

    #SidebarMenu.ver-2 .sv2-divider {
        border-top: solid 1px #234376;
        margin: 0.25rem 0;
    }

    /* 現在表示中の画面 */
    #SidebarMenu.ver-2 li.menu-displayed > a {
        background-color: var(--light) !important;
        color: var(--primary) !important;
    }
