/* ==========================================================================
   Search — persistent box in nav with dropdown results
   ========================================================================== */

.nav-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  list-style: none;
}

.nav-search-icon {
  display: none;
}

.nav-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 10px;
  cursor: text;
  transition: background 0.15s, border-color 0.15s;
}

.nav-search-box:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.nav-search-box.focused {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

.nav-search-icon {
  font-size: 13px;
  opacity: 0.4;
  line-height: 1;
}

.nav-search-input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  width: 120px;
}

.nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.nav-search-kbd {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1px 5px;
  line-height: 1.4;
}

/* Hide kbd when input has focus */
.nav-search-box.focused .nav-search-kbd {
  display: none;
}

/* --- Results dropdown ---------------------------------------------------- */

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 10001;
}

.search-results.open {
  display: block;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: #1a1d3a;
  text-transform: none;
  letter-spacing: 0;
  transition: background 0.1s;
}

.search-result:hover,
.search-result.active {
  background: #f0eff6;
}

.search-result-number {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #2a2f7c;
  min-width: 28px;
}

.search-result-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1a1d3a;
}

.search-result-module {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #666;
}

.search-empty {
  padding: 16px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #999;
}

@media (max-width: 600px) {
  .nav-search-input {
    width: 80px;
  }
  .search-results {
    width: calc(100vw - 16px);
    right: -8px;
  }
}
