/* 基础样式 */
.elementor-collapsible-menu {
    width: 100%;
    position: relative;
    --arrow-size: 10px;
    --arrow-container-size: 24px;
}

.ecm-menu-container {
    width: 100%;
    border-radius: 4px;
}

.ecm-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ecm-menu-item {
    position: relative;
    margin: 0;
    padding: 0;
}

/* 菜单链接包装器 */
.ecm-menu-link-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    min-height: 44px;
}

/* 点击模式下的链接包装器样式 */
.ecm-expand-click .ecm-has-children > .ecm-menu-link-wrapper {
    cursor: pointer;
}

.ecm-expand-click .ecm-has-children > .ecm-menu-link-wrapper a {
    pointer-events: none; /* 防止链接点击 */
}

.ecm-expand-click .ecm-has-children > .ecm-menu-link-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

.ecm-menu-item a {
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-decoration: none;
    padding: 12px 15px 12px 15px;
    transition: all 0.3s ease;
    line-height: 1.4;
    color: inherit;
    z-index: 10;
    position: relative;
}

.ecm-menu-item a:hover {
    text-decoration: none;
}

/* 当前菜单项 */
.ecm-menu-item.current-menu-item > .ecm-menu-link-wrapper a {
    font-weight: bold;
    position: relative;
}

.ecm-menu-item.current-menu-item > .ecm-menu-link-wrapper a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: currentColor;
    border-radius: 0 2px 2px 0;
}

/* 当前菜单项的祖先样式 */
.ecm-menu-item.ecm-current-ancestor > .ecm-menu-link-wrapper {
    background-color: rgba(0, 0, 0, 0.03);
}

.ecm-menu-item.ecm-current-ancestor > .ecm-menu-link-wrapper a {
    font-weight: 500;
}

/* 箭头样式 */
.ecm-arrow {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: var(--arrow-container-size);
    height: var(--arrow-container-size);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transform-origin: center;
    transition: transform 0.3s ease;
    opacity: 0.7;
    z-index: 10;
}

.ecm-menu-item:not(.ecm-has-children) .ecm-arrow {
    display: none !important;
}

.ecm-arrow svg {
    width: var(--arrow-size) !important;
    height: var(--arrow-size) !important;
    transition: transform 0.3s ease;
}

/* 箭头旋转效果 */
.ecm-menu-item.ecm-expanded > .ecm-menu-link-wrapper .ecm-arrow {
    transform: translateY(-50%) rotate(90deg) !important;
}

/* 当前菜单项祖先的箭头 */
.ecm-menu-item.ecm-current-ancestor.ecm-expanded > .ecm-menu-link-wrapper .ecm-arrow {
    transform: translateY(-50%) rotate(90deg) !important;
}

/* 子菜单样式 */
.ecm-sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(0, 0, 0, 0.03);
    width: 100%;
}

/* 重要：展开时允许内容显示 */
.ecm-menu-item.ecm-expanded > .ecm-sub-menu {
    max-height: none;
    overflow: visible;
}

/* 当前菜单项祖先的子菜单 */
.ecm-menu-item.ecm-current-ancestor > .ecm-sub-menu {
    max-height: none !important;
}

/* 子菜单内部的子菜单 */
.ecm-sub-menu .ecm-sub-menu {
    max-height: 0;
    overflow: hidden;
}

.ecm-sub-menu .ecm-menu-item.ecm-expanded > .ecm-sub-menu {
    max-height: none;
    overflow: visible;
}

/* 子菜单层级缩进 */
.ecm-sub-menu .ecm-menu-item a {
    padding-left: 30px !important;
}

.ecm-sub-menu-depth-1 .ecm-menu-item a {
    padding-left: 45px !important;
}

.ecm-sub-menu-depth-2 .ecm-menu-item a {
    padding-left: 60px !important;
}

/* 子菜单箭头位置调整 */
.ecm-sub-menu .ecm-arrow {
    right: 5px;
}

/* 箭头类型样式 */
.ecm-arrow.arrow-type-chevron svg path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ecm-arrow.arrow-type-arrow svg path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ecm-arrow.arrow-type-plus svg path {
    stroke-linecap: round;
}

.ecm-arrow.arrow-type-caret svg path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 菜单项分隔线 */
.ecm-menu-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 悬停效果 */
.ecm-menu-link-wrapper:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 点击效果 */
.ecm-menu-link-wrapper:active {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

/* 产品数量样式 */
.ecm-product-count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 5px;
    font-weight: normal;
}

/* 错误消息 */
.ecm-error-message {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    margin: 10px;
    text-align: center;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .ecm-menu-item a {
        padding: 15px;
    }
    
    .ecm-arrow {
        right: 15px;
    }
    
    .ecm-sub-menu .ecm-arrow {
        right: 10px;
    }
    
    /* 移动端子菜单样式 */
    .ecm-sub-menu .ecm-menu-item a {
        padding-left: 35px !important;
    }
    
    .ecm-sub-menu-depth-1 .ecm-menu-item a {
        padding-left: 50px !important;
    }
    
    .ecm-sub-menu-depth-2 .ecm-menu-item a {
        padding-left: 65px !important;
    }
    
    /* 移动端产品数量 */
    .ecm-product-count {
        font-size: 11px;
    }
    
    /* 移动端点击模式 */
    .ecm-expand-click-mobile .ecm-has-children > .ecm-menu-link-wrapper {
        cursor: pointer;
    }
}

/* 点击模式下的链接恢复 */
.ecm-menu-item:not(.ecm-has-children) > .ecm-menu-link-wrapper a {
    pointer-events: auto !important;
}