/* Navigation Dropdown Menu Styles */
.main-nav {
    position: relative;
}

.nav-item {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: auto;
    right: auto;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 500px;
    overflow: hidden;
    min-width: 200px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    gap: 40px;
}

.dropdown-left {
    flex: 2;
}

.dropdown-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dropdown-category-group {
    margin-bottom: 20px;
}

.dropdown-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-subcategories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-subcategory {
    margin-bottom: 8px;
}

.dropdown-subcategory-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    padding: 6px 0;
    transition: color 0.3s ease;
}

.dropdown-subcategory-link:hover {
    color: #000;
}

.subcategory-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* 统一分类图片尺寸为187x187像素 */
.dropdown-image,
.category-image {
    width: 187px !important;
    height: 187px !important;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-image img,
.category-image img {
    width: 187px !important;
    height: 187px !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dropdown-image:hover img,
.category-image:hover img {
    transform: scale(1.05);
}

.dropdown-image-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
}

/* Navigation hover states */
.nav-menu li {
    position: relative;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #000;
}

.nav-menu li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Loading state */
.dropdown-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.dropdown-loading i {
    margin-right: 8px;
    font-size: 16px;
    animation: spin 1s linear infinite;
}

.dropdown-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #e74c3c;
    font-size: 14px;
}

.dropdown-error i {
    margin-right: 8px;
    font-size: 16px;
}

.dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dropdown-content {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .dropdown-categories {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dropdown-image,
    .category-image {
        width: 150px !important;
        height: 150px !important;
        margin: 0 auto;
    }
    
    .dropdown-image img,
    .category-image img {
        width: 150px !important;
        height: 150px !important;
    }
    
    .dropdown-menu {
        max-height: 400px;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .dropdown-content {
        padding: 15px;
    }
    
    .dropdown-category-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .dropdown-subcategory-link {
        font-size: 13px;
        padding: 4px 0;
    }
    
    .subcategory-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    .dropdown-image,
    .category-image {
        width: 120px !important;
        height: 120px !important;
    }
    
    .dropdown-image img,
    .category-image img {
        width: 120px !important;
        height: 120px !important;
    }
}

/* Animation for category items */
.dropdown-subcategory {
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInLeft 0.3s ease forwards;
}

.dropdown-subcategory:nth-child(1) { animation-delay: 0.1s; }
.dropdown-subcategory:nth-child(2) { animation-delay: 0.15s; }
.dropdown-subcategory:nth-child(3) { animation-delay: 0.2s; }
.dropdown-subcategory:nth-child(4) { animation-delay: 0.25s; }
.dropdown-subcategory:nth-child(5) { animation-delay: 0.3s; }
.dropdown-subcategory:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hover effect for main navigation */
.nav-menu li {
    transition: background-color 0.3s ease;
}

.nav-menu li:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Special styling for featured categories */
.dropdown-subcategory-link.featured {
    font-weight: 500;
    color: #d01345;
}

.dropdown-subcategory-link.featured:hover {
    color: #b01135;
}