/* Iteration 14: live search dropdown, filter loading / empty states. Tokens come from design-base.css. */

/* ---- live search ------------------------------------------------------------------------------------------- */
.design-search .search-result { padding: 6px; max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.design-search .search-result[hidden] { display: none !important; }
.design-search .search-inner { position: relative; }
.design-search .search-result.is-loading .search-inner > :not(.ls-skeleton) { opacity: .6; transition: opacity .15s ease; }

.ls-group + .ls-group, .ls-group + .ls-all, .ls-hint + .ls-group { margin-top: 4px; }
.ls-group-title { padding: 8px 10px 4px; color: var(--design-muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; line-height: 1.3; text-transform: uppercase; }
.ls-hint { padding: 6px 10px; color: var(--design-muted); font-size: 12px; line-height: 1.4; }

.ls-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; color: var(--design-ink); border-radius: calc(var(--design-radius) - 3px); text-decoration: none; cursor: pointer; }
.ls-item:hover, .ls-item[aria-selected="true"] { color: var(--design-ink); background: var(--design-blue-soft); text-decoration: none; }
.ls-thumb { flex: 0 0 44px; width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; }
.ls-cat-icon { display: flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--design-blue); font-size: 18px; border-radius: 6px; background: var(--design-blue-soft); }
.ls-item[aria-selected="true"] .ls-cat-icon, .ls-item:hover .ls-cat-icon { background: #fff; }
.ls-body { flex: 1 1 auto; min-width: 0; }
.ls-title { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ls-title mark { padding: 0; color: var(--design-blue); font-weight: 600; background: none; }
.ls-price { flex: 0 0 auto; max-width: 38%; font-size: 14px; font-weight: 600; line-height: 1.3; text-align: right; white-space: nowrap; }
.ls-price-unit { color: var(--design-muted); font-size: 12px; font-weight: 400; }
.ls-price-ask { color: var(--design-muted); font-size: 12px; font-weight: 400; }
.ls-badge { flex: 0 0 auto; padding: 2px 8px; color: var(--design-muted); font-size: 11px; line-height: 1.5; border-radius: 99px; background: #f3f5f9; }
.ls-all { margin-top: 4px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--design-line); border-radius: 0 0 calc(var(--design-radius) - 3px) calc(var(--design-radius) - 3px); }
.ls-all .ls-title { color: var(--design-blue); font-weight: 600; }

.ls-empty { padding: 18px 12px; text-align: center; }
.ls-empty-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.ls-empty-text { margin: 0; color: var(--design-muted); font-size: 13px; line-height: 1.45; }

.ls-skeleton { display: grid; gap: 8px; padding: 6px 4px; }
.ls-skeleton span { height: 44px; border-radius: 8px; background: linear-gradient(90deg, #f1f3f8 25%, #e8ecf4 50%, #f1f3f8 75%); background-size: 200% 100%; animation: design-shimmer 1.1s linear infinite; }

@media (max-width: 575.98px) {
    .ls-price { max-width: 34%; font-size: 13px; }
    .ls-thumb, .ls-cat-icon { flex-basis: 38px; width: 38px; height: 38px; }
}

/* ---- filter and list loading state --------------------------------------------------------------------------
   The list is dimmed a little and a thin bar runs along its top edge; the filter form stays fully usable. */
#eFiltr_results_wrapper .eFiltr_loader { display: none !important; }
#eFiltr_results_wrapper { position: relative; }
#eFiltr_results_wrapper::before { content: ""; position: absolute; z-index: 5; top: 0; right: 0; left: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--design-blue), transparent) no-repeat; background-size: 35% 100%; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
#eFiltr_results_wrapper.is-loading::before { opacity: 1; animation: design-loading-bar 1s ease-in-out infinite; }
#eFiltr_results { transition: opacity .18s ease; }
#eFiltr_results_wrapper.is-loading #eFiltr_results { opacity: .7; }
#eFiltr_results:focus { outline: none; }
#design-filter-status { transition: opacity .15s ease; }
.eFiltr.is-updating #design-filter-status { opacity: .6; }

.design-empty-results { padding: 36px 16px 44px; text-align: center; }
.design-empty-title { margin: 0 0 6px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.design-empty-text { max-width: 420px; margin: 0 auto 18px; color: var(--design-muted); font-size: 14px; line-height: 1.5; }
.design-empty-reset { display: inline-block; padding: 10px 22px; color: #fff; font-size: 14px; line-height: 1.2; border-radius: var(--design-radius); background: var(--design-blue); text-decoration: none; }
.design-empty-reset:hover, .design-empty-reset:focus, .design-empty-reset:active { color: #fff; background: var(--design-blue-hover); text-decoration: none; }
.design-search-note { margin: 0 0 14px; padding: 10px 14px; color: var(--design-muted); font-size: 14px; line-height: 1.45; border-radius: var(--design-radius); background: #f6f8fc; }

#design-filter-error { margin: 8px 0 0; }
.design-filter-retry { margin-left: 4px; padding: 0; color: var(--design-blue); font: inherit; text-decoration: underline; border: 0; background: none; cursor: pointer; }

@keyframes design-loading-bar { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
@keyframes design-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
    #eFiltr_results_wrapper.is-loading::before { animation: none; background-size: 100% 100%; background: var(--design-blue); opacity: .5; }
    .ls-skeleton span { animation: none; }
    #eFiltr_results, .design-search .search-result.is-loading .search-inner > :not(.ls-skeleton) { transition: none; }
}
