/* ========== General Header Styles ========== */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background-color: transparent;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.3s ease-in-out;
}

header.scrolled {
    background-color: rgba(245, 245, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========== Navigation Base Styles ========== */
nav {
    display: flex;
    justify-content: space-evenly;
    position: relative;
    width: 100%;
}

nav a {
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    transition: background-color 0.3s ease, border 0.3s ease, color 0.3s ease;
    padding: 10px 15px;
    display: inline-block;
}

/* ========== Products Dropdown Styles ========== */
/* 产品下拉菜单基础样式 */
.products-dropdown {
    position: relative;
    z-index: 1000;
}

/* 下拉内容容器 */
.dropdown-content {
    position: fixed;
    top: 50px;
    left: 0;
    width: 100vw;
    min-height: 300px;
    background-color: #fff;
    display: flex;
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

/* 鼠标悬停时显示下拉内容 */
.products-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
}

/* Left Section */
.dropdown-left {
    width: 250px;
    background-color: #f5f5f7;
    padding: 10px 0;
    border-right: 1px solid #ddd;
}

.dropdown-left ul {
    margin: 0;
    padding: 15px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-left li {
    width: 100%;
    padding: 12px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.dropdown-left li:hover {
    background-color: #eee;
    border-color: #ccc;
}

/* Middle Section */
/* 中间内容区域 */
.dropdown-middle {
    flex: 1;
    padding: 20px;
    background-color: #fff;
    min-width: 600px;
}

/* 子菜单容器 */
#submenu-container {
    display: block; /* 改为默认显示 */
    width: 100%;
}

/* 子菜单组样式 */
.submenu-group {
    display: none; /* 默认隐藏所有子菜单组 */
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 15px;
}

/* 子菜单项样式 */
.submenu-group a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
    color: #333;
    min-height: 60px;
    text-decoration: none;
}

.submenu-group a:hover {
    border-color: #ccc;
    background-color: #f7f7f7;
}

/* Right Preview Section */
.dropdown-right {
    width: 250px;
    background-color: #fbfbfc;
    display: flex;
    justify-content: center;
    align-items: center;
}

#dropdown-preview {
    max-width: 90%;
    max-height: 200px;
    object-fit: contain;
}

/* ========== Logo Menu Styles ========== */
.logo-link {
    display: flex;
    align-items: center;
    padding: 10px;
}

.nav-logo {
    height: 22px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

/* ========== Media Queries ========== */
@media (max-width: 1024px) {
    .submenu-group {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .submenu-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Backdrop Filter Fallback */
@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
    header.scrolled {
        background-color: rgba(245, 245, 247, 0.95);
    }
}