/* ==============================================
   Mobile Off-Canvas Right Drawer Navigation
   Bootstrap 독립 — #mobile-nav-drawer 전용
   ============================================== */
@media (max-width: 768px) {

    /* Bootstrap 원본 collapse 숨김 */
    .navbar-main-collapse {
        display: none !important;
    }

    /* ── 오버레이 backdrop ── */
    #mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.45);
        z-index: 99998;
    }
    #mobile-nav-overlay.active {
        display: block;
        animation: navOverlayIn 0.25s ease;
    }
    @keyframes navOverlayIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* ── 드로어 패널 ── */
    #mobile-nav-drawer {
        position: fixed;
        top: 0;
        right: 0;
        width: 270px;
        max-width: 85vw;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #fff;
        z-index: 99999;
        padding: 64px 0 60px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.18);
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #mobile-nav-drawer.open {
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }

    /* ── 닫기(×) 버튼 ── */
    #mobile-nav-drawer .nav-drawer-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 18px;
        color: #555;
        padding: 0;
        line-height: 1;
    }
    #mobile-nav-drawer .nav-drawer-close:hover {
        background: #e8e8e8;
        color: #222;
    }

    /* ── 메뉴 목록 ── */
    #mobile-nav-drawer ul {
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    #mobile-nav-drawer ul > li {
        display: block;
        border-bottom: 1px solid #f2f2f2;
    }
    #mobile-nav-drawer ul > li > a {
        display: block;
        padding: 15px 22px;
        color: #333;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        text-transform: none;
        letter-spacing: 0;
        line-height: 1.4;
    }
    #mobile-nav-drawer ul > li > a:hover {
        background: #f5f8ff;
        color: #3a8afd;
        text-decoration: none;
    }
    #mobile-nav-drawer ul > li.active > a {
        color: #3a8afd;
        background: #f0f5ff;
        border-left: 3px solid #3a8afd;
        padding-left: 19px;
    }

    /* ── 드롭다운 서브메뉴 ── */
    #mobile-nav-drawer .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        min-width: 0;
        background: #fafafa;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 4px 0 8px;
        display: none;
    }
    #mobile-nav-drawer .dropdown.open > .dropdown-menu {
        display: block;
    }
    #mobile-nav-drawer .dropdown-menu > li > a {
        padding: 10px 22px 10px 36px;
        font-size: 13px;
        color: #666;
        font-weight: normal;
        display: block;
        text-decoration: none;
    }
    #mobile-nav-drawer .dropdown-menu > li > a:hover {
        color: #3a8afd;
        background: transparent;
    }
    #mobile-nav-drawer .caret {
        float: right;
        margin-top: 6px;
    }

    /* ── body 스크롤 잠금 ── */
    body.nav-open {
        overflow: hidden;
    }
}
