/* ============================================
   移动端菜单样式
   ============================================ */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

/* 汉堡按钮激活状态 */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
    background: var(--danger-color);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
    background: var(--danger-color);
}

/* 移动端导航菜单 */
.nav-menu {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 移动端菜单激活状态 */
.nav-menu.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* 遮罩层 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* 移动端下拉菜单 */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        z-index: 999;
        overflow-y: auto;
        padding: 1rem 0;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    .nav-menu > ul > li {
        width: 100%;
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-menu > ul > li > a {
        padding: 1rem 1.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    /* 下拉菜单样式 */
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: var(--gray-50);
        padding: 0;
    }

    .dropdown-menu.active {
        display: block;
    }

    .dropdown-menu li {
        width: 100%;
    }

    .dropdown-menu a {
        padding: 0.75rem 1.5rem 0.75rem 2.5rem;
        font-size: 0.95rem;
    }

    .dropdown-menu i {
        margin-right: 0.5rem;
    }

    /* 下拉箭头旋转 */
    .dropdown > a i.fa-chevron-down {
        transition: transform 0.3s ease;
    }

    .dropdown.active > a i.fa-chevron-down {
        transform: rotate(180deg);
    }

    /* 菜单项按钮样式 */
    .nav-menu .btn {
        margin: 1rem 1.5rem;
        text-align: center;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-menu a:hover {
        background: transparent;
    }

    .nav-menu a:active {
        background: var(--gray-100);
    }
}
