.ombox-search-bar {
    /* 输入框与按钮必须共用同一个高度来源：ombox.css 用 --form-control-height 管 .form-control，
       widget 体系用 --widget-control-min-height 管按钮，各取各的就会一高一低。 */
    --ombox-search-control-height: var(--form-control-height, var(--widget-control-min-height, 38px));

    display: block;
    min-width: 0;
}

.ombox-search-bar .input-group {
    display: flex;
    flex-wrap: nowrap;
    min-width: 180px;
    min-height: var(--ombox-search-control-height);
}

/* ombox.css 的 `.form-control:not(.form-control-color){width:100%}` 与 Bootstrap
   `.input-group > .form-control{width:1%}` 同优先级且加载更晚，会把输入框撑满整行、
   把搜索按钮挤到下一行。这里按 field-input 的同款写法恢复 flex 行为。 */
.ombox-search-bar .input-group > .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    box-sizing: border-box;
    min-height: var(--ombox-search-control-height);
    height: var(--ombox-search-control-height);
}

.ombox-search-bar .btn {
    min-height: var(--ombox-search-control-height);
    height: var(--ombox-search-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: var(--space-4);
    gap: var(--space-1);
    box-sizing: border-box;
}

.ombox-search-bar .input-group > .ombox-search-submit {
    flex: 0 0 auto;
    white-space: nowrap;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.ombox-search-bar .input-group > .ombox-search-submit:has(+ .ombox-search-advanced) {
    /* The shell resets every primary/outline button border with !important. */
    border-right: 1px solid var(--color-border, var(--bs-border-color, #dee2e6)) !important;
}

.ombox-search-bar .ombox-search-submit > .ombox-search-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ombox-search-bar .input-group > .ombox-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--ombox-search-control-height);
    min-height: var(--ombox-search-control-height);
    color: var(--text-muted, #718096);
    text-decoration: none;
    border-left: 0;
    border-radius: 0;
}

.ombox-search-bar .input-group > .ombox-search-clear:hover,
.ombox-search-bar .input-group > .ombox-search-clear:focus-visible {
    color: var(--text-primary, #2d3748);
    background: var(--color-surface-muted, #edf2f7);
}

.ombox-search-bar .input-group > .ombox-search-clear.is-empty {
    opacity: .35;
    pointer-events: none;
}

.ombox-search-bar .input-group > .ombox-search-advanced {
    flex: 0 0 auto;
    white-space: nowrap;
    /* Bootstrap input groups overlap adjacent borders by 1px. Keep this edge
       outside the overlap so Search and Advanced search remain visually distinct. */
    margin-left: 0;
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.ombox-search-bar .input-group > .form-control:focus {
    z-index: 3;
}

.ombox-search-submit.is-icon-only span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ombox-search-bar .btn:focus-visible {
    outline: none;
    border-color: var(--color-primary, #0087f7);
    box-shadow: var(--shadow-focus, none);
}
