/* Apptura Live Search (O-145) — the dropdown under the header search box.
   Theme tokens only (main.css §0); logical properties (RTL and LTR); out of flow (no layout shift). */
.apptura-ls-host { position: relative; }

.apptura-ls {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + var(--sp-2, 0.5rem));
  z-index: var(--z-dropdown, 300);
  max-block-size: 70vh;
  max-block-size: min(34rem, calc(100dvh - var(--sticky-offset, 8rem) - var(--bottom-nav-h, 64px) - var(--sp-4, 1rem)));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block: var(--sp-2, 0.5rem);
  border: 1px solid var(--color-border, #dedad1);
  border-radius: var(--r-md, 12px);
  background: var(--color-surface, #fff);
  box-shadow: var(--shadow-lg, 0 18px 40px -12px rgb(26 25 25 / 0.22));
  color: var(--color-text, #1a1919);
  text-align: start;
  animation: mk-fade-down var(--dur-base, 200ms) var(--ease-out, ease-out);
}
@media (min-width: 1024px) {
  .apptura-ls { max-block-size: min(36rem, calc(100dvh - var(--sticky-offset, 8rem) - var(--sp-6, 1.5rem))); }
}
.apptura-ls[hidden],
.apptura-ls__head[hidden],
.apptura-ls__note[hidden] { display: none; }

/* Loading over results already on screen: a quiet dim, nothing moves */
.apptura-ls.is-loading .apptura-ls__list { opacity: 0.55; transition: opacity var(--dur-fast, 120ms) ease; }

.apptura-ls__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2, 0.5rem);
  padding-inline: var(--sp-4, 1rem) var(--sp-2, 0.5rem);
  font-size: var(--fs-xs, 0.8125rem);
  color: var(--color-text-muted, #5f5c57);
}
.apptura-ls__title { font-weight: var(--fw-ui, 500); }
.apptura-ls__clear {
  min-block-size: var(--tap, 44px);
  padding-inline: var(--sp-2, 0.5rem);
  border: 0;
  border-radius: var(--r-sm, 8px);
  background: transparent;
  color: var(--color-link, #0477a0);
  font: inherit;
  font-weight: var(--fw-ui, 500);
  cursor: pointer;
}
.apptura-ls__clear:hover { color: var(--color-link-hover, #035e7d); text-decoration: underline; }
.apptura-ls__clear:focus-visible { outline: 2px solid var(--color-focus, #0477a0); outline-offset: 2px; }

.apptura-ls__note {
  display: flex;
  align-items: center;
  gap: var(--sp-3, 0.75rem);
  margin: 0;
  padding: var(--sp-3, 0.75rem) var(--sp-4, 1rem);
  font-size: var(--fs-sm, 0.875rem);
  color: var(--color-text-muted, #5f5c57);
}

.apptura-ls__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3, 0.75rem);
  min-block-size: var(--tap, 44px);
  padding: var(--sp-2, 0.5rem) var(--sp-4, 1rem);
  color: var(--color-text, #1a1919);
  text-decoration: none;
  cursor: pointer;
}
.apptura-ls__item:hover,
.apptura-ls__item.is-active { background: var(--color-surface-sunken, #f5f3ee); color: var(--color-text, #1a1919); }
.apptura-ls__item.is-active { box-shadow: inset 3px 0 0 var(--color-primary, #f8b107); }
[dir="rtl"] .apptura-ls__item.is-active { box-shadow: inset -3px 0 0 var(--color-primary, #f8b107); }

.apptura-ls__thumb {
  flex-shrink: 0;
  inline-size: 52px;
  block-size: 52px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle, #ece9e2);
  border-radius: var(--r-sm, 8px);
  background: var(--color-surface, #fff);
}
.apptura-ls__thumb img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }

.apptura-ls__body { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.apptura-ls__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: var(--fs-sm, 0.875rem);
  line-height: var(--lh-snug, 1.6);
}
.apptura-ls__mark { padding: 0; border-radius: 2px; background: var(--yellow-200, #fde8b5); color: inherit; font-weight: var(--fw-ui, 500); }
.apptura-ls__price .c-price__now { font-size: var(--fs-sm, 0.875rem); }
.apptura-ls__price .c-price__old { font-size: var(--fs-xs, 0.8125rem); }

/* «See all» stays in view at the bottom of a scrolled list */
.apptura-ls__all {
  position: sticky;
  inset-block-end: calc(var(--sp-2, 0.5rem) * -1);
  justify-content: space-between;
  margin-block-start: var(--sp-1, 0.25rem);
  background: var(--color-surface, #fff);
  border-block-start: 1px solid var(--color-border-subtle, #ece9e2);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: var(--fw-ui, 500);
  color: var(--color-link, #0477a0);
}
.apptura-ls__all:hover, .apptura-ls__all.is-active { color: var(--color-link-hover, #035e7d); }
.apptura-ls__all .c-icon { inline-size: 1.125rem; block-size: 1.125rem; flex-shrink: 0; }
[dir="ltr"] .apptura-ls__all .c-icon { transform: scaleX(-1); }

.apptura-ls__hist-row { display: flex; align-items: center; }
.apptura-ls__hist { flex: 1; min-inline-size: 0; }
.apptura-ls__hist-icon { display: inline-grid; place-items: center; flex-shrink: 0; color: var(--color-text-subtle, #77736d); }
.apptura-ls__hist-icon .c-icon { inline-size: 1.125rem; block-size: 1.125rem; }
.apptura-ls__hist-text { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm, 0.875rem); }
.apptura-ls__remove {
  display: inline-grid;
  margin-inline-end: var(--sp-2, 0.5rem);
  cursor: pointer;
  place-items: center;
  flex-shrink: 0;
  inline-size: var(--tap, 44px);
  block-size: var(--tap, 44px);
  border-radius: var(--r-sm, 8px);
  color: var(--color-text-subtle, #77736d);
}
.apptura-ls__remove:hover { background: var(--n-100, #ece9e2); color: var(--color-text, #1a1919); }
.apptura-ls__remove .c-icon { inline-size: 1rem; block-size: 1rem; }

.apptura-ls__loader { --loader-size: 0.625rem; }

/* While the panel is open the theme's floating WhatsApp button (z-index 350, above the header's stacking context)
   steps aside, so it never covers «عرض كل النتائج» or takes its taps */
.apptura-ls-open .c-fab { visibility: hidden; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .apptura-ls { animation: none; }
  .apptura-ls.is-loading .apptura-ls__list { transition: none; }
}
