/* ============================================================
   メガメニュー（assets/inc/header.php の #main-menu）
   common.css はビルド生成物のため汚さず、本ファイルで上書き管理。
   header-b.php で common.css の後に読み込む。
   ============================================================ */

#slide-line {
    display: none;
}

/* ボタン共通リセット */
#main-nav .mega-toggle {
    background: transparent;
    border: none;
    font: inherit;
    cursor: pointer;
}

.mega-caret {
    font-size: 11px;
    margin-left: 6px;
    color: #1382C0;
    transition: transform .2s ease;
}

.has-mega.open .mega-caret {
    transform: rotate(180deg);
}

/* =================== デスクトップ（≥1200px） =================== */
@media (min-width: 1200px) {
    /* メガパネルの位置基準。ただし固定時(.fixed-top=position:fixed)は上書きしない
       ＝ id指定のrelativeが .fixed-top のfixedを潰してスクロール固定が壊れるのを防ぐ */
    #wrapper-navbar:not(.fixed-top) {
        position: relative;
    }

    #main-nav .drawer-nav {
        position: static;
    }

    #main-nav .drawer-nav .nav-item.has-mega {
        position: static;
    }

    #main-nav .mega-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .has-mega.open .mega-toggle,
    .has-mega.current .mega-toggle {
        color: #1382C0;
    }

    .mega-panel {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #ececec;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .07);
        display: none;
        z-index: 1000;
    }

    .has-mega.open .mega-panel {
        display: block;
    }

    .mega-inner {
        max-width: 1140px;
        margin: 0 auto;
        padding: 32px 24px;
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 40px;
        align-items: start;
    }

    .mega-intro {
        border-right: 1px solid #ececec;
        padding-right: 32px;
    }

    .mega-en {
        font-size: 22px;
        font-weight: 500;
        color: #1382C0;
        letter-spacing: .04em;
        line-height: 1.2;
    }

    .mega-jp {
        font-size: 13px;
        color: #777;
        margin: 2px 0 12px;
    }

    .mega-desc {
        font-size: 13.5px;
        line-height: 1.8;
        color: #555;
        margin: 0 0 18px;
    }

    .mega-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #1382C0;
        color: #fff !important;
        text-decoration: none;
        padding: 11px 14px;
        border-radius: 6px;
        font-size: 14px;
    }

    .mega-cta:hover {
        opacity: .9;
    }

    .mega-cta-note {
        display: block;
        text-align: center;
        font-size: 12px;
        color: #999;
        margin-top: 7px;
    }

    .mega-groups {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 22px 32px;
    }

    .mega-group-head {
        font-size: 13px;
        font-weight: 500;
        color: #888;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }

    .mega-group ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* 既存 .drawer-menu li { display:inline-block } の継承を打ち消して縦並びに */
    #main-nav .mega-group li {
        display: block;
        margin: 0 0 11px;
    }

    .mega-group li a {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 3px 10px;
        text-decoration: none;
        color: #0a0a0a !important;
        font-size: 14px;
        line-height: 1.5;
    }

    .mega-group li a::before {
        content: "";
        width: 11px;
        height: 1px;
        background: #1382C0;
        flex: none;
    }

    .mega-item-title {
        flex: 0 0 auto;
    }

    .mega-item-desc {
        flex: 1 1 auto;
        min-width: 0;
        color: #999;
        font-size: 12px;
    }

    .mega-group li a:hover {
        color: #1382C0 !important;
    }
}

/* =================== モバイル（≤1199px：ドロワー内アコーディオン） =================== */
@media (max-width: 1199px) {
    #main-nav .has-mega .mega-toggle {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 1em;
        text-align: left;
        color: #0a0a0a;
        border-bottom: #cccccc solid 2px;
    }

    /* 既存 .nav-link::after による二重矢印を抑止 */
    #main-nav .has-mega .mega-toggle::after {
        content: none !important;
    }

    .has-mega.open .mega-toggle {
        color: #1382C0;
        font-weight: bold;
    }

    .mega-panel {
        display: none;
    }

    .has-mega.open .mega-panel {
        display: block;
    }

    .mega-intro {
        display: none;
    }

    .mega-inner {
        display: block;
        padding: 0;
    }

    .mega-group-head {
        background: #f4f4f4;
        color: #555;
        font-size: 13px;
        font-weight: 500;
        padding: 0.5em 1em;
    }

    .mega-group ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mega-group li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5em 1em 0.5em 1.5em;
        text-decoration: none;
        color: #0a0a0a;
        border-bottom: #cccccc solid 1px;
    }

    .mega-group li a::after {
        font-family: "Font Awesome 5 Free";
        content: "\f105";
        font-weight: 900;
        color: #1382C0;
    }

    /* モバイルは説明文を隠してコンパクトに */
    .mega-item-desc {
        display: none;
    }
}
