/* ヘッダーコンポーネント用CSS */

/* ========================================
   ヘッダー全体の構造
   ======================================== */
.header-container {
    position: relative;
    background: #fff;

    /* ナビゲーションバー */
    .nav-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 4px rgba(152, 152, 152, 0.461);

        /* ナビゲーションラッパー */
        .nav-wrapper {
            max-width: 1500px;
            margin: 0 auto;
            padding: 0 10px;

            /* ナビゲーションコンテンツ */
            .nav-content {
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 80px;

                /* ロゴセクション */
                .logo-section {
                    flex-shrink: 0;

                    .logo-link {
                        display: block;
                        text-decoration: none;

                        .logo-image {
                            height: 40px;
                            width: auto;
                        }
                    }
                }

                /* メニューセクション */
                .menu-section {
                    flex: 1;
                    display: flex;
                    justify-content: end;
                    align-items: center;
                    padding: 0 10px;

                    /* PC用メニュー */
                    .pc-menu {
                        display: flex;
                        flex-wrap: wrap;
                        list-style: none;
                        margin: 0;
                        padding: 0;
                        gap: 3px 0;
                        align-items: center;

                        .pc-menu-item {
                            position: relative;

                            &.active {
                                .pc-menu-link {
                                    font-weight: 600;
                                    position: relative;
                                    border-bottom: 3px solid #111;
                                }
                            }

                            .pc-menu-link {
                                display: block;
                                padding: 5px 20px;
                                color: #333;
                                text-decoration: none;
                                font-weight: 500;
                                white-space: nowrap;
                                transition: color 0.2s ease;

                                &:hover {
                                    color: #ddd;
                                    background-color: #333;
                                }

                            }
                        }

                        &::before {
                            display: none;
                        }

                    }

                    /* ハンバーガーメニューボタン */
                    .hamburger-btn {
                        display: none;
                        background: none;
                        border: none;
                        cursor: pointer;
                        padding: 10px;
                        position: relative;

                        .hamburger-icon {
                            width: 25px;
                            height: 20px;
                            position: relative;

                            &::before,
                            &::after,
                            span {
                                content: '';
                                position: absolute;
                                width: 100%;
                                height: 2px;
                                background: #333;
                                transition: all 0.3s ease;
                            }

                            &::before {
                                top: 0;
                            }

                            &::after {
                                bottom: 0;
                            }

                            span {
                                top: 50%;
                                transform: translateY(-50%);
                            }
                        }
                    }
                }
            }
        }
    }

    /* オフキャンバスメニュー */
    .offcanvas-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;

        &.show {
            opacity: 1;
            visibility: visible;
        }
    }

    .offcanvas-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;

        &.open {
            right: 0;
        }

        /* オフキャンバスヘッダー */
        .offcanvas-header {
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;

            .logo-link {
                .offcanvas-logo {
                    height: 40px;
                    width: auto;
                }
            }
        }

        /* オフキャンバスメニューリスト */
        .offcanvas-menu-list {
            list-style: none;
            margin: 0;
            padding: 20px 0;

            .offcanvas-menu-item {
                border-bottom: 1px solid #f0f0f0;

                &.active {
                    background-color: #eaeaea;
                    border-left: 5px solid #111;

                    .offcanvas-menu-link {
                        font-weight: 600;
                    }
                }

                .offcanvas-menu-link {
                    display: block;
                    padding: 15px 20px;
                    color: #333;
                    text-decoration: none;
                    font-weight: 500;
                    transition: background-color 0.3s ease;

                    &:hover {
                        background-color: #dcdcdc;
                    }

                    &.active {
                        font-weight: 600;
                    }
                }
            }
        }
    }
}

/* 固定ヘッダー分の余白をメインに付与 */
.main-content {
    padding-top: 80px;

    @media (max-width: 1000px) {
        padding-top: 60px;
    }
}

/* ========================================
レスポンシブ対応
======================================== */
@media (max-width: 1000px) {
    .header-container {
        .nav-bar {
            .nav-wrapper {
                .nav-content {
                    height: 60px;

                    .logo-section {
                        .logo-link {
                            .logo-image {
                                height: 40px;
                            }
                        }
                    }

                    .menu-section {
                        justify-content: flex-end;

                        .pc-menu {
                            display: none;
                        }

                        .hamburger-btn {
                            display: block;
                        }
                    }
                }
            }
        }
    }
}

@media (min-width: 1001px) {
    .header-container {
        .offcanvas-menu,
        .offcanvas-overlay {
            display: none;
        }
    }
}