/* Smart Search 2.0 - the dropdown panel and the note on the results page.
 * Colours, radii, gaps and sizes are ocmod-ui variables: the theme adaptation
 * file and the module's own colours set them, nothing here is a fixed colour. */

.ocmod-smart-search {
  position: fixed;
  z-index: 10050;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--ocm-gap) / 2) 0;
  border: 1px solid var(--ocm-line-strong);
  border-radius: var(--ocm-r);
  background: var(--ocm-surface);
  color: var(--ocm-text);
  font-size: var(--ocm-fs, 14px);
  line-height: 1.35;
  text-align: left;
}

.ocmod-smart-search[hidden] { display: none; }

.ocmod-smart-search__group + .ocmod-smart-search__group,
.ocmod-smart-search__foot { margin-top: calc(var(--ocm-gap) / 2); padding-top: calc(var(--ocm-gap) / 2); border-top: 1px solid var(--ocm-line); }

.ocmod-smart-search__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ocm-gap);
  padding: 4px var(--ocm-gap);
  color: var(--ocm-muted);
  font-size: var(--ocm-fs-sm);
}

.ocmod-smart-search__clear {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ocm-link);
  font-size: inherit;
  cursor: pointer;
}

.ocmod-smart-search__clear:hover,
.ocmod-smart-search__clear:focus { text-decoration: underline; }

.ocmod-smart-search__note {
  margin: 0 var(--ocm-gap) calc(var(--ocm-gap) / 2);
  color: var(--ocm-muted);
  font-size: var(--ocm-fs-sm);
}

.ocmod-smart-search__note a { color: var(--ocm-link); font-weight: 600; }

.ocmod-smart-search__row {
  display: flex;
  align-items: center;
  gap: var(--ocm-gap);
  padding: 6px var(--ocm-gap);
  color: var(--ocm-text);
  text-decoration: none;
  cursor: pointer;
}

.ocmod-smart-search__row:hover,
.ocmod-smart-search__row.is-active { background: var(--ocm-subtle); color: var(--ocm-ink); text-decoration: none; }

.ocmod-smart-search__row > .ocm-icon { flex: none; width: 18px; height: 18px; color: var(--ocm-muted); }

.ocmod-smart-search__thumb { flex: none; line-height: 0; }

.ocmod-smart-search__thumb img {
  max-width: none;
  height: auto;
  border: 1px solid var(--ocm-line);
  border-radius: var(--ocm-r-sm);
  background: var(--ocm-surface);
  object-fit: contain;
}

.ocmod-smart-search__main { flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }

.ocmod-smart-search__main:hover,
.ocmod-smart-search__main:focus { color: inherit; text-decoration: none; }

.ocmod-smart-search__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ocm-ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.ocmod-smart-search__sub { display: block; margin-top: 2px; color: var(--ocm-muted); font-size: var(--ocm-fs-sm); }

.ocmod-smart-search__gap { display: inline-block; width: 8px; }

.ocmod-smart-search mark {
  padding: 0;
  border-radius: 2px;
  background: var(--ocm-accent-tint);
  color: inherit;
  font-weight: 600;
}

.ocmod-smart-search .ocm-price { flex: none; flex-direction: column; align-items: flex-end; gap: 0; text-align: right; }

.ocmod-smart-search__buy { flex: none; }

.ocmod-smart-search__buy .ocm-icon { width: 18px; height: 18px; }

.ocmod-smart-search__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px var(--ocm-gap) 6px; }

.ocmod-smart-search__chips .ocm-btn.is-active,
.ocmod-smart-search__foot .ocm-btn.is-active { outline: 2px solid var(--ocm-accent-dark); outline-offset: 1px; }

.ocmod-smart-search__foot { padding-right: var(--ocm-gap); padding-left: var(--ocm-gap); }

.ocmod-smart-search__foot .ocm-icon { width: 18px; height: 18px; }

.ocmod-smart-search .ocm-empty { padding: var(--ocm-gap); }

/* results page: the note under the theme's h1 */
.ocmod-smart-search-note { margin: 0 0 var(--ocm-gap); }

@media (max-width: 575px) {
  .ocmod-smart-search__row { gap: 8px; }
  .ocmod-smart-search__sub { display: none; }
}
