/* ---------- Header ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 12px;
}

.topbar-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-mark { flex: none; }

.brand-word {
  font-family: "Quicksand", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-text);
  letter-spacing: -0.01em;
}

.brand-dot-i { position: relative; }
.brand-dot-i::after {
  content: "";
  position: absolute;
  top: -0.08em;
  left: 50%;
  width: 0.2em;
  height: 0.2em;
  border-radius: 50%;
  background: var(--logo-dot);
  transform: translateX(-50%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-word { color: var(--text); }
}
:root[data-theme="dark"] .brand-word { color: var(--text); }

/* ---------- Initial loading state (static markup in index.html, shown before any script runs —
   see #initialLoading) ---------- */

.initial-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 72px 16px 32px;
}

.loading-brand-mark { animation: loading-pulse 1.8s ease-in-out infinite; }
.loading-brand-mark-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .loading-brand-mark-light { display: none; }
  .loading-brand-mark-dark { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-brand-mark { animation: none; }
}
@keyframes loading-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1); }
}

.loading-label {
  margin: 0;
  min-width: 5.5em;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.loading-skeleton {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

[hidden] {
  display: none !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The desktop header account slot (index.html: the Settings gear, or Sign in) is hidden below 860px, where the bottom tab bar has Profile and the Profile page has Settings. Scoped to .header-actions so its specificity beats .icon-btn's and .btn's own `display`. */
.header-actions .desktop-icon { display: none; }

/* Tier label on the Profile page header and in the Account section (js/account.js renderProfile()). */
.account-tag { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }

.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-page-header { display: flex; align-items: center; gap: 14px; }

/* Profile page Account section (js/account.js renderProfile()): the only Sign out in the app, so it stays visible at every
   width. Its controls are full-size touch targets (44px). */
.profile-account { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.profile-account .btn { min-height: 44px; }
.profile-account .btn-row { margin-top: 10px; }
/* Sign out sits in its own row, apart from Settings and Help, in a quiet danger style, so it is not hit by accident. */
.profile-account-signout { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.profile-signout-btn { background: none; color: var(--danger-text); border-color: var(--danger-text); }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-btn.active { color: var(--brand-text); border-color: var(--brand-text); }

.notif-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

.searchbar-wrap {
  position: relative;
}

.searchbar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
}

.searchbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Markets / Vendors / Products / Services switch, tucked under the input inside the same box (Discover only) */
.searchbar-modes {
  display: flex;
  gap: 2px;
  padding: 3px 0 5px;
  border-top: 1px solid var(--border);
}

.mode-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.mode-btn svg { flex: none; width: 13px; height: 13px; }
.mode-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mode-btn.active {
  background: var(--brand-tint);
  color: var(--brand-text);
}

@media (max-width: 340px) {
  .mode-btn { font-size: 10.5px; gap: 2px; padding: 6px 0; letter-spacing: -0.1px; }
  .mode-btn svg { width: 11px; height: 11px; }
}

.search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  z-index: 15;
  max-height: 70vh;
  overflow-y: auto;
}

.search-suggestion {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
}

.search-suggestion:first-child { border-top: none; }

.search-suggestion-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.search-suggestion-main:hover, .search-suggestion-main:focus-visible { background: var(--surface-2); }

.search-suggestion-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.search-suggestion-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-catpill {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .search-suggestion-catpill { max-width: 84px; }
}

.search-suggestion-thumb {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-suggestion-thumb svg { width: 16px; height: 16px; }

.search-history-thumb {
  background: var(--surface-2);
  color: var(--text-muted);
}

.search-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 2px;
}

.search-history-clear {
  border: none;
  background: transparent;
  color: var(--brand-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.search-history-remove {
  flex: none;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.search-suggestion-more {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--brand-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.searchbar:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.search-icon {
  flex: none;
  color: var(--text-muted);
}

#searchInput {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 0;
}

#searchInput:focus { outline: none; }

.location-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: var(--brand-tint);
  color: var(--brand-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}


/* Vendor mentions (js/search-mentions.js): the Suggestions column on the results page, and the dropdown's bottom rows. */
.mention-block { display: grid; gap: 10px; }

.mention-heading { margin: 14px 0 0; }

.mention-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 12px 14px;
}

.mention-card:focus { outline: none; }

.mention-tag {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.mention-attr { margin: 0 0 4px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.mention-excerpt { margin: 0 0 8px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }

.mention-excerpt strong { font-weight: 700; color: var(--brand-text); }

.mention-links { margin: 0; font-size: 13px; }

.mention-links a { color: var(--brand-text); }

/* Weaker matches (products matched only through their description), at the bottom of the results page. */
.weaker-block { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 4px; }

.weaker-heading { margin: 14px 0 6px; }

.weaker-row { padding: 10px 0; border-bottom: 1px solid var(--border); }

.weaker-row:focus { outline: none; }

.weaker-name { margin: 0 0 4px; font-size: 14px; font-weight: 600; }

.weaker-name a { color: var(--text); }

/* Phones: the bottom tab says "Report" so it fits on one line; from 860px (top tabs) it reads "Report a price". */
@media (max-width: 859.98px) { .nav-label-more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
