/* ============================================================
   Search results page: tabs, sections, no-price box, empty state, wide-window grid.
   Used by renderSearchResults in js/search.js. Prefix: sr-
   Loaded after discover-home.css (it reuses .dc-card and the layout menu) and before mobile-sizing.css.
   ============================================================ */

/* ---------- Page top ---------- */
.result-count.sr-h1 { margin: 0 0 12px; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; scroll-margin-top: calc(var(--topbar-h, 96px) + 8px); }
.sr-h1:focus { outline: none; }
.sr-h2 { margin: 20px 0 8px; font-size: 16px; font-weight: 600; line-height: 1.3; }

/* ---------- Tabs: one scrolling row of chips, in the look of Discover's chips ---------- */
.sr-tabs { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 4px 2px; margin: 0 0 4px; scrollbar-width: none; }
.sr-tabs::-webkit-scrollbar { display: none; }
.sr-tab, .sr-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.sr-tab[aria-pressed="true"] { border-color: var(--brand-text); background: var(--brand-tint); color: var(--brand-text); }
.sr-tab:hover, .sr-chip:hover { border-color: var(--brand-text); }
.sr-tab:focus-visible, .sr-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sr-tab-count { font-weight: 600; color: var(--text-muted); }
.sr-tab[aria-pressed="true"] .sr-tab-count { color: inherit; }
.sr-chip { padding: 0 14px 0 8px; }
.sr-chip .category-icon-box { width: 28px; height: 28px; border-radius: 50%; }
.sr-chip .category-icon-box svg { width: 16px; height: 16px; }
.sr-chip[data-sr-browse=""] { padding-left: 14px; }

/* ---------- Sections ---------- */
.sr-section { min-width: 0; }
.result-row.dc-result-row.sr-sec-head { margin: 20px 0 8px; }
.sr-sec-head .sr-h2 { margin: 0 auto 0 0; }
.sr-brands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sr-brands .btn { min-height: 44px; display: inline-flex; align-items: center; }
.sr-grid > .tier-head, .sr-grid > .band-head, .sr-grid > .show-more { grid-column: 1 / -1; }
.sr-grid > .card-wrap { display: flex; }
.sr-grid > .card-wrap > .card { flex: 1; min-width: 0; }
.sr-grid > .card { min-width: 0; }

/* "See all N products": a full-width text button under the section */
.sr-see-all {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.sr-see-all:hover { border-color: var(--brand-text); }
.sr-see-all:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- No prices yet: one bordered box of slim rows ---------- */
.sr-np { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.sr-np-title { margin: 0; padding: 10px 14px 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.sr-np-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 14px; border-top: 1px solid var(--border); }
.sr-np-row:focus { outline: none; }
.sr-np-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.sr-np-link { flex: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--brand-text); }
.sr-np-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sr-np .show-more { border-width: 1px 0 0; border-radius: 0; min-height: 44px; }
.sr-np .sr-see-all { margin: 0; border-width: 1px 0 0; border-radius: 0; }
.sr-np-side { margin-top: 12px; }

/* ---------- Weaker matches: one closed row at the bottom ---------- */
.sr-weaker-summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; }
.sr-weaker-summary { list-style: none; }
.sr-weaker-summary::-webkit-details-marker { display: none; }
.sr-weaker-summary::after { content: "›"; margin-left: auto; font-size: 18px; color: var(--text-muted); transform: rotate(90deg); }
.sr-weaker[open] > .sr-weaker-summary::after { transform: rotate(-90deg); }
.sr-weaker-summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- Nothing found ---------- */
.sr-empty { padding: 4px 0 8px; }
.sr-empty-text { margin: 0 0 16px; font-size: 14px; color: var(--text-muted); }
.sr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.sr-empty .sr-empty-text + .sr-actions { margin-top: 0; }
.sr-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.sr-browse { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Widths ---------- */
.sr-narrow-hidden { display: none; }
@media (min-width: 860px) {
  .sr-grid.card-list.view-detailed { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: stretch; }
}
@media (min-width: 1100px) {
  .sr-narrow-only { display: none; }
  .sr-narrow-hidden { display: block; }
}
@media (max-width: 1099px) {
  .sr-np-side { display: none; }
}
