/* Site search bar under the navbar (assets/top_nav.html + assets/js/site_search.js).
   Replaced the AddSearch widget. #nav-search-container's position/width comes from styles.css. */

/* Hidden on the shop page (it has its own search). Beats styles.css's display:block !important. */
#nav-search-container[hidden] { display: none !important; }

.nvk-ss {
  --ss-bg: #0d1113;
  --ss-panel: #12171a;
  --ss-line: rgba(255, 255, 255, .12);
  --ss-text: #eef2f4;
  --ss-muted: #9eabb2;
  --ss-green: #00cc4e;
  --ss-hover: rgba(0, 204, 78, .12);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: "Barlow", Arial, Helvetica, sans-serif;
  color: var(--ss-text);
}
.nvk-ss * { box-sizing: border-box; }
.nvk-ss__icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--ss-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.nvk-ss__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 12px 0 38px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(0, 0, 0, .55);
  color: var(--ss-text);
  font: 500 15px "Barlow", Arial, Helvetica, sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.nvk-ss__input::placeholder { color: #7f8b91; }
.nvk-ss__input:focus { border-color: var(--ss-green); box-shadow: 0 0 0 3px rgba(0, 204, 78, .18); }
.nvk-ss__input::-webkit-search-cancel-button { cursor: pointer; }
.nvk-ss__go {
  flex: none;
  height: 40px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--ss-green);
  color: #04140a;
  font: 700 14px "Barlow", Arial, Helvetica, sans-serif;
  letter-spacing: .3px;
  cursor: pointer;
}
.nvk-ss__go:hover { background: #22e066; }

/* ---------- instant results panel ---------- */
.nvk-ss__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 2500;
  max-height: min(72vh, 620px);
  overflow-y: auto;
  padding: 6px 0;
  background: var(--ss-panel);
  border: 1px solid var(--ss-line);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  text-align: left;
}
.nvk-ss__panel[hidden] { display: none; }
.nvk-ss__sec { padding: 4px 0 6px; }
.nvk-ss__sec + .nvk-ss__sec { border-top: 1px solid var(--ss-line); }
.nvk-ss__h { margin: 0; padding: 8px 14px 4px; font: 700 12px "Barlow", Arial, sans-serif; text-transform: uppercase; letter-spacing: .8px; color: var(--ss-muted); }

.nvk-ss__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  color: var(--ss-text) !important;
  text-decoration: none !important;
  cursor: pointer;
  border: 0;
  background: none;
  line-height: 1.3;
}
.nvk-ss__opt:hover, .nvk-ss__opt.is-active { background: var(--ss-hover); }
.nvk-ss__thumb { flex: none; width: 46px; height: 46px; border-radius: 6px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.nvk-ss__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; margin: 0; border-radius: 0; background: #fff; }
.nvk-ss__thumb img.is-fallback { padding: 22%; opacity: .35; }
.nvk-ss__main { flex: 1; min-width: 0; }
.nvk-ss__title { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvk-ss__meta { display: block; font-size: 12.5px; color: var(--ss-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvk-ss__price { flex: none; text-align: right; font: 700 17px "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .3px; }
.nvk-ss__price small { display: block; font: 600 11.5px "Barlow", Arial, sans-serif; color: #4ee38a; letter-spacing: 0; }
.nvk-ss__price small.is-bo { color: #e9b44c; }
.nvk-ss__tag { flex: none; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--ss-line); font-size: 11.5px; color: var(--ss-muted); white-space: nowrap; }
.nvk-ss mark { background: none; color: var(--ss-green); font-weight: 700; }

.nvk-ss__cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 6px; }
.nvk-ss__cats .nvk-ss__opt { padding: 5px 11px; border: 1px solid rgba(0, 204, 78, .45); border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.nvk-ss__cats .nvk-ss__opt span { color: var(--ss-muted); font-weight: 500; }

.nvk-ss__all {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 8px 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 204, 78, .10);
  color: var(--ss-text) !important;
  font-weight: 700;
  text-decoration: none !important;
}
.nvk-ss__all:hover, .nvk-ss__all.is-active { background: rgba(0, 204, 78, .22); }
/* Broad searches: "N parts match — see all" banner at the top of the dropdown */
.nvk-ss__all--top { margin: 2px 8px 6px; font-weight: 600; border: 1px solid rgba(0, 204, 78, .45); }
.nvk-ss__all--top b { color: var(--ss-green); }
.nvk-ss__all span:last-child { color: var(--ss-green); white-space: nowrap; }
.nvk-ss__empty { padding: 14px; color: var(--ss-muted); font-size: 14px; }
.nvk-ss__empty a { color: var(--ss-green) !important; }

/* ---------- site light mode (localStorage.lightMode / light_style.css) ---------- */
.nvk-ss.is-light {
  --ss-panel: #ffffff;
  --ss-line: rgba(0, 0, 0, .12);
  --ss-text: #12171a;
  --ss-muted: #56636a;
  --ss-green: #00a63f;
  --ss-hover: rgba(0, 166, 63, .10);
}
.nvk-ss.is-light .nvk-ss__input { background: #fff; border-color: rgba(0, 0, 0, .25); color: #12171a; }
.nvk-ss.is-light .nvk-ss__go { color: #fff; }
.nvk-ss.is-light .nvk-ss__panel { box-shadow: 0 18px 40px rgba(0, 0, 0, .18); }
.nvk-ss.is-light .nvk-ss__thumb { border: 1px solid rgba(0, 0, 0, .08); }
.nvk-ss.is-light .nvk-ss__price small { color: #13843f; }
.nvk-ss.is-light .nvk-ss__price small.is-bo { color: #8a5a00; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .nvk-ss__go { padding: 0 12px; }
  .nvk-ss__panel { max-height: 70vh; }
  .nvk-ss__opt { padding: 8px 12px; gap: 10px; }
  .nvk-ss__thumb { width: 40px; height: 40px; }
  .nvk-ss__tag { display: none; }
}
