/* ==========================================================================
   Live search (shared) - same feel as the navbar search.
   Status line + compact result cards under any search field. Token-driven.
   ========================================================================== */

.livesearch-results {
  display: none;
  margin-top: 10px;
  padding: var(--space-3);
  border: 1px solid var(--ds-border);
  border-radius: var(--radius-lg);
  background: var(--ds-surface);
  box-shadow: var(--shadow-2);
  max-height: min(64vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.livesearch-results.is-open { display: block; animation: livesearchIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes livesearchIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.livesearch-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--ds-border);
  background: var(--ds-bg);
  color: var(--ds-text-muted);
  font-size: 12px;
}

.livesearch-status.is-ok {
  color: var(--ds-primary);
  border-color: color-mix(in srgb, var(--ds-primary) 30%, var(--ds-border));
  background: var(--ds-primary-tint);
}

.livesearch-results.is-busy .livesearch-status { color: var(--ds-text); }

.livesearch-hint {
  color: var(--ds-text-muted);
  font-size: 11px;
  opacity: 0.85;
}

/* ---------- full product cards ---------- */

.livesearch-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.livesearch-cards .pcard { animation-duration: 0.5s; }

/* ---------- "view all results" jump ---------- */

.livesearch-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--lu-deep-teal);
  color: #f2fbf9;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.livesearch-all svg { transition: transform 160ms ease; }

.livesearch-all:hover {
  background: var(--lu-teal-500);
  color: var(--lu-mint);
}

.livesearch-all:hover svg { transform: translateX(3px); }

[dir="rtl"] .livesearch-all svg { transform: scaleX(-1); }
[dir="rtl"] .livesearch-all:hover svg { transform: scaleX(-1) translateX(3px); }

/* ---------- skeleton cards (loading state) ---------- */

.livesearch-skel {
  border: 1px solid var(--ds-border);
  border-radius: var(--radius-lg);
  background: var(--ds-surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.livesearch-skel-media,
.livesearch-skel-thumb,
.livesearch-skel-line {
  position: relative;
  overflow: hidden;
  background-color: var(--ds-bg);
}

.livesearch-skel-media { aspect-ratio: 7 / 5; }

.livesearch-skel-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--radius-sm);
}

.livesearch-skel-media::after,
.livesearch-skel-thumb::after,
.livesearch-skel-line::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-primary) 12%, transparent), transparent);
  animation: livesearchSheen 1.25s ease-in-out infinite;
}

@keyframes livesearchSheen {
  to { transform: translateX(100%); }
}

.livesearch-skel-line {
  display: block;
  height: 9px;
  border-radius: 5px;
  background-color: color-mix(in srgb, var(--ds-text) 9%, transparent);
}

.livesearch-skel-line.is-w35 { width: 35%; }
.livesearch-skel-line.is-w55 { width: 55%; }
.livesearch-skel-line.is-w80 { width: 80%; }

.livesearch-skel-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--ds-border);
}

/* compact row variant (navbar dropdown) */
.livesearch-skel-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
}

.livesearch-skel-row .livesearch-skel-body {
  border-top: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .livesearch-results.is-open { animation: none; }
  .livesearch-skel-media::after,
  .livesearch-skel-thumb::after,
  .livesearch-skel-line::after { animation: none; content: none; }
}
