/* 导航栏一行显示覆盖样式 */
.product-nav-wrapper {
    position: sticky;
    top: 56px; /* 根据导航栏高度调整，确保固定在导航栏下方 */
    z-index: 1000;
    background-color: #fff; /* 确保背景色与页面一致 */
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 8px 10px; /* 减小左右内边距，增加导航区域宽度 */
    width: 100%; /* 确保容器占满整个宽度 */
}

.product-nav-wrapper .nav {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: space-between; /* 使用space-between确保导航项均匀分布 */
    width: 100%; /* 确保导航占满整个容器宽度 */
    overflow-x: visible; /* 移除滚动条，确保一行显示 */
    background: var(--light-bg, #f8f9fa);
    border-radius: 40px;
    padding: 5px 2px; /* 最小化左右内边距 */
}

.product-nav-wrapper .nav-item {
    flex: 0 0 auto; /* 使用自动宽度 */
    margin-right: 0; /* 移除右边距 */
    min-width: 0; /* 允许项目在必要时缩小 */
    width: calc(100% / 9 - 1px); /* 精确计算每个导航项宽度，减去1px边距 */
}

.product-nav-wrapper .nav-link {
    padding: 4px 4px; /* 进一步减小内边距 */
    border-radius: 30px;
    font-size: 11px; /* 进一步减小字体大小 */
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center; /* 确保文本居中 */
    display: block; /* 确保链接占满整个区域 */
    width: 100%; /* 确保链接宽度为100% */
    overflow: hidden; /* 防止文本溢出 */
    text-overflow: ellipsis; /* 文本溢出时显示省略号 */
    letter-spacing: -0.3px; /* 减小字母间距 */
}

/* 调整导航栏布局结构 */
.product-nav-search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 8px 15px;
    margin-top: 20px;
}

.search-container {
    position: relative;
}

.search-container .form-control {
    border-radius: 30px;
    padding-right: 50px;
    border: 1px solid #e0e0e0;
    background-color: var(--light-bg, #f8f9fa);
    transition: all 0.3s ease;
}

.search-container .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    border-color: #80bdff;
}

.search-container .search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
}

@media (min-width: 800px) {
    .product-nav-wrapper .nav {
        justify-content: space-between; /* 大屏幕下使用space-between布局 */
        gap: 5px; /* 增加间距 */
    }
    
    .product-nav-wrapper .nav-link {
        padding: 6px 10px; /* 在大屏幕上适当增加内边距 */
        font-size: 14px; /* 适当增加字体大小 */
    }
    
    .product-nav-search-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 35px;
    }
    
    .product-nav-wrapper {
        flex: 1;
        max-width: 75%;
        margin-right: 15px;
        box-shadow: none;
        padding: 0;
    }
    
    .search-container {
        flex: 0 0 auto;
        width: 25%;
        min-width: 200px;
    }
}