/* Guide header search (navigation) */

/* ── Search wrap + scope chips ─────────────────────────────────────── */
.nav-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 0.5rem;
}

/* Scope combo box — [ All  v ] */
.nav-search-scope-select {
  flex-shrink: 0;
  max-width: 9.5rem;
  padding: 0.42rem 1.6rem 0.42rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  background-color: #f9fafb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.nav-search-scope-select:hover {
  border-color: #a78bfa;
  background-color: #fff;
}

.nav-search-scope-select:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
  background-color: #fff;
}

/* Narrowed scope shows the active product in accent color */
.nav-search-scope-select.is-filtered {
  border-color: #a78bfa;
  color: #6d28d9;
  background-color: #f5f3ff;
}

/* Mobile: stack combo box above the search input */
@media (max-width: 767px) {
  .nav-search-wrap {
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    gap: 0.5rem;
  }

  .nav-search-scope-select {
    max-width: none;
    width: 100%;
  }
}

.nav-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 160px;
}

.nav-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  padding: 0.45rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.nav-search-box:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
  background: #fff;
}

.nav-search-icon {
  width: 1rem;
  height: 1rem;
  color: #9ca3af;
  flex-shrink: 0;
}

.nav-search-input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: #1f2937;
}

.nav-search-input::placeholder {
  color: #9ca3af;
}

.nav-search-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  z-index: 60;
  max-height: min(70vh, 420px);
  overflow-y: auto;
}

.nav-search-panel.is-open {
  display: block;
}

.nav-search-meta {
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.nav-search-hit {
  display: block;
  padding: 0.75rem 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
  color: inherit;
}

.nav-search-hit:last-child {
  border-bottom: 0;
}

.nav-search-hit:hover,
.nav-search-hit.is-active {
  background: #f5f3ff;
}

.nav-search-hit-product {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #7c3aed;
  text-transform: none;
  letter-spacing: 0.01em;
  margin-bottom: 0.15rem;
}

.nav-search-hit-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

.nav-search-hit-snippet {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-search-empty {
  padding: 1rem 0.875rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.nav-search-footer {
  display: block;
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7c3aed;
  text-decoration: none;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.nav-search-footer:hover {
  background: #f5f3ff;
}

.nav-search-mobile {
  display: none;
  margin: 0.75rem 0 0.25rem;
}

@media (max-width: 767px) {
  .nav-search-desktop {
    display: none !important;
  }

  .nav-search-mobile {
    display: block;
  }

  .nav-search-mobile .nav-search {
    max-width: none;
    margin: 0;
  }
}

@media (min-width: 768px) {
  .nav-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-bar-row > a:first-child {
    flex-shrink: 0;
  }

  .nav-desktop-menu {
    flex-shrink: 0;
  }
}
