/* Products Multi-Level Dropdown Menu - Accordion Style */
.products-mega-menu {
    position: relative;
}

/* First Level Dropdown */
.products-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
    margin-top: 10px;
}

.products-mega-menu:hover .products-dropdown {
    opacity: 1;
    visibility: visible;
}

.products-dropdown-inner {
    padding: 12px;
    max-height: 450px;
    overflow-y: auto;
}

/* Category Items - 每个一级目录都有间距 */
.category-item {
    margin-bottom: 26px;
}

.category-item:last-child {
    margin-bottom: 0;
}

/* 一级目录折叠条 - 金黄色渐变背景，白色文字 */
.category-header {
    padding: 0 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #D4AF37 0%, #C9A96E 50%, #B8860B 100%) !important;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3) !important;
    height: 36px !important;
    min-height: 36px !important;
}

.category-header:hover {
    background: linear-gradient(135deg, #E5C158 0%, #D4AF37 50%, #C9A96E 100%) !important;
    box-shadow: 0 3px 12px rgba(184, 134, 11, 0.4) !important;
    transform: translateY(-1px) !important;
}

.category-title {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    flex: 1 !important;
    background: transparent !important;
    line-height: 1 !important;
    display: inline-block !important;
}

/* 箭头图标 */
.category-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 8px !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

.category-toggle::after {
    content: '▼' !important;
    font-size: 11px !important;
    color: #ffffff !important;
    transition: transform 0.3s ease !important;
    text-shadow: none !important;
    display: block !important;
}

/* 当二级菜单打开时，箭头向上 */
.category-item.accordion-open .category-header .category-toggle::after {
    transform: rotate(180deg) !important;
}

/* 没有子分类的链接样式 - 也使用金黄色渐变 */
.category-item > .category-link {
    display: flex !important;
    align-items: center !important;
    padding: 0 16px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #D4AF37 0%, #C9A96E 50%, #B8860B 100%) !important;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3) !important;
    transition: all 0.3s ease !important;
    text-shadow: none !important;
    height: 36px !important;
    min-height: 36px !important;
}

.category-item > .category-link:hover {
    background: linear-gradient(135deg, #E5C158 0%, #D4AF37 50%, #C9A96E 100%) !important;
    box-shadow: 0 3px 12px rgba(184, 134, 11, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Second Level Dropdown - 手风琴式，显示在下方 */
.subcategory-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 0;
}

.subcategory-dropdown.active {
    max-height: 600px;
    margin-top: 8px;
}

.subcategory-dropdown-inner {
    padding: 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 二级目录项 */
.subcategory-item {
    display: block !important;
    padding: 10px 16px 10px 24px !important;
    color: #333333 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #f0f0f0 !important;
    position: relative !important;
}

.subcategory-item:last-child {
    border-bottom: none !important;
}

.subcategory-item::before {
    content: '•' !important;
    position: absolute !important;
    left: 12px !important;
    color: #C9A96E !important;
    font-weight: bold !important;
}

.subcategory-item:hover {
    background-color: #FFF9E6 !important;
    color: #B8860B !important;
    padding-left: 28px !important;
}

/* Loading State */
.products-dropdown.loading .products-dropdown-inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-dropdown.loading .products-dropdown-inner::before {
    content: 'Loading...';
    color: #999;
    font-size: 13px;
}

/* Scrollbar styling */
.products-dropdown-inner::-webkit-scrollbar {
    width: 6px;
}

.products-dropdown-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.products-dropdown-inner::-webkit-scrollbar-thumb {
    background: #C9A96E;
    border-radius: 3px;
}

.products-dropdown-inner::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .products-mega-menu .products-dropdown {
        display: none !important;
    }
}
