/**
 * NFS Car Card v3 — метаданные сверху, actions объединены
 * Хромовые градиенты
 */

/* ══════════════════════════════════════════════════════════
   КОНТЕЙНЕР КАРТОЧКИ
   ══════════════════════════════════════════════════════════ */

.nfs-cc {
  position: relative;
  border-radius: var(--nfs-rl, 14px);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(170deg, var(--nfs-white, #fff) 0%, var(--nfs-ch1, #F4F6FA) 100%);
  border: 0.5px solid var(--nfs-b1, rgba(58,66,96,0.07));
  box-shadow: 0 2px 10px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.9) inset;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.nfs-cc:hover {
  border-color: rgba(26,95,217,0.32);
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(26,95,217,0.14),
    0 0 20px rgba(26,95,217,0.1),
    0 10px 28px rgba(0,0,0,0.1);
}

/* ══════════════════════════════════════════════════════════
   ИЗОБРАЖЕНИЕ
   ══════════════════════════════════════════════════════════ */

.nfs-cc-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(155deg, #E6EBF6 0%, #D5DCF0 50%, #C4CEEA 100%);
}

/* Ссылка на лот заполняет блок — иначе в каталоге часть hit-area уходит в «пустоту» вокруг inline <a> */
.nfs-cc-img > a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* Электро фон */
.nfs-cc--electro .nfs-cc-img {
  background: linear-gradient(155deg, #D8EDF0 0%, #C0DCE8 50%, #A8CCD8 100%);
}

/* Люкс фон */
.nfs-cc--luxury .nfs-cc-img {
  background: linear-gradient(155deg, #EDE8E0 0%, #DDD5C5 50%, #C8BFAE 100%);
}

/* Градиент снизу для контраста */
.nfs-cc-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(12,18,40,0.12) 100%);
  pointer-events: none;
  z-index: 1;
}

.nfs-cc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s, filter 0.25s;
  position: relative;
  z-index: 2;
  /* Не даём WebKit начать drag-картинку — иначе листание по X в каталоге не срабатывает */
  -webkit-user-drag: none;
  user-select: none;
}

.nfs-cc:hover .nfs-cc-img img {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 18px rgba(26,95,217,0.2));
}

/* ══════════════════════════════════════════════════════════
   ACTIONS: избранное + сравнение (справа в строке с ценой)
   ══════════════════════════════════════════════════════════ */

.nfs-cc-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* Сброс абсолютного позиционирования из catalog_new.css */
.nfs-cc .car-favorite-btn,
.nfs-cc .btn-compare {
  position: static;
  top: auto;
  right: auto;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--nfs-white, #fff), var(--nfs-ch1, #F4F6FA));
  border: 0.5px solid var(--nfs-b2, rgba(58, 66, 96, 0.12));
  backdrop-filter: none;
}

.nfs-cc-act-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--nfs-white, #fff), var(--nfs-ch1, #F4F6FA));
  border: 0.5px solid var(--nfs-b2, rgba(58, 66, 96, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--nfs-t4, #9AA0B8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.9) inset;
}

/* Размеры иконок — как в шапке (nfs-ico--xl), см. nfs-icons.css */
.nfs-cc-act-btn .nfs-ico--xl {
  width: 20px;
  height: 20px;
}

/* Избранное — красное свечение */
.nfs-cc-act-btn.fav:hover {
  border-color: var(--nfs-red, #C92222);
  color: var(--nfs-red, #C92222);
  box-shadow: 0 0 0 3px var(--nfs-red-glow, rgba(201,34,34,0.22));
}

.nfs-cc-act-btn.fav.active {
  background: linear-gradient(135deg, rgba(201,34,34,0.1), rgba(201,34,34,0.05));
  border-color: var(--nfs-red, #C92222);
  color: var(--nfs-red, #C92222);
}

/* Сравнение — синее свечение */
.nfs-cc-act-btn.cmp:hover {
  border-color: var(--nfs-blue, #1A5FD9);
  color: var(--nfs-blue, #1A5FD9);
  box-shadow: 0 0 0 3px var(--nfs-blue-glow, rgba(26,95,217,0.22));
}

.nfs-cc-act-btn.cmp.active {
  background: linear-gradient(135deg, rgba(26,95,217,0.1), rgba(26,95,217,0.05));
  border-color: var(--nfs-blue, #1A5FD9);
  color: var(--nfs-blue, #1A5FD9);
}

/* ══════════════════════════════════════════════════════════
   ВОДЯНОЙ ЗНАК — логотип (полосы + название) в левом верхнем углу фото
   ══════════════════════════════════════════════════════════ */

.nfs-cc-watermark {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  bottom: auto;
  z-index: 5;
  pointer-events: none;
  max-width: calc(100% - 20px);
}

.nfs-cc-wm-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0.88;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

/* Мини-полосы в духе .nfs-logo-stripes (без анимации — много карточек на странице) */
.nfs-cc-wm-stripes {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
  flex-shrink: 0;
}

.nfs-cc-wm-stripes span {
  width: 3px;
  border-radius: 1px;
  transform: skewX(-12deg);
}

.nfs-cc-wm-stripes span:nth-child(1) {
  height: 14px;
  background: linear-gradient(180deg, #3b7fff, #1a5fd9);
}

.nfs-cc-wm-stripes span:nth-child(2) {
  height: 11px;
  background: linear-gradient(180deg, #e03030, #c92222);
}

.nfs-cc-wm-stripes span:nth-child(3) {
  height: 8px;
  background: linear-gradient(180deg, #e8ebf2, #a8b0c4);
}

.nfs-cc-wm-word {
  font-family: var(--nfs-ff, 'Montserrat', sans-serif);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ══════════════════════════════════════════════════════════
   META PANEL — выезжает СВЕРХУ при ховере
   ══════════════════════════════════════════════════════════ */

.nfs-cc-meta-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  background: linear-gradient(180deg, rgba(10,15,40,0.82) 0%, rgba(10,15,40,0.6) 100%);
  backdrop-filter: blur(8px);
  /* Компактная полоса: ~половина прежней высоты (одна строка значений) */
  padding: 5px 10px 5px;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 0.68, 0, 1.2);
}

.nfs-cc:hover .nfs-cc-meta-panel {
  transform: translateY(0);
}

.nfs-cc-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Одна строка: блоки на всю ширину панели; при экстремально узкой карточке — скролл */
.nfs-cc-meta-row--single-line {
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.nfs-cc-meta-row--single-line .nfs-cc-mpill {
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Одна строка без подписей — только число + единица */
.nfs-cc-meta-panel .nfs-cc-mpill--compact {
  flex-direction: row;
  gap: 0;
  min-height: 0;
}

.nfs-cc-meta-row--single-line .nfs-cc-mp-div {
  flex-shrink: 0;
}

.nfs-cc-meta-row--single-line .nfs-cc-mpill-val {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nfs-cc-mpill {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 60px;
}

.nfs-cc-mpill-lbl {
  font-size: 8px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Подписи в полосе метаданных — палитра как у demo-sw-body (зелёный градиент) */
.nfs-cc-meta-panel .nfs-cc-mpill-lbl {
  font-weight: 700;
  color: #22c55e;
  background-image: linear-gradient(150deg, #22c55e 0%, #14a34a 50%, #0a6a30 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@supports not (background-clip: text) {
  .nfs-cc-meta-panel .nfs-cc-mpill-lbl {
    color: #22c55e;
    -webkit-text-fill-color: currentColor;
    background-image: none;
  }
}

.nfs-cc-mpill-val {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}

.nfs-cc-meta-panel .nfs-cc-mpill-val {
  font-size: 10px;
  line-height: 1.15;
  font-weight: 700;
  /* Цвет как у .nfs-cc-mpill-val — белый на тёмной полосе метаданных */
  color: rgba(255, 255, 255, 0.92);
}

/* Каталог: только отступы полосы ×1.5 — выше фон; размер .nfs-cc-mpill-val как у базовой панели */
.catalog-car-card .nfs-cc-meta-panel {
  padding: 7.5px 15px 7.5px;
}

.nfs-cc-mp-div {
  width: 0.5px;
  background: rgba(255,255,255,0.15);
  align-self: stretch;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   ТЕЛО КАРТОЧКИ
   ══════════════════════════════════════════════════════════ */

.nfs-cc-body {
  padding: 11px 14px 13px;
  background: linear-gradient(180deg, var(--nfs-white, #fff) 0%, var(--nfs-ch1, #F4F6FA) 100%);
}

.nfs-cc-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--nfs-t1, #0D1117);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  display: block;
  text-decoration: none;
}

.nfs-cc-name:hover {
  color: var(--nfs-blue, #1A5FD9);
}

/* Метаданные под названием — через запятую, полный текст без обрезки (перенос строки при нехватке ширины) */
.nfs-cc-meta-static {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--nfs-t3, #64748b);
  margin-bottom: 8px;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
}

/* Если строки метаданных нет — прежний зазор между названием и ценой */
.nfs-cc-name + .nfs-cc-foot {
  margin-top: 2px;
}

.nfs-cc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nfs-cc-foot-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.nfs-cc-foot-left .nfs-cc-price-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

/* ══════════════════════════════════════════════════════════
   ЦЕНА — градиентная
   ══════════════════════════════════════════════════════════ */

.nfs-cc-price {
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.nfs-cc-price--blue {
  background: linear-gradient(135deg, #2B6FE8, #1248B0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nfs-cc-price--green {
  background: linear-gradient(135deg, #16A34A, #0A6A30);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nfs-cc-price--bronze {
  background: linear-gradient(135deg, #92400E, #C97020);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nfs-cc-byn {
  font-size: 11px;
  font-weight: 600;
  color: var(--nfs-t3, #5A6480);
  margin-left: 2px;
}

/* ══════════════════════════════════════════════════════════
   GRID LAYOUTS
   ══════════════════════════════════════════════════════════ */

.nfs-cc-grid {
  display: grid;
  gap: 16px;
}

.nfs-cc-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.nfs-cc-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.nfs-cc-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .nfs-cc-grid--4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .nfs-cc-grid--4,
  .nfs-cc-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .nfs-cc-grid--4,
  .nfs-cc-grid--3,
  .nfs-cc-grid--2 { grid-template-columns: 1fr; }
  
  .nfs-cc-meta-panel {
    padding: 5px 8px 4px;
  }

  .nfs-cc-meta-panel .nfs-cc-mpill-val {
    font-size: 9px;
  }

  .catalog-car-card .nfs-cc-meta-panel {
    padding: 7.5px 12px 6px;
  }
}
