/* ============================================================
   Shop Web — /search and /saved.
   ============================================================ */

.page--search { padding-bottom: 24px; }

.srch-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4) var(--s-2);
}

.srch-back {
  flex: 0 0 auto;
  color: var(--muted);
  /* The chevron points "back", which in an RTL page is to the right. */
  transform: scaleX(-1);
}

.srch-form { flex: 1 1 auto; min-width: 0; margin: 0; }

/* ---------- tabs ---------- */

.srch-tabs {
  display: flex;
  gap: var(--s-5);
  padding: 0 var(--s-4);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--surface-2);
}

.srch-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) 0;
  margin-bottom: -1px;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: var(--fs-md);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.srch-tab[aria-current="true"] {
  color: var(--text);
  font-weight: var(--fw-bold);
  border-bottom-color: var(--accent);
}

.srch-tab__n {
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 1px 7px;
  font-size: var(--fs-xs);
  direction: ltr;
}

/* ---------- shop results ---------- */

.srch-shops { padding: 0 var(--s-4); }

.srch-shop {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface);
  border-radius: var(--r-card);
  padding: var(--s-3);
  margin-bottom: var(--s-2);
  color: var(--text);
  text-decoration: none;
}

.srch-shop__logo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.srch-shop__logo--text {
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  color: var(--muted);
}

.srch-shop__body { flex: 1 1 auto; min-width: 0; }

.srch-shop__name {
  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srch-shop__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 2px;
}

.srch-shop__go { color: var(--muted); flex: 0 0 auto; }

/* The chips are an escape hatch under an empty state, so they wrap
   rather than scrolling off the edge where nobody would find them. */
.chips--wrap {
  flex-wrap: wrap;
  overflow: visible;
  justify-content: center;
  padding-inline: var(--s-4);
}

/* ---------- /saved ---------- */

.page--saved { padding-bottom: 88px; }

.saved__note {
  background: var(--surface-2);
  border-radius: var(--r-card);
  margin: 0 var(--s-4) var(--s-3);
  padding: var(--s-3) var(--s-4);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.saved__note a { color: var(--accent); }

.saved__browse { display: inline-flex; width: auto; margin-top: var(--s-4); }

/* WebKit paints its own clear button inside type="search"; ours is a
   real link that survives with JavaScript off, so hide the native one
   rather than showing two crosses side by side. */
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* A chevron pointing "onward" is mirrored by the RTL layout, so it is
   flipped back rather than swapped for a different character. */
.srch-shop__go { transform: scaleX(-1); display: inline-block; }

/* Search: two tabs, shared product cards, and compact public-shop results. */
.page--search { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.srch-head { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 12px 16px 0; }
.srch-back { transform: none; background: transparent; color: var(--text); }
.srch-title { font-size: 18px; }
.srch-box { position: relative; grid-column: 1 / -1; min-width: 0; }
.srch-form { background: var(--surface); border: 1px solid #DEDAD2; border-radius: 14px; height: 48px; padding-inline: 4px; }
.srch-form .search__icon, .srch-form .search__clear { display: grid; place-items: center; width: 40px; height: 44px; flex: none; }
.srch-form .search__clear[hidden] { display: none; }
.srch-form .search__input { font-size: 16px; }
.srch-tabs { gap: 0; margin-top: 8px; margin-bottom: 16px; }
.srch-tab { flex: 1; justify-content: center; min-height: 48px; font-family: var(--font-body); font-size: 16px; }
.srch-tab[aria-current="true"] { color: var(--accent); border-bottom-width: 3px; }
.srch-tab__n { background: transparent; padding: 0; font-size: 11px; color: var(--muted); }
.srch-shop { display: grid; grid-template-columns: 50px minmax(0, 1fr) 16px; gap: 6px 10px; border: 1px solid var(--surface-2); border-radius: 15px; margin-bottom: 10px; padding: 12px; }
.srch-shop__logo { width: 50px; height: 50px; align-self: start; }
.srch-shop__body { min-width: 0; }
.srch-shop__name { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
.srch-shop__username { margin: 1px 0 3px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-shop__meta { margin: 2px 0 0; font-size: 11px; }
.srch-shop__summary { margin: 3px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-shop__go { transform: none; color: var(--accent); font-size: 23px; }
.srch-shop__previews { grid-column: 2 / -1; display: flex; gap: 6px; margin-top: 3px; }
.srch-shop__previews img { width: 52px; height: 52px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.srch-suggestions { position: absolute; inset-inline: 0; top: calc(100% + 5px); z-index: 12; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--surface-2); border-radius: 12px; max-height: min(65dvh, 480px); overflow-y: auto; }
.srch-suggestion { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.srch-suggestion:hover, .srch-suggestion:focus-visible { background: var(--surface-2); }
.srch-suggestion img { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex: none; }
.srch-suggestion__body { display: grid; flex: 1; min-width: 0; }
.srch-suggestion__card__title { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-suggestion__card__price { color: var(--accent); font-size: 13px; direction: ltr; text-align: right; }
.srch-suggestion__card__shop-name { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
