/* Matches the top spacing used by the PLP (.plp) and PDP (.pdp) pages —
   keep these three in sync if either changes. */
.search-page.section {
  /* 20px more than the shared PLP/PDP top spacing, for this page only. */
  padding-top: calc(var(--space-8) + 20px);
  padding-bottom: var(--space-8);
}

.search-page__hero {
  text-align: center;
  max-width: 64ch;
  margin: 0 auto var(--space-8);
}

/* Centers the row even when there are fewer than 4 featured products,
   instead of grid--4's equal-width columns leaving empty trailing space. */
.search-page__featured-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: center;
}

.search-page__intro {
  margin-top: var(--space-3);
}

.search-page__form-wrap {
  display: flex;
  justify-content: center;
}

.search-page__form {
  display: flex;
  gap: var(--space-3);
  max-width: 560px;
  width: 100%;
  margin: 0 auto var(--space-6);
}

.search-page__input-wrap {
  position: relative;
  flex: 1;
  /* Same overflow bug as the checkout/PDP flex rows: without this, the
     input's default min-width (its content/placeholder width) refuses to
     shrink next to the Search button on narrow screens. */
  min-width: 0;
}

.search-page__input {
  width: 100%;
}

.search-page__form .btn {
  flex-shrink: 0;
}

.search-page__count {
  text-align: center;
  margin-bottom: var(--space-6);
}

.search-page__popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-8);
}

.search-page__popular-label {
  margin-right: var(--space-1);
}

.search-page__chip {
  padding: var(--space-1) var(--space-3);
  border: var(--border-default);
  border-radius: var(--radius-lg);
  font-size: var(--text-small);
  color: var(--color-ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-page__chip:hover {
  border-color: var(--color-rust);
  background: var(--color-sand);
}

.search-page__seo {
  display: flex;
  justify-content: center;
  margin: var(--space-16) 0 0;
}

.search-page__seo p {
  max-width: 72ch;
  text-align: center;
}

.search-page__seo a {
  color: var(--color-rust);
  font-weight: 600;
}

/* Matches the same 2-up mobile density as the PLP's product grid (see
   .plp-layout .grid--3 in plp.css) — one giant card per screen makes for a
   lot of scrolling on a phone. Only the "results for a query" grid — the
   "While You Search" featured grid already uses its own auto-fit columns. */
@media (max-width: 640px) {
  .search-page .grid--3 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4) var(--space-3);
  }
}

@media (max-width: 380px) {
  .search-page .grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Autosuggest dropdown */
.search-suggest {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  max-height: 360px;
  overflow-y: auto;
}

.search-suggest__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-default);
}

.search-suggest__row:last-child {
  border-bottom: none;
}

.search-suggest__row:hover,
.search-suggest__row--active {
  background: var(--color-sand);
}

.search-suggest__thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-sand);
}

.search-suggest__thumb--placeholder {
  display: block;
}

.search-suggest__title {
  flex: 1;
  font-size: var(--text-small);
  color: var(--color-ink);
}

.search-suggest__price {
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  white-space: nowrap;
}
