/* 小悬浮窗搜索框样式 */

/* 搜索图标样式 */
.wf_navbar-search-item {
    display: inline-block;
    margin: 0;
    position: relative;
}

.wf_navbar-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    color: var(--wf-heading-color);
    font-size: 1.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wf_navbar-search-icon:hover {
    color: var(--wf-main-color);
}

/* 搜索弹出层 - 透明遮罩（仅用于点击关闭） */
.wf_search-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: none;
    background: transparent;
}

.wf_search-popup-overlay.active {
    display: block;
}

/* 搜索悬浮框容器 - 小窗口样式 */
.wf_search-popup-container {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 220px;
    max-width: calc(100vw - 40px);
    background: #fff;
    padding: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 9999;
}

.wf_search-popup-overlay.show .wf_search-popup-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 关闭按钮 */
.wf_search-popup-close {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.wf_search-popup-close:hover {
    color: #333;
}

/* 搜索框内容区域 */
.wf_search-popup-content {
    width: 100%;
    padding-right: 30px;
}

.wf_search-popup-content .header-search-form {
    width: 100%;
    /* 覆盖主题 themes.css 里对 header-search-form 的布局（70%/30% float） */
    display: block !important;
    padding-right: 0 !important;
    background-color: transparent !important;
}

.wf_search-popup-content .header-search-form form {
    display: block !important;
}

.wf_search-popup-content .search-wrapper {
    position: relative;
    width: 100% !important;
    float: none !important;
}

/* 隐藏分类选择器 */
.wf_search-popup-content .header-search-select-wrapper {
    display: none !important;
}

/* 搜索输入框 - 极简风格（强制覆盖主题默认 70% 宽度/float） */
.wf_search-popup-content .header-search-form input.header-search-input {
    width: 100% !important;
    display: block !important;
    float: none !important;
    height: 42px;
    padding: 0 36px 0 12px !important; /* 右侧给搜索按钮预留 */
    border: 1px solid #ddd;
    border-radius: 4px !important;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    line-height: 42px;
}

.wf_search-popup-content .header-search-input:focus {
    outline: none;
    background: #fff;
    border-color: #999;
}

.wf_search-popup-content .header-search-input::placeholder {
    color: #aaa;
}

/* 搜索按钮 - 贴在输入框内侧右边（不占布局空间） */
.wf_search-popup-content .header-search-form .header-search-button {
    position: absolute;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px;
    height: 28px;
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    text-decoration: none !important;
    box-shadow: none !important;
}

.wf_search-popup-content .header-search-button:hover,
.wf_search-popup-content .header-search-button:focus,
.wf_search-popup-content .header-search-button:active,
.wf_search-popup-content .header-search-button:visited {
    color: #000;
    background: transparent !important;
    text-decoration: none !important;
    border: none !important;
    border-bottom: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.wf_search-popup-content .header-search-button i,
.wf_search-popup-content .header-search-button .fa {
    text-decoration: none !important;
    border: none !important;
}

/* 搜索结果区域 */
.wf_search-popup-content .search-results {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

/* 隐藏原搜索框中的 SVG 图标 */
.wf_search-popup-content .search-wrapper svg {
    display: none;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .wf_search-popup-container {
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        padding: 12px;
    }

    .wf_search-popup-close {
        right: 8px;
        top: 8px;
    }

    .wf_search-popup-content {
        padding-right: 28px;
    }

    .wf_search-popup-content .header-search-input {
        height: 40px;
        font-size: 14px;
        padding: 0 36px 0 12px;
    }

    .wf_search-popup-content .header-search-button {
        right: 2px;
        top: 0;
        width: 34px;
        height: 40px;
        font-size: 15px;
        background: transparent !important;
        text-decoration: none !important;
    }
    
    .wf_search-popup-content .header-search-button:hover,
    .wf_search-popup-content .header-search-button:focus {
        text-decoration: none !important;
    }
}

/* 移动端搜索图标 */
@media (max-width: 991px) {
    .wf_mobilenav-right .wf_navbar-search-item {
        display: inline-block;
    }
}

/* 强制去掉搜索框内所有下划线和边框 */
.wf_search-popup-content a,
.wf_search-popup-content button,
.wf_search-popup-content .header-search-button {
    text-decoration: none !important;
    border-bottom: none !important;
}

.wf_search-popup-content a:hover,
.wf_search-popup-content a:focus,
.wf_search-popup-content button:hover,
.wf_search-popup-content button:focus {
    text-decoration: none !important;
    border-bottom: none !important;
}

