/* ==========================================================================
   NaviSign: живые демо — интерактивная карта и экран видеорекламы.
   Тёмная «киоск»-тема намеренно фиксированная: так выглядит реальное
   устройство, и она одинаково читается в светлой и тёмной темах сайта.
   ========================================================================== */

/* ---------- Компоновка секции навигации ---------- */

.ns-split {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--ds-space-300);
  align-items: start;
}

@media (max-width: 1020px) {
  .ns-split { grid-template-columns: 1fr; }
  .ns-demo { order: -1; margin-bottom: var(--ds-space-300); }
}

/* ---------- Панель-киоск с картой ---------- */

.ns-demo {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #0b0d12;
  color: #e6e8ee;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.3);
}

.ns-demo__bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ns-lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  flex: none;
}

.ns-lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9aa1af;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.ns-lang button.is-active { background: #fff; color: #0b0d12; }

.ns-search { position: relative; flex: 1; min-width: 210px; }

.ns-search > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  translate: 0 -50%;
  color: #8b919e;
  pointer-events: none;
}

.ns-search input {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #e6e8ee;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px 9px 34px;
  outline: none;
}

.ns-search input::placeholder { color: #7c828f; }

.ns-search input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.ns-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #14161d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: none;
}

.ns-results.is-open { display: block; }

.ns-results button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  appearance: none;
  background: none;
  border: 0;
  color: #e6e8ee;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
}

.ns-results button + button { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.ns-results button:hover { background: rgba(139, 92, 246, 0.16); }
.ns-results small { color: #7c828f; font-size: 11px; }

.ns-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px 2px;
}

.ns-cats button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #c7ccd6;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.ns-cats button:hover { border-color: rgba(255, 255, 255, 0.3); }

.ns-cats button.is-active {
  background: #fff;
  border-color: #fff;
  color: #0b0d12;
  font-weight: 600;
}

.ns-mapwrap { padding: 14px 16px 0; overflow-x: auto; }

.ns-map {
  position: relative;
  aspect-ratio: 1000 / 580;
  min-width: 640px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 33px 33px;
  container-type: inline-size;
  overflow: hidden;
}

.ns-map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.55));
}

.ns-map__corridor {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  background: rgba(139, 92, 246, 0.06);
  border-top: 1px dashed rgba(139, 92, 246, 0.22);
  border-bottom: 1px dashed rgba(139, 92, 246, 0.22);
}

.ns-map__corridor--1 { top: 24%; height: 9%; }
.ns-map__corridor--2 { top: 54%; height: 9%; }

.ns-store {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6cqi;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
  color: #d5d9e2;
  font-family: inherit;
  font-weight: 600;
  font-size: clamp(8px, 1.7cqi, 15px);
  line-height: 1.1;
  border-radius: 0.9cqi;
  cursor: pointer;
  padding: 0;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.ns-store:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.ns-store.is-dim { opacity: 0.22; }

.ns-store.is-target {
  background: rgba(139, 92, 246, 0.28);
  border-color: #8b5cf6;
  color: #fff;
  box-shadow: 0 0 0 1px #8b5cf6, 0 10px 34px rgba(139, 92, 246, 0.35);
}

.ns-store__name {
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ns-store--vert .ns-store__name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 94%;
}

.ns-store__chip {
  display: none;
  background: rgba(139, 92, 246, 0.95);
  color: #fff;
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1;
  padding: 0.45em 0.9em;
  border-radius: 999px;
  white-space: nowrap;
}

.ns-store.is-target .ns-store__chip { display: inline-block; }

.ns-here {
  position: absolute;
  z-index: 4;
  translate: -50% -50%;
  text-align: center;
  pointer-events: none;
}

.ns-here__tag {
  display: inline-block;
  border: 1px dashed rgba(74, 222, 128, 0.65);
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
  font-size: clamp(8px, 1.5cqi, 13px);
  font-weight: 600;
  line-height: 1;
  padding: 0.5em 1em;
  border-radius: 0.8em;
  white-space: nowrap;
}

.ns-here i {
  display: block;
  width: 13px;
  height: 13px;
  margin: 6px auto 0;
  border-radius: 50%;
  background: #22c55e;
  animation: ns-pulse 2.2s ease-out infinite;
}

.ns-dest {
  position: absolute;
  z-index: 4;
  translate: -50% -50%;
  pointer-events: none;
  display: none;
}

.ns-dest.is-on { display: block; }

.ns-dest i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3);
  animation: ns-pulse-violet 2.2s ease-out infinite;
}

@keyframes ns-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes ns-pulse-violet {
  0%   { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.5); }
  70%  { box-shadow: 0 0 0 11px rgba(167, 139, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

.ns-demo__foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 14px;
}

.ns-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #c7ccd6;
}

.ns-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b5cf6;
  flex: none;
}

.ns-status--route .ns-status__dot {
  background: #22c55e;
  animation: ns-pulse 2.2s ease-out infinite;
}

.ns-demo__note { font-size: 11px; color: #7c828f; }

/* ---------- Экран рекламы ---------- */

.ns-ads {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #0b0d12;
  color: #e6e8ee;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.3);
}

.ns-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  container-type: inline-size;
}

.ns-screen__bg {
  position: absolute;
  inset: -25%;
  background: linear-gradient(115deg, var(--g1, #6d28d9), var(--g2, #4f46e5), var(--g3, #0ea5e9), var(--g1, #6d28d9));
  background-size: 300% 300%;
  animation: ns-pan 9s linear infinite;
}

.ns-screen.is-paused .ns-screen__bg { animation-play-state: paused; }

@keyframes ns-pan {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.ns-screen__deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(2px);
  animation: ns-float 7s ease-in-out infinite alternate;
}

.ns-screen__deco--1 { width: 34%; aspect-ratio: 1; left: -8%; top: -20%; }
.ns-screen__deco--2 { width: 24%; aspect-ratio: 1; right: -6%; bottom: -16%; animation-delay: -3s; }

.ns-screen.is-paused .ns-screen__deco { animation-play-state: paused; }

@keyframes ns-float {
  from { translate: 0 0; }
  to   { translate: 0 26px; }
}

.ns-screen__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 0 6%;
}

/* на узких экранах не даём контенту налезать на чипы с именем файла */
@media (max-width: 700px) {
  .ns-screen__content { padding-bottom: 96px; }
}

.ns-screen__brand {
  font-size: clamp(26px, 4.6cqi, 54px);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 6px 34px rgba(0, 0, 0, 0.45);
}

.ns-screen__sub {
  font-size: clamp(12px, 1.8cqi, 19px);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.ns-screen__adbadge {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  background: rgba(8, 10, 14, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 9px;
  border-radius: 6px;
}

.ns-screen__file {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 52px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #e6e8ee;
  background: rgba(8, 10, 14, 0.72);
  padding: 6px 10px;
  border-radius: 8px;
}

.ns-screen__fs {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 52px;
  background: #10b981;
  color: #03271b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 8px;
}

.ns-bigplay {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  appearance: none;
  border: 0;
  background: rgba(4, 7, 11, 0.35);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.ns-bigplay svg {
  width: 28px;
  height: 28px;
  padding: 18px;
  box-sizing: content-box;
  background: rgba(10, 13, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.ns-screen.is-paused .ns-bigplay { opacity: 1; pointer-events: auto; }

.ns-controls {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 12px;
  background: linear-gradient(transparent, rgba(4, 7, 11, 0.78));
}

.ns-controls__btn {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 13, 18, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ns-controls__btn:hover { background: rgba(255, 255, 255, 0.18); }

.ns-controls__btn .ic-play { display: none; }
.ns-screen.is-paused .ns-controls__btn .ic-play { display: block; }
.ns-screen.is-paused .ns-controls__btn .ic-pause { display: none; }

.ns-time {
  margin-left: auto;
  font-size: 11.5px;
  color: #cbd2dd;
  font-variant-numeric: tabular-nums;
}

.ns-progress {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
}

.ns-progress i { display: block; height: 100%; width: 0; background: #fff; }

.ns-queue {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 14px;
}

.ns-queue__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7c828f;
  margin-bottom: 4px;
}

.ns-qitem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  appearance: none;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d5d9e2;
  font-family: inherit;
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.ns-qitem:hover { border-color: rgba(255, 255, 255, 0.28); }

.ns-qitem.is-now {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.09);
}

.ns-qitem__thumb {
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  background: linear-gradient(120deg, var(--g1), var(--g2), var(--g3), var(--g1));
  background-size: 250% 250%;
  animation: ns-pan 5s linear infinite;
}

.ns-qitem.is-now .ns-qitem__thumb { animation-duration: 2.5s; }

.ns-qitem__body { min-width: 0; }

.ns-qitem__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e6e8ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-qitem__meta {
  display: block;
  font-size: 11px;
  color: #7c828f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-qitem__status {
  flex: none;
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #6f7581;
}

.ns-qitem.is-now .ns-qitem__status { color: #34d399; }

@media (prefers-reduced-motion: reduce) {
  .ns-screen__bg,
  .ns-screen__deco,
  .ns-qitem__thumb,
  .ns-here i,
  .ns-dest i,
  .ns-status--route .ns-status__dot {
    animation: none;
  }
}
