/* Stock search — one entry point on every Prime surface.
   Namespaced .bbw-search-* / .bbw-sr-* so a page's own styles never collide. */

/* ---- Sidebar trigger ------------------------------------------------ */
sidebar.side .ms-search { padding: 10px 12px 4px; }
sidebar.side .ms-search-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 9px 10px; border: 1px solid var(--bbw-border, #e2e7ee);
    border-radius: 9px; background: #f8fafc; color: var(--bbw-ink-3, #64748b);
    font: 700 12px/1.2 'Plus Jakarta Sans', system-ui, sans-serif;
    text-align: left; cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
sidebar.side .ms-search-btn:hover,
sidebar.side .ms-search-btn:focus-visible {
    border-color: var(--bbw-blue, #1e56e0); background: #fff;
    color: var(--bbw-ink, #0b1526); outline: none;
}
sidebar.side .ms-search-ico { font-size: 13px; line-height: 1; }
sidebar.side .ms-search-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
sidebar.side .ms-search-kbd {
    flex: 0 0 auto; padding: 2px 6px; border: 1px solid #dbe3ee; border-radius: 5px;
    background: #fff; color: #8a97ab; font: 700 9.5px/1.2 'Plus Jakarta Sans', system-ui, sans-serif;
    letter-spacing: .2px;
}

/* ---- Floating trigger (standalone shells without a sidebar) --------- */
.bbw-search-fab {
    position: fixed; right: 22px; bottom: 22px; z-index: 9000;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 16px; border: none; border-radius: 999px;
    background: var(--bbw-ink, #0b1526); color: #fff;
    font: 800 13px/1 'Plus Jakarta Sans', system-ui, sans-serif;
    box-shadow: 0 12px 30px rgba(11, 21, 38, .28); cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}
.bbw-search-fab:hover { background: #132a4d; transform: translateY(-1px); }
.bbw-search-fab:focus-visible { outline: 2px solid var(--bbw-blue, #1e56e0); outline-offset: 2px; }
@media (max-width: 640px) {
    .bbw-search-fab { right: 14px; bottom: 14px; padding: 11px 14px; font-size: 12px; }
}
body.sidebar-open .bbw-search-fab,
body.bbw-search-open .bbw-search-fab { display: none; }
body.bbw-search-open { overflow: hidden; }

/* ---- Dialog ---------------------------------------------------------- */
.bbw-search-overlay {
    position: fixed; inset: 0; z-index: 100200;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 9vh 16px 16px; background: rgba(11, 21, 38, .55);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.bbw-search-overlay[hidden] { display: none !important; }
.bbw-search-panel {
    display: flex; flex-direction: column;
    width: min(680px, 100%); max-height: 82vh; overflow: hidden;
    background: #fff; border: 1px solid rgba(11, 21, 38, .08);
    border-radius: 16px; box-shadow: 0 28px 80px rgba(11, 21, 38, .34);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.bbw-search-head {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 14px 13px 16px; border-bottom: 1px solid #e8edf4;
}
.bbw-search-head .bbw-search-ico { font-size: 16px; line-height: 1; }
.bbw-search-head input {
    flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent;
    color: var(--bbw-ink, #0b1526); font: 600 15px/1.4 'Plus Jakarta Sans', system-ui, sans-serif;
}
.bbw-search-head input::placeholder { color: #94a3b8; font-weight: 500; }
.bbw-search-close {
    flex: 0 0 auto; width: 30px; height: 30px; border: none; border-radius: 8px;
    background: #f2f5f9; color: #64748b; font-size: 18px; line-height: 1; cursor: pointer;
}
.bbw-search-close:hover { background: #e6ecf4; color: var(--bbw-ink, #0b1526); }

.bbw-search-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; }
.bbw-search-hint,
.bbw-search-loading,
.bbw-search-empty { padding: 26px 18px; text-align: center; color: #64748b; font-size: 13px; line-height: 1.55; }
.bbw-search-empty { color: var(--bbw-ink, #0b1526); font-weight: 700; }
.bbw-search-note {
    margin: 6px 8px 10px; padding: 8px 10px; border-radius: 8px;
    background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 12px;
}
.bbw-search-list { display: flex; flex-direction: column; gap: 2px; }
.bbw-search-row {
    display: grid; grid-template-columns: minmax(72px, auto) 1fr auto; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px; border: none; border-radius: 10px;
    background: transparent; text-align: left; cursor: pointer;
}
.bbw-search-row:hover,
.bbw-search-row:focus-visible,
.bbw-search-row.is-active { background: #f1f5fb; outline: none; }
.bbw-sr-sym { font-size: 13px; font-weight: 800; color: var(--bbw-ink, #0b1526); letter-spacing: .2px; }
.bbw-sr-name {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12.5px; font-weight: 500; color: #64748b;
}
.bbw-sr-ex {
    padding: 2px 7px; border-radius: 5px; background: #eef3fa; color: #3b5b8a;
    font-size: 9.5px; font-weight: 800; letter-spacing: .5px;
}
.bbw-search-open { margin-top: 6px; padding: 11px 12px 4px; border-top: 1px solid #eef2f7; }
.bbw-so-label { margin-bottom: 8px; font-size: 10.5px; font-weight: 800; color: #8a97ab; text-transform: uppercase; letter-spacing: .6px; }
.bbw-so-label b { color: var(--bbw-ink, #0b1526); letter-spacing: .2px; }
.bbw-so-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bbw-so-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 11px; border: 1px solid #dbe4f0; border-radius: 999px;
    background: #f8fafc; color: #1e56e0; text-decoration: none;
    font-size: 12px; font-weight: 700; line-height: 1;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.bbw-so-chip:hover { background: #eef4ff; border-color: #b9cdf5; color: #0b1526; }
.bbw-so-chip span[aria-hidden] { font-size: 12px; }
.bbw-search-foot {
    flex: 0 0 auto; padding: 10px 16px; border-top: 1px solid #eef2f7;
    background: #fbfcfe; color: #8a97ab; font-size: 11px; line-height: 1.5;
}
.bbw-search-foot kbd {
    padding: 1px 5px; border: 1px solid #dbe3ee; border-radius: 4px;
    background: #fff; color: #64748b; font: 700 10px/1.4 'Plus Jakarta Sans', system-ui, sans-serif;
}

@media (max-width: 640px) {
    .bbw-search-overlay { padding: 5vh 10px 10px; }
    .bbw-search-panel { max-height: 88vh; border-radius: 14px; }
    .bbw-search-head input { font-size: 16px; }
    .bbw-search-row { grid-template-columns: minmax(64px, auto) 1fr auto; }
}
