/* ==========================================================================
   Live search suggestions — dropdown under the search box (js/suggest.js)
   ========================================================================== */

.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: var(--z-suggest);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 28px 44px -26px rgba(15, 15, 17, 0.5), 0 2px 10px rgba(15, 15, 17, 0.05);
  animation: suggest-in 0.2s var(--ease);
}

@keyframes suggest-in {
  from { opacity: 0; transform: translateY(-6px); }
}

.suggest__list {
  position: relative;                /* rows are measured from here when arrowing through them */
  max-height: 420px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- rows ---------- */
.suggest__item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(15, 15, 17, 0.06);
  transition: background-color var(--t-fast) ease;
}
.suggest__item.is-active { background: #f4f4f6; }

.suggest__thumb {
  position: relative;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(85% 75% at 50% 30%, #fff 0%, var(--tile) 65%, #ebeae7 100%);
}
.suggest__thumb .bottle { --w: 44%; bottom: 8%; }

/* rows are rebuilt on every keystroke, so no fading: photos swap in instantly */
.suggest__thumb .media-img,
.suggest__thumb .bottle,
.suggest__thumb.has-img > .bottle { transition: none; }

.suggest__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.suggest__brand {
  overflow: hidden;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}

.suggest__name {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

/* the part of the label you typed */
.suggest__brand strong,
.suggest__name strong { font-weight: 700; color: var(--ink); }

.suggest__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink);
}
.suggest__old {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: line-through;
}

/* ---------- nothing found ---------- */
.suggest__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 1.35rem 1rem;
  text-align: center;
}
.suggest__empty strong { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.suggest__empty span { font-size: 0.8rem; color: var(--muted); }

/* Arabic wording in the empty state (names and prices stay as they are) */
html[lang="ar"] .suggest__empty strong { font-size: 1rem; }
html[lang="ar"] .suggest__empty span { font-size: 0.86rem; }

/* ---------- phones ---------- */
@media (max-width: 899px) {
  .suggest { border-radius: 18px; }
  .suggest__item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 8px; }
  .suggest__thumb { width: 48px; height: 48px; }
}
