/* ロゴ（レスポンシブ対応） */
.custom-logo-link {
    display: block;
    height: 28px;
    width: fit-content;
}

.custom-logo-link img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

@media (min-width: 1280px) {
    .custom-logo-link {
        height: 40px;
    }
}

@media (min-width: 1280px) {
    .custom-logo-link {
        height: 48px;
    }
}

/* ベースのスタイル（モバイル向け） */
.header {
    background: var(--wp--custom--color--gray--50);
    border-bottom: 1px solid #e0e0e0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 52px;
}

.header_wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 12px 20px;
    box-sizing: border-box;
    margin: 0 auto;
}

/* ハンバーガーメニューボタン（モバイル） */
.header_nav_toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.header_nav_toggle::before,
.header_nav_toggle::after {
    content: '';
    position: absolute;
    left: 0;
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    border-radius: 1px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center center;
}

.header_nav_toggle::before {
    top: 8px;
}

.header_nav_toggle::after {
    bottom: 8px;
}

.header_nav_toggle[aria-expanded="true"]::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.header_nav_toggle[aria-expanded="true"]::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* モバイルナビゲーション（全画面） */
.header_nav {
    display: block;
}

.header_nav_inner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    background: var(--wp--custom--color--gray--50);
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 104px 20px 24px;
    box-sizing: border-box;
    transform: translateY(-100%);
    transition: all 0.3s ease;
    overflow-y: auto;
    z-index: 1000;
}

.header_nav_inner[aria-hidden="false"] {
    transform: translateY(0);
}

/* WordPressデフォルトメニューを非表示（モバイル） */
.header_nav_inner > .header_menu {
    display: none;
}

/* 大項目リスト */
.header_menu {
    display: flex;
    flex-direction: column;
}

/* 大項目 */
.header_menu > .menu-item {
    position: relative;
    width: 100%;
    padding: 15px 12px 16px;
    box-sizing: border-box;
    border-bottom: 2px solid var(--wp--custom--color--neutral--100);
    transition: all 0.3s ease;
}

.header_menu > .menu-item > a {
    color: var(--wp--custom--color--neutral--800);
    font-family: "Noto Sans JP";
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    text-decoration: none;
    transition: all .1s ease-in-out;
}

.header_menu > .menu-item > a:hover {
    color: var(--wp--custom--color--blue--400);
}

.header_menu > .menu-item-has-children {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
}

/* 中項目がある場合 */
.header_menu > .menu-item-has-children::before {
    content: "";
    position: absolute;
    top: 25px;
    right: 7px;
    transform: translateX(-50%) translateY(-50%);
    width: 15px;
    height: 2px;
    background-color: var(--wp--custom--color--neutral--500);
    cursor: pointer;
    z-index: 10;
    border-radius: 9999px;
}

.header_menu > .menu-item-has-children::after {
    content: "";
    position: absolute;
    top: 25px;
    right: 21px;
    transform: translateY(-50%);
    width: 2px;
    height: 15px;
    background-color: var(--wp--custom--color--neutral--500);
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
    transform-origin: center;
    border-radius: 9999px;
}

/* ? */
.header_menu > .menu-item-has-children.expanded::after {
    transform: translateY(-50%) rotate(90deg);
}

.header_menu > .menu-item-has-children > .sub-menu {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    box-sizing: border-box;
}

.header_menu > .menu-item-has-children > .sub-menu[aria-expanded="true"] {
    display: flex;
}

.header_menu > .menu-item-has-children > .sub-menu > .menu-item {
    width: 100%;
}

.header_menu > .menu-item-has-children > .sub-menu > .menu-item > a {
    text-align: start;
    width: 100%;
    color: var(--wp--custom--color--neutral--800);
    font-family: "Noto Sans JP";
    font-size: 14px;
    font-weight: 500;
    line-height: var(--2xl, 16px);
    text-decoration: none;
}

/* リンクのクリックエリアを制限 */
.header_menu > .menu-item-has-children > a {
    display: block;
    padding-right: 40px;
    box-sizing: border-box;
}

/* 中項目 */
.header_menu > .menu-item-has-children > .sub-menu[aria-expanded="false"] {
    display: none;
    height: 0;
}

.header_menu > .menu-item-has-children > .sub-menu[aria-expanded="true"] {
    display: flex;
    height: auto;
}

.menu_item,
.accordion_item {
    border-bottom: 1px solid #e0e0e0;
}

.header_menu li a,
.header_menu li button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

/* アコーディオンメニュー */
.accordion_item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion_trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    font-family: inherit;
}

.plus_icon {
    font-size: 24px;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.accordion_item.active .plus_icon {
    transform: rotate(45deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9f9f9;
}

.accordion_item.active .submenu {
    max-height: 500px;
}

.submenu li {
    border-bottom: none;
}

.submenu li a {
    padding: 12px 16px;
    font-size: 14px;
}

/* 外部リンクアイコン */
.external_link_icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 14px;
}

/* 検索コンテナ（モバイル） */
.search_container {
    position: relative;
    margin: 24px 0;
    padding: 0;
}

.header_nav_actions > .search_bar {
    background: var(--wp--custom--color--neutral--100);
}

.search_input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: none;
    border-bottom: 1px solid #333;
    background: transparent;
    font-size: 14px;
    color: #999;
    box-sizing: border-box;
}

.search_input::placeholder {
    color: #999;
}

.search_button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    box-sizing: border-box;
    font-size: 18px;
}

/* お問い合わせボタン（モバイル） */
.header_contact_btn {
    display: block;
    text-align: center;
    background: #4A90E2;
    color: white;
    padding: 16px;
    box-sizing: border-box;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin-top: auto;
    font-size: 16px;
}

/* ヘッダー内ボタンのレスポンシブ設定 */
.header_nav_actions .btn {
    width: 100%;
    /* デフォルト（1280px未満）はフル幅 */
}

/* レスポンシブサイズ：デフォルト（1280px未満）はxs */
.header_nav_actions .btn.btn_responsive {
    padding: 8px 12px;
    font-size: 12px;
}

.header_nav_actions .btn.btn_responsive > .btn_icon svg {
    width: 12px;
    height: 12px;
}

/* レスポンシブサイズ：1280px以上はlg + fit-content幅 */
@media screen and (min-width: 1280px) {
    .header_nav_actions .btn {
        width: fit-content;
        white-space: nowrap;
    }

    .header_nav_actions .btn.btn_responsive {
        padding: 12px 24px;
        font-size: 14px;
    }

    .header_nav_actions .btn.btn_responsive > .btn_icon svg {
        width: 20px;
        height: 20px;
    }
}

/* ナビゲーションアクション（デスクトップのみ表示） */
.header_nav_actions {
    display: block;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* オーバーレイ */
.menu_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.menu_overlay.active {
    display: block;
}

/* タブレット向け（1280px以上） */
@media (min-width: 1280px) {
    .header {
        height: 80px;
    }

    .header_wrap {
        padding: 16px 40px;
        box-sizing: border-box;
        max-width: 100%;
        height: 100%;
    }

    /* ハンバーガーメニューを非表示 */
    .header_nav_toggle {
        display: none;
    }

    /* ナビゲーションを通常表示 */
    .header_nav_inner {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        transform: none;
        flex-direction: row;
        align-items: center;
        gap: 24px;
        overflow: visible;
        margin-left: auto;
    }

    .header_nav_inner[aria-hidden="true"] {
        transform: none;
    }

    /* WordPressメニューを表示 */
    .header_nav_inner > .header_menu {
        display: flex;
        flex-direction: row;
        gap: 24px;
        margin: 0;
        padding: 0;
    }

    .header_menu {
        flex-direction: row;
        gap: 32px;
    }

    .header_menu li {
        border-bottom: none;
    }

    .header_menu li a {
        padding: 8px 0;
        box-sizing: border-box;
        font-size: 14px;
    }

    /* リンクのクリックエリアを制限 */
    .header_menu > .menu-item-has-children > a {
        padding-right: 16px;
    }

    /* ドロップダウンメニュー */
    .header_menu .sub-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        background: var(--wp--custom--color--gray--50);
        border-radius: 20px;
        border: 2px solid var(--wp--custom--color--gray--200);
        background: var(--wp--custom--color--neutral--50);
        min-width: 200px;
        padding: 8px;
        box-sizing: border-box;
        z-index: 100;
    }

    .header_menu > .menu-item-has-children > .sub-menu {
        gap: 0;
        overflow: hidden;
        padding: 12px 0;
    }

    .header_menu .sub-menu li a {
        padding: 12px;
        box-sizing: border-box;
        display: block;
        white-space: nowrap;
    }

    .header_menu .sub-menu li:hover a {
        background: var(--wp--custom--color--gray--100);
    }

    .header_menu > .menu-item > a {
        font-size: 17px;
        white-space: nowrap;
    }

    .header_menu > .menu-item {
        padding: 0;
        border: none;
    }

    .header_menu > .menu-item-has-children::before {
        top: 19px;
        right: -16px;
    }

    .header_menu > .menu-item-has-children::after {
        top: 19px;
        right: -2px;
    }

    /* 検索とお問い合わせ */
    .header_nav_actions {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .header_nav_actions > .search_bar {
        min-width: 240px;   
    }

    .search_container {
        margin: 0;
        position: relative;
    }

    .search_input {
        width: 200px;
        padding: 8px 32px 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }

    .search_button {
        right: 8px;
    }

    .header_contact {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-ContactBtn {
        background: #4A90E2;
        color: white;
        padding: 10px 24px;
        border-radius: 50px;
        text-decoration: none;
        font-size: 14px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    /* モバイル専用要素を非表示 */
    .header_contact_btn,
    .accordion_trigger,
    .plus_icon {
        display: none;
    }
}

/* デスクトップ大（1280px以上） */
@media (min-width: 1280px) {
    .header_wrap {
        box-sizing: border-box;
    }

    .header_nav_inner {
        gap: 40px;
    }

    .header_menu li a {
        font-size: 15px;
    }

    .search_input {
        width: 240px;
    }

    .header-ContactBtn {
        padding: 12px 32px;
        box-sizing: border-box;
        font-size: 15px;
    }
}

/* デスクトップ特大（1512px以上） */
@media (min-width: 1512px) {
    .search_input {
        width: 320px;
    }
}

.header_nav_actions>.btn>.btn_icon {
    display: none;
}

@media screen and (min-width: 1280px) {
    .header_nav_actions > .btn > .btn_text {
        display: none;
    }

    .header_nav_actions > .btn > .btn_icon {
        display: block;
    }

    .header_nav_actions > .btn > .btn_icon > svg {
        fill: var(--wp--custom--color--neutral--50);
    }
}

@media screen and (min-width: 1440px) {
    .header_nav_actions > .btn > .btn_text {
        display: block;
    }
}

/* header_btn */
.header_contact_btn {
    width: 100% !important;
}

@media screen and (min-width: 1280px) {
    .header_contact_btn {
        width: fit-content !important;
    }

    .header_contact_btn > .btn_text {
        display: none !important;
    }
}

@media screen and (min-width: 1440px) {
    .header_contact_btn > .btn_text {
        display: block !important;
    }
}
