/**
 * 搜索页面和导航栏修复样式
 * 专门处理搜索结果与底部导航栏的交互问题
 */

/* 搜索结果容器样式 */
#searchResults {
    margin-bottom: 80px !important;
    padding-bottom: 20px !important;
    z-index: 100 !important;
    position: relative !important;
}

/* 确保搜索结果显示在底部导航栏上方 */
.search-result-item {
    margin-bottom: 15px !important;
    z-index: 200 !important;
    position: relative !important;
}

/* 搜索结果底部间距和导航栏交互 */
.search-page .content,
.page-template-page-search .content,
body.search .content,
.search-results .content {
    padding-bottom: 80px !important;
    margin-bottom: 0 !important;
}

/* 搜索输入框确保不被底部导航栏遮挡 */
.search-form,
.search-box,
.search-container {
    margin-bottom: 80px !important;
    position: relative !important;
    z-index: 300 !important;
}

/* 搜索页特殊导航栏处理 */
.search-page .nav-bar,
.page-template-page-search .nav-bar,
body.search .nav-bar,
.search-results .nav-bar {
    z-index: 999999 !important;
    bottom: 0 !important;
    position: fixed !important;
    display: flex !important;
    width: 100% !important;
    background: #fff !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
}

/* 处理iOS上的特殊情况 */
@supports (-webkit-touch-callout: none) {
    .search-page .nav-bar,
    .page-template-page-search .nav-bar,
    body.search .nav-bar {
        padding-bottom: calc(5px + env(safe-area-inset-bottom)) !important;
        height: calc(60px + env(safe-area-inset-bottom)) !important;
    }
    
    #searchResults,
    .search-form,
    .search-box,
    .search-container {
        margin-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }
    
    .search-page .content,
    .page-template-page-search .content,
    body.search .content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }
}

/* 搜索历史部分样式修复 */
.search-history {
    margin-bottom: 80px !important;
    padding-bottom: 20px !important;
}

/* 防止滚动时底部导航栏闪烁 */
.search-page:before,
.page-template-page-search:before,
body.search:before {
    content: "";
    height: 70px;
    display: block;
    width: 100%;
    position: fixed;
    bottom: -1px;
    left: 0;
    z-index: 999990;
    background: transparent;
    pointer-events: none;
}

/* 强制在搜索页面上显示导航栏 */
body.search .nav-bar,
.search-page .nav-bar,
.page-template-page-search .nav-bar,
.search-results .nav-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 搜索框与导航栏的位置关系 */
.search-input {
    margin-bottom: 20px !important;
    position: relative !important;
    z-index: 400 !important;
}

/* 让搜索结果容器至少有最小高度，避免页面过短 */
.search-results-container {
    min-height: 60vh !important; 
}

/* 确保其他元素不会覆盖底部导航栏 */
body.search *:not(.nav-bar):not(.nav-item):not(.nav-bar *) {
    z-index: auto !important;
}

/* 修复搜索页面底部间距 */
body.search {
    padding-bottom: 60px !important;
} 