/* Стикеры проходности / прогноза цены */

.nfs-sticker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 8px 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  cursor: help;
  border: 1px solid transparent;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.nfs-sticker:is(:hover, :focus-visible) {
  z-index: 120;
}

/* Контейнеры карточки — не обрезаем всплывающие подсказки */
.nfs-cc-body,
.nfs-cc-foot,
.nfs-cc-foot-left,
.nfs-cc-delivery-block,
.nfs-cc-status-pills-wrap,
.nfs-cc-status-pills,
.nfs-cc-delivery-pills,
.nfs-lot-delivery-calc__badges,
.lot-hero-aside,
.nfs-lot-aside-unified,
.nfs-lot-aside-section--listing,
.nfs-lot-aside-section--actions,
.nfs-lot-delivery-calc--embedded {
  overflow: visible;
}

.nfs-listings-grid,
.nfs-listings-grid .nfs-cc,
.cars-grid-new,
.cars-grid-new .nfs-cc,
.catalog-results-wrapper .nfs-cc {
  overflow: visible;
}

.nfs-sticker__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nfs-sticker__info {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, serif;
  opacity: 0.85;
}

.nfs-sticker__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  min-width: 200px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 130;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.nfs-sticker__tip::after {
  content: '';
  position: absolute;
  left: var(--nfs-tip-arrow-x, 50%);
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.nfs-sticker:hover .nfs-sticker__tip,
.nfs-sticker:focus-visible .nfs-sticker__tip,
.nfs-sticker.is-tip-open .nfs-sticker__tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(calc(-50% + var(--nfs-tip-nudge, 0px))) translateY(0);
}

/* Fixed-слой: JS выносит tip из overflow/transform родителей (карточка лота) */
.nfs-sticker__tip.nfs-sticker__tip--fixed {
  position: fixed !important;
  z-index: 4000;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  transform: none !important;
  max-width: min(280px, calc(100vw - 24px));
  width: max-content;
  white-space: normal;
  box-sizing: border-box;
}

.nfs-sticker__tip.nfs-sticker__tip--fixed::after {
  top: auto;
  bottom: 100%;
  left: var(--nfs-tip-arrow-x, 18px);
  transform: translateX(-50%);
  border-top-color: transparent;
  border-bottom-color: #1e293b;
}

/* Мобильные: подсказка вниз от стикера, вправо (не за левый край экрана) */
@media (max-width: 767px) {
  .nfs-cc-status-pills .nfs-sticker,
  .nfs-cc-delivery-pills .nfs-sticker {
    position: relative;
    max-width: 100%;
  }

  .nfs-sticker__tip {
    top: calc(100% + 6px);
    bottom: auto;
    left: 0;
    right: auto;
    transform: translateX(var(--nfs-tip-nudge, 0px));
    min-width: 0;
    max-width: min(280px, calc(100vw - 24px));
    width: max-content;
    box-sizing: border-box;
    white-space: normal;
    text-align: left;
    --nfs-tip-arrow-x: 18px;
  }

  /* Было right:0 — tip рос влево и обрезался у края viewport */
  .nfs-cc-status-pills .nfs-sticker__tip,
  .nfs-cc-delivery-pills .nfs-sticker__tip,
  .nfs-lot-delivery-calc__badges .nfs-sticker__tip {
    left: 0;
    right: auto;
  }

  .nfs-sticker:hover .nfs-sticker__tip,
  .nfs-sticker:focus-visible .nfs-sticker__tip,
  .nfs-sticker.is-tip-open .nfs-sticker__tip {
    transform: translateX(var(--nfs-tip-nudge, 0px));
  }

  .nfs-sticker__tip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1e293b;
  }
}

.nfs-sticker--passable,
.nfs-sticker--ok {
  background: linear-gradient(180deg, #ecfdf3 0%, #d1fae5 100%);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}

.nfs-sticker--passable .nfs-sticker__info,
.nfs-sticker--ok .nfs-sticker__info {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.nfs-sticker--high_rate,
.nfs-sticker--critical {
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.35);
}

.nfs-sticker--high_rate .nfs-sticker__info,
.nfs-sticker--critical .nfs-sticker__info {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.nfs-sticker--warning {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
}

.nfs-sticker--warning .nfs-sticker__info {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.nfs-sticker--neutral {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.25);
}

.nfs-sticker--future {
  background: linear-gradient(180deg, #fefce8 0%, #fef08a 100%);
  color: #713f12;
  border-color: rgba(234, 179, 8, 0.45);
}

.nfs-sticker--future.nfs-sticker--down {
  background: linear-gradient(180deg, #ecfdf5 0%, #bbf7d0 100%);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.35);
}

.nfs-sticker--future .nfs-sticker__info {
  background: rgba(0, 0, 0, 0.08);
}

.nfs-cc-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  align-content: flex-start;
  min-width: 0;
  max-width: 100%;
}

.nfs-cc-status-pills .nfs-sticker {
  flex: 0 1 auto;
  max-width: 100%;
}

.nfs-cc-delivery-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.nfs-header-currency__select {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 22px 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.nfs-header-city__menu {
  max-height: min(70vh, 420px);
  overflow-y: auto;
  min-width: 220px;
}

.nfs-header-city__group-label {
  display: block;
  padding: 6px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  pointer-events: none;
}

.nfs-header-city__group-list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
}

.nfs-header-city__group + .nfs-header-city__group {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.nfs-mobile-drawer-utility .nfs-header-currency__select {
  width: 100%;
  min-height: 38px;
  border-color: rgba(26, 95, 217, 0.14);
  background-color: #ffffff;
  color: #1e293b;
  font-size: 0.8125rem;
}
