/* ============================================================
   顶部搜索按钮 + 结果页切换条 + 产品结果卡片
   品牌色：深蓝 #06275b 橙 #ea550a
   ============================================================ */

/* ---------- 头部搜索按钮与下拉 ---------- */
/* 让搜索按钮与导航处于同一行右侧 */
.im-header-search {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 18px;
}

/* 搜索切换按钮：圆形，悬停变品牌橙 */
.im-search-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #d8dbe3;
    background: #ffffff;
    color: #06275b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.im-search-toggle:hover,
.im-search-toggle.active {
    border-color: #ea550a;
    background: #ea550a;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(234, 85, 10, .28);
}

/* 下拉搜索框：默认隐藏，点击按钮展开 */
.im-search-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 320px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e6e9f0;
    box-shadow: 0 18px 40px rgba(6, 39, 91, .16);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    z-index: 999;
}

.im-search-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.im-search-form {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.im-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #d8dbe3;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    background: #fafbfd;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.im-search-input::placeholder {
    color: #a6aab5;
}

.im-search-input:focus {
    outline: none;
    border-color: #ea550a;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(234, 85, 10, .12) inset;
}

.im-search-go {
    width: 46px;
    border: none;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(135deg, #ea550a 0%, #e04300 100%);
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease;
}

.im-search-go:hover {
    background: linear-gradient(135deg, #e04300 0%, #c93c00 100%);
}

/* 锚点：给顶部固定头部留出高度，避免被遮住 */
@media (min-width: 992px){
    .inner_main_nav_area {
        display: inline-flex;
        align-items: center;
    }
}

/* ---------- 搜索结果页：切换条 ---------- */
.im-search-switch {
    display: inline-flex;
    gap: 8px;
    background: #eef1f6;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 22px;
}

.im-search-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #4a5673;
    text-decoration: none;
    transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}

.im-search-tab:hover {
    color: #06275b;
    background: rgba(255,255,255,.6);
}

.im-search-tab.active {
    background: #ffffff;
    color: #ea550a;
    box-shadow: 0 4px 12px rgba(6, 39, 91, .10);
}

.im-search-tab .count {
    background: #ea550a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 8px;
    line-height: 1.5;
}

.im-search-heading {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #06275b;
    margin: 10px 0 6px;
    letter-spacing: .2px;
}

/* ---------- 结果页搜索结果框 ---------- */
/* 与头部下拉搜索框 / 切换条统一风格：圆角、品牌橙渐变按钮 */
.im-search-bar-form .input-group {
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(6, 39, 91, .08);
    border-radius: 10px;
    overflow: hidden;
}

.im-search-bar-form .form-control {
    border: 1px solid #d8dbe3;
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: #fafbfd;
    box-shadow: none;
    padding: 11px 18px;
    font-size: 15px;
    color: #333;
    transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.im-search-bar-form .form-control::placeholder {
    color: #a6aab5;
}

.im-search-bar-form .form-control:focus {
    outline: none;
    border-color: #ea550a;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(234, 85, 10, .12);
}

/* 按钮：品牌橙，与顶部下拉搜索按钮风格一致 */
.im-search-bar-form .btn {
    border: none;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(135deg, #ea550a 0%, #e04300 100%);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 0 26px;
    transition: background .25s ease;
}

.im-search-bar-form .btn:hover {
    background: linear-gradient(135deg, #e04300 0%, #c93c00 100%);
    color: #ffffff;
}

.im-search-bar-form .btn:focus {
    box-shadow: 0 0 0 3px rgba(234, 85, 10, .25);
}

/* 移动端按钮文字紧凑 */
@media (max-width: 575.98px) {
    .im-search-bar-form .btn {
        padding: 0 16px;
        font-size: 14px;
    }
}

/* 商品卡片细节：保持与 products 列表页一致，标题无超长换行挤压 */
.im-search-switch + .row .inner_blog_area,
.im-search-switch + .row .yblog_left_inner {
    height: 100%;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 991.98px) {
    .im-header-search {
        margin-left: 10px;
    }
    .im-search-toggle {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .im-search-dropdown {
        width: 88vw;
        max-width: 340px;
        right: 0;
        position: fixed;
        top: 72px;
        left: 50%;
        transform: translate(-50%, -8px);
    }
    .im-search-dropdown.open {
        transform: translate(-50%, 0);
    }
}

@media (max-width: 575.98px) {
    .im-search-tab {
        padding: 8px 14px;
        font-size: 13px;
    }
}