/**
 * Polish / motion utilities (surface-specific, поверх app_base + app_loading).
 * Токены: app_base.css; принципы: docs/architecture/app_motion_and_perceived_quality.md
 */

/* --- Search: загрузка и пустые/ошибочные состояния --- */
.search-results.is-search-fetching {
  pointer-events: none;
}

.search-results__loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 6px;
  width: 100%;
  box-sizing: border-box;
}

.search-results__loading-row {
  height: 52px;
  border-radius: 16px;
  width: 100%;
}

.search-results__empty-state {
  padding: 20px 14px 18px;
  text-align: center;
  box-sizing: border-box;
}

.search-results__empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 6px;
  line-height: 1.25;
}

.search-results__empty-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.35;
  margin: 0;
}

.search-results__empty-state--error .search-results__empty-hint {
  color: rgba(110, 110, 115, 0.92);
}

/* --- Product: появление карточки и контентных блоков --- */
@keyframes appPolishFadeUp {
  from {
    opacity: 0;
    transform: translateY(var(--motion-polish-fade-y));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger: image → info (+40ms) → content (+80ms); триггер .app-polish--product-stagger-run на .product-card */
.product-card.app-polish--product-stagger-run .app-polish--product-stagger-0 {
  animation: appPolishFadeUp var(--motion-product-card-enter) var(--ease-out-apple) both;
}
.product-card.app-polish--product-stagger-run .app-polish--product-stagger-1 {
  animation: appPolishFadeUp var(--motion-product-card-enter) var(--ease-out-apple) both;
  animation-delay: 40ms;
}
.product-card.app-polish--product-stagger-run .app-polish--product-stagger-2 {
  animation: appPolishFadeUp var(--motion-product-card-enter) var(--ease-out-apple) both;
  animation-delay: 80ms;
}

#items.app-polish--listing-exit {
  opacity: 0.88;
  pointer-events: none;
  transition: opacity 100ms var(--ease-out-apple);
}

#items .item-card.app-polish--list-card-enter {
  animation: appPolishFadeUp var(--motion-list-fade-duration) var(--ease-out-apple) both;
  animation-delay: calc(var(--app-polish-card-index, 0) * 22ms);
}

.search-result.app-polish--row-pressed {
  transform: scale(0.985);
  transition: transform 70ms var(--ease-out-apple);
}
.search-overlay.app-polish--nav-pulse {
  opacity: 0.97;
  transition: opacity 90ms var(--ease-out-apple);
}

@media (prefers-reduced-motion: reduce) {
  .product-card.app-polish--product-stagger-run .app-polish--product-stagger-0,
  .product-card.app-polish--product-stagger-run .app-polish--product-stagger-1,
  .product-card.app-polish--product-stagger-run .app-polish--product-stagger-2 {
    animation: none !important;
    opacity: 1 !important;
  }

  #items .item-card.app-polish--list-card-enter {
    animation: none !important;
  }
}

.product-layered-content.app-polish--layered-content {
  animation: appPolishFadeUp var(--motion-duration-medium) var(--ease-out-apple) both;
}

/* --- Content screen: мягкое появление тела при смене раздела (класс вешает навигация при необходимости) --- */
#content-screen-body.app-polish--content-enter {
  animation: appPolishFadeUp var(--motion-list-fade-duration) var(--ease-out-apple) both;
}

@media (prefers-reduced-motion: reduce) {
  .product-layered-content.app-polish--layered-content,
  #content-screen-body.app-polish--content-enter {
    animation: none !important;
  }

  .search-results.is-spotlight-list-reveal {
    animation: none !important;
  }
}
