/* ==========================================================================
   Explore (home feed), Category browse, Search
   ========================================================================== */

.explore-top {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  padding: var(--s-3) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--border);
}

.explore-brandbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-h);
  padding-inline: var(--s-4) var(--s-2);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.explore-brandbar .brand-mini {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 900;
  font-size: var(--fs-lg);
  flex: 1;
}

.explore-brandbar .brand-mini .mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.explore-brandbar + .explore-top {
  top: var(--header-h);
}

.loc-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  height: 34px;
  padding-inline: var(--s-3);
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--s-3);
}

.loc-pill .pin { color: var(--gold-2); display: flex; }

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: 46px;
  padding-inline: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  color: var(--text-faint);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast);
}

.search-bar:focus-within {
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px var(--gold-softer);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  background: none;
  color: var(--text);
}

/* The container owns the focus treatment. Prevent the global keyboard-focus
   outline from drawing a second gold frame around the input itself. */
.search-bar input:focus,
.search-bar input:focus-visible {
  outline: none;
  outline-offset: 0;
}

.search-bar input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

.search-bar input[type="search"]::-webkit-search-decoration,
.search-bar input[type="search"]::-webkit-search-cancel-button {
  display: none;
  appearance: none;
  -webkit-appearance: none;
}

.search-bar input::placeholder { color: var(--text-faint); }
.search-bar .s-ico { flex: none; display: flex; }
.search-bar .mic { color: var(--gold-2); }

/* ---- Category tiles ---- */
/* Trimmed so two rows of listings clear the fold on a phone — these tiles are
   a shortcut, not the point of the screen. */
.cat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
}

.cat-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: var(--s-3);
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: start;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}

.cat-tile .ct-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The artwork keeps its subject on one side and empty shadow on the other;
   this darkens the side the label sits on so the text always has contrast. */
.cat-tile .ct-scrim {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(
    to left,
    rgba(13, 13, 15, 0.92) 0%,
    rgba(13, 13, 15, 0.6) 42%,
    rgba(13, 13, 15, 0.12) 78%
  );
}

/* English flips the label to the left, so mirror the art to keep the subject
   clear of it and send the scrim the other way. */
:root[dir="ltr"] .cat-tile .ct-art { transform: scaleX(-1); }
:root[dir="ltr"] .cat-tile .ct-scrim {
  background: linear-gradient(
    to right,
    rgba(13, 13, 15, 0.92) 0%,
    rgba(13, 13, 15, 0.6) 42%,
    rgba(13, 13, 15, 0.12) 78%
  );
}

.cat-tile:active {
  transform: scale(0.975);
  border-color: var(--gold-1);
}

.cat-tile .ct-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-tile .ct-name {
  font-size: var(--fs-lg);
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}

.cat-tile .ct-count {
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
}

/* ---- Sort row ---- */
.sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-4) var(--s-2);
}

.sort-row .sr-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  height: 34px;
  padding-inline: var(--s-3);
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--gold-2);
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* ---- Category browse header ---- */
.cat-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-2);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 38px;
  padding-inline: var(--s-3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  flex: none;
}

.filter-btn.has-filters {
  border-color: var(--gold-1);
  color: var(--gold-2);
  background: var(--gold-softer);
}

.result-count {
  padding: var(--s-3) var(--s-4) 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---- Filter sheet ---- */
.filter-block + .filter-block {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}

.filter-block-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: var(--s-3);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.range-inputs .input-wrap { flex: 1; }
.range-inputs .input { height: 44px; font-size: var(--fs-sm); }
.range-inputs .dash { color: var(--text-faint); flex: none; }

/* ---- Search page ---- */
.search-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.search-head .search-bar { flex: 1; }

.recent-search-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3) var(--s-4);
  text-align: start;
  color: var(--text-2);
}

.recent-search-row:active { background: var(--surface); }
