/* Е-Пептиды: подсказки поиска (assets/js/ep-search.js). Список выпадает под полем .ep-search;
   в шапке он шире поля и выровнен по его правому краю, в выезжающей панели встаёт в поток. */

.ep-sugg {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70;
  max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 0 8px;
  border: 1px solid var(--ep-line); border-radius: var(--ep-radius);
  background: var(--ep-bg);
  box-shadow: 0 16px 36px -14px oklch(0.21 0.008 250 / .24), 0 2px 6px oklch(0.21 0.008 250 / .06);
  text-align: left;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .16s var(--ep-ease), transform .16s var(--ep-ease);
}
.ep-sugg[hidden] { display: none; }
.ep-sugg.is-open { opacity: 1; transform: none; }
.ep-hdr__search .ep-sugg { left: auto; width: 460px; }

.ep-sugg__h { margin: 0 16px 4px; color: var(--ep-muted); font-size: 13px; line-height: 1.4; }
.ep-sugg__list { margin: 0; padding: 0; list-style: none; }

.ep-sugg__it {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 8px 16px; color: var(--ep-ink); text-decoration: none;
  transition: background-color .12s var(--ep-ease);
}
.ep-sugg__opt[aria-selected="true"] .ep-sugg__it { background: var(--ep-soft); }
.ep-sugg__th {
  display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden;
  border-radius: 2px; background: oklch(0.962 0.005 240);
  outline: 1px solid oklch(0.21 0.008 250 / .06); outline-offset: -1px;
}
.ep-sugg__th img { width: 48px; height: 48px; max-width: none; object-fit: contain; }
.ep-sugg__tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ep-sugg__n { font-size: 16px; line-height: 1.3; }
.ep-sugg__m {
  overflow: hidden; color: var(--ep-muted); font-size: 13px; line-height: 1.4;
  white-space: nowrap; text-overflow: ellipsis;
}
.ep-sugg mark { background: none; color: inherit; font-weight: 700; }
.ep-sugg__c { font-weight: 700; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ep-sugg__c--out { font-weight: 400; font-size: 13px; color: var(--ep-muted); }

.ep-sugg__foot { margin-top: 6px; padding: 4px 16px 0; border-top: 1px solid var(--ep-line); }
.ep-sugg__foot:empty { display: none; }
.ep-sugg__all {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px;
  color: var(--ep-ink); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: color .15s var(--ep-ease);
}
.ep-sugg__arr { color: var(--ep-tg); font-weight: 400; font-size: 18px; transition: transform .2s var(--ep-ease); }

/* Ничего не нашлось */
.ep-sugg.is-empty { padding-top: 14px; }
.ep-sugg.is-empty .ep-sugg__h { color: var(--ep-ink); font-size: 15px; font-weight: 700; }
.ep-sugg.is-empty .ep-sugg__list { display: none; }
.ep-sugg.is-empty .ep-sugg__foot { margin-top: 0; padding: 0 16px 8px; border-top: 0; }
.ep-sugg__note { margin: 0 0 12px; color: var(--ep-ink-2); font-size: 14px; line-height: 1.45; }
.ep-sugg__tg { min-height: 40px; font-size: 15px; }

@media (hover: hover) and (pointer: fine) {
  .ep-sugg__it:hover { background: var(--ep-soft); }
  .ep-sugg__all:hover { color: var(--ep-tg); }
  .ep-sugg__all:hover .ep-sugg__arr { transform: translateX(3px); }
}

/* В выезжающей панели список встаёт в поток под полем: на телефоне он и есть содержимое панели. */
.ep-panel__search .ep-sugg {
  position: static; flex: 0 0 calc(100% + 40px); max-height: none; margin: 8px -20px 0; padding-bottom: 4px;
  border-width: 1px 0; border-radius: 0; box-shadow: none; transform: none;
}
.ep-panel__search .ep-sugg__it, .ep-panel__search .ep-sugg__h, .ep-panel__search .ep-sugg__foot { padding-left: 20px; padding-right: 20px; }
.ep-panel__search .ep-sugg__h { margin-left: 20px; margin-right: 20px; padding: 0; }
.ep-panel__search { flex-wrap: wrap; }

@media (max-width: 600px) {
  .ep-sugg__it { gap: 12px; }
  .ep-sugg__n { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .ep-sugg, .ep-sugg__it, .ep-sugg__arr { transition: none; }
}
