/* Universal search — /search/
   One box over market rates, listings, /stock/, products, blogs, the animal
   catalogue, Q&A, community posts and the calculators.

   Every colour is a theme token (see pages/css/theme.css + palette.css) so the
   page follows the palette picker and both light and dark. No hardcoded hex. */

.us-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}

/* ---------- The box itself ---------- */

.us-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  margin-bottom: 18px;
}

.us-hero h1 {
  font-size: 1.35rem;
  margin: 0 0 4px;
  color: var(--ink);
  font-weight: 800;
}

.us-hero p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.5;
}

.us-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.us-input-shell {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.us-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px 13px 42px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}

.us-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14);
}

.us-input-shell > .us-input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: .95rem;
}

/* Typeahead list, shared behaviour with the home hero's (base.html wires both
   from the same code). Absolute inside .us-input-shell, which is already
   position:relative for the icon. */
.us-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: none;
  overflow: hidden;
  text-align: start;
  background: var(--card, var(--bg));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
}

.us-drop.is-open { display: block; }

.us-drop a {
  display: block;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.us-drop a:last-child { border-bottom: none; }

.us-drop a:hover,
.us-drop a.is-active { background: rgba(var(--primary-rgb), .08); }

.us-drop b { display: block; color: var(--ink); font-size: .88rem; font-weight: 700; }
.us-drop small { display: block; color: var(--muted); font-size: .77rem; margin-top: 2px; }

.us-drop .mp-search-all {
  text-align: center;
  font-size: .81rem;
  font-weight: 700;
  color: var(--primary-strong);
  background: rgba(var(--primary-rgb), .1);
}

.us-submit {
  padding: 13px 26px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

.us-submit:hover { background: var(--primary-strong); }

/* ---------- Tabs ---------- */

.us-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.us-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.us-tab:hover { color: var(--ink); border-color: var(--primary); }

.us-tab.is-on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
}

/* ---------- Notices ---------- */

.us-meta {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 14px;
}

.us-meta strong { color: var(--ink); }

.us-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 18px;
  font-size: .87rem;
  color: var(--ink);
  line-height: 1.45;
}

.us-notice i { color: var(--warn-strong); margin-top: 2px; }

/* ---------- Result groups ---------- */

.us-group { margin-bottom: 26px; }

.us-group-hd {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.us-group-hd h2 {
  font-size: 1rem;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.us-group-hd span { color: var(--muted); font-size: .82rem; }

.us-list {
  display: grid;
  gap: 10px;
}

.us-hit {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  text-decoration: none;
  color: inherit;
}

.us-hit:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.us-hit-emoji {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.us-hit-body { flex: 1 1 auto; min-width: 0; }

.us-hit-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-size: .97rem;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.us-hit-sub {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.us-hit-side {
  flex: 0 0 auto;
  text-align: right;
  display: grid;
  gap: 4px;
  justify-items: end;
}

.us-price {
  font-weight: 800;
  color: var(--ok-strong);
  font-size: .95rem;
  white-space: nowrap;
}

.us-tag {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  white-space: nowrap;
}

.us-tag-else {
  background: var(--warn-soft);
  color: var(--ink);
}

/* ---------- Empty state ---------- */

.us-empty {
  text-align: center;
  padding: 34px 18px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 16px;
  margin-bottom: 22px;
}

.us-empty-icon { font-size: 2.4rem; margin-bottom: 8px; }

.us-empty h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--ink);
}

.us-empty p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

/* ---------- Popular / browse-everything block ---------- */

.us-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.us-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: .85rem;
  text-decoration: none;
}

.us-chip:hover { border-color: var(--primary); background: var(--primary-soft); }

/* The browseable hierarchy, spelled out. This is the half of the page that is
   allowed to rank, and it is here on every search — hit or miss — because a
   searcher who found nothing still wants the door to the section they wanted. */
.us-doors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.us-door {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}

.us-door:hover { border-color: var(--primary); background: var(--primary-soft); }

.us-door-icon { font-size: 1.5rem; }

.us-door b { display: block; color: var(--ink); font-size: .93rem; }

.us-door span { color: var(--muted); font-size: .8rem; }

@media (max-width: 620px) {
  .us-hero { padding: 18px 15px; border-radius: 15px; }
  .us-hero h1 { font-size: 1.15rem; }
  .us-hit { padding: 11px 12px; gap: 10px; }
  .us-hit-emoji { flex-basis: 34px; height: 34px; font-size: 1rem; }
  .us-hit-side { display: none; }
}

/* The navbar's own search box and typeahead dropdown are NOT here — they appear
   on every page, and this file only loads on /search/. They live in
   marketplace/css/marketplace.css, next to the rest of the navbar. */
