/* all_search-loader.css v2.1
   Попап ожидания результатов поиска.
   Подключается после all_micro.css → использует mi-* keyframes и --mi-t-* токены.
   Переменные: --bg, --bg-card, --text, --accent, --border, --text-muted.
   Тёмная тема — [data-theme="dark"]. */


/* ── Overlay ── */

.search-loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
}

.search-loader.is-active {
  display: flex;
}

[data-theme="dark"] .search-loader {
  background: rgba(0, 0, 0, .6);
}


/* ── Card ── */

.search-loader__box {
  position: relative;
  background: var(--bg-card, var(--bg, #fff));
  color: var(--text, #1a1a2e);
  border: 1px solid var(--border, #e4e6eb);
  border-radius: var(--radius-l, 16px);
  padding: 36px 44px 32px;
  text-align: center;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, .06),
    0 16px 40px rgba(0, 0, 0, .1);
  max-width: 340px;
  width: 90%;
  overflow: hidden;
  animation: mi-enter-card var(--mi-t-slide, .35s cubic-bezier(.22, 1, .36, 1));
}

/* Accent top-line — брендовая полоска */
.search-loader__box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--accent, #2563eb),
    var(--green, #16a34a));
  border-radius: var(--radius-l, 16px) var(--radius-l, 16px) 0 0;
}

[data-theme="dark"] .search-loader__box {
  background: var(--bg-card, var(--bg, #1e2028));
  color: var(--text, #e8e9ed);
  border-color: var(--border, #2a2d38);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, .25),
    0 16px 40px rgba(0, 0, 0, .45);
}


/* ── Spinner — conic gradient ── */

.search-loader__spinner {
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    var(--accent, #2563eb) 75%,
    transparent 100%
  );
  animation: mi-spin .8s linear infinite;
}

/* Вырез центра — «кольцо», а не диск */
.search-loader__spinner::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg-card, var(--bg, #fff));
}

[data-theme="dark"] .search-loader__spinner::after {
  background: var(--bg-card, var(--bg, #1e2028));
}

[data-theme="dark"] .search-loader__text {
  color: var(--text, #e8e9ed);
}

[data-theme="dark"] .search-loader__query {
  --_muted: var(--text-muted, #7b8096);
  background-image: linear-gradient(
    90deg,
    var(--_muted) 0%,
    var(--_muted) 40%,
    var(--accent, #5b8def) 50%,
    var(--_muted) 60%,
    var(--_muted) 100%
  );
}


/* ── Типографика ── */

.search-loader__text {
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
}

.search-loader__query {
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
  font-size: var(--fs-sm, 13px);
  color: var(--text-muted, #6b7080);
  line-height: 1.4;
  margin: 0;
  word-break: break-word;

  /* Shimmer — «ищем» */
  background: linear-gradient(
    90deg,
    var(--text-muted, #6b7080) 0%,
    var(--text-muted, #6b7080) 40%,
    var(--accent, #2563eb) 50%,
    var(--text-muted, #6b7080) 60%,
    var(--text-muted, #6b7080) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sl-shimmer 2.5s ease-in-out infinite;
}

@keyframes sl-shimmer {
  0%, 100% { background-position: 100% 0; }
  50%      { background-position: -100% 0; }
}


/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .search-loader__box     { animation: none; }
  .search-loader__spinner { animation-duration: 2s; }
  .search-loader__query   { animation: none;
                            background: none;
                            -webkit-text-fill-color: var(--text-muted, #6b7080);
  }
}
