/*
 * Прототип «Чёрной пятницы» (Nexus #26478): подключается только на тестовой главной /new-main/.
 * Секция носит ещё и класс nm-hits — от него базовые сбросы и стили карточек.
 */
body.new-main { --nm-bf-black: #141312; }

/* ---------- строка под шапкой ---------- */
.nm-bf-strip {
	display: block;
	padding: 10px var(--nm-gutter);
	background: var(--nm-bf-black);
	color: #fff;
	font-family: var(--nm-font);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	transition: color .2s;
}
.nm-bf-strip:hover { color: var(--nm-yellow); }
.nm-bf-strip b { color: var(--nm-yellow); font-weight: 700; }
.nm-bf-strip svg { margin-left: 4px; vertical-align: -1px; }

/* ---------- общее ---------- */
.nm-bf { scroll-margin-top: var(--nm-header-h); }
.nm-bf .nm-bf__title { margin: 0; font-family: var(--nm-font); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.nm-bf__date {
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 12px;
	border-radius: 14px;
	background: var(--nm-yellow);
	color: var(--nm-ink);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}
/* кнопка покупки видна сразу: выезжающая панель обрезалась бы лентой и накрывала следующий блок */
.nm-bf .nm-card__foot { position: static; margin: 18px -25px -22px; box-shadow: none; clip-path: none; opacity: 1; visibility: visible; }

/* ---------- вариант 1: чёрная витрина ---------- */
.nm-hits.nm-bf--showcase { padding: 56px 0; background: var(--nm-bf-black); color: #fff; }
.nm-bf__layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: stretch; }
.nm-bf__intro { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.nm-bf--showcase .nm-bf__title { font-size: 44px; }
.nm-bf__text { color: #bdb7ae; font-size: 15px; line-height: 1.5; }
.nm-bf__nav { display: flex; gap: 10px; margin-top: auto; }
.nm-bf__nav .nm-round-btn { border-color: rgba(255, 255, 255, .3); color: #fff; }
.nm-bf__nav .nm-round-btn:hover { border-color: var(--nm-yellow); color: var(--nm-yellow); }
.nm-bf__nav .nm-round-btn[disabled] { opacity: .35; pointer-events: none; }
.nm-bf__lane { min-width: 0; }
.nm-bf__lane .nm-hits__grid {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}
.nm-bf__lane .nm-hits__grid::-webkit-scrollbar { display: none; }
.nm-bf__lane .nm-card { flex: 0 0 calc(100% / 3); scroll-snap-align: start; }

/* ---------- вариант 2: мозаика ---------- */
.nm-hits.nm-bf--mosaic { padding: 56px 0 64px; background: var(--nm-surface); }
.nm-bf__banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	padding: 22px 28px;
	border-radius: var(--nm-radius-lg) var(--nm-radius-lg) 0 0;
	background: var(--nm-bf-black);
	color: #fff;
}
.nm-bf--mosaic .nm-bf__title { font-size: clamp(24px, 2.4vw, 32px); }
.nm-bf__link { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; font-weight: 500; transition: color .2s; }
.nm-bf__link:hover { color: var(--nm-yellow); }
.nm-bf--mosaic .nm-hits__grid { grid-template-columns: 2fr 1fr 1fr; }
.nm-bf--mosaic .nm-card:first-child { grid-row: span 2; }
/* крупная карточка выше своего содержимого: лишнюю высоту забирает фото, а не пустота над ценой */
@media (min-width: 1024px) {
	.nm-bf--mosaic .nm-card:first-child .nm-card__media { display: flex; flex: 1 1 auto; min-height: 360px; }
	.nm-bf--mosaic .nm-card:first-child .nm-card__img { flex: 1; aspect-ratio: auto; }
	.nm-bf--mosaic .nm-card:first-child .nm-card__info { flex: none; }
}
.nm-bf--mosaic .nm-card:first-child .nm-card__name { font-size: 20px; font-weight: 500; line-height: 28px; }
.nm-bf--mosaic .nm-card:first-child .nm-price__current { font-size: 26px; line-height: 32px; }
.nm-bf--mosaic .nm-card:first-child .nm-price__old { font-size: 16px; line-height: 32px; }

/* ---------- вариант 3: спокойный ---------- */
.nm-hits.nm-bf--calm { padding: 44px 0 60px; }
.nm-bf--calm .nm-block-head { gap: 16px; }

/* ---------- вариант 4: жёлтая бегущая строка ---------- */
.nm-bf-ticker {
	display: block;
	overflow: hidden;
	padding: 9px 0;
	background: var(--nm-yellow);
	color: var(--nm-ink);
	font-family: var(--nm-font);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .04em;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}
.nm-bf-ticker__track { display: inline-flex; width: max-content; animation: nm-bf-ticker 60s linear infinite; }
.nm-bf-ticker:hover .nm-bf-ticker__track, .nm-bf-ticker:focus-visible .nm-bf-ticker__track { animation-play-state: paused; }
.nm-bf-ticker__item::after { content: "★"; margin: 0 16px; }
@keyframes nm-bf-ticker { to { transform: translateX(-50%); } }

/* ---------- вариант 4: блок с таймером и скидкой на карточках ---------- */
.nm-hits.nm-bf--timer { padding: 44px 0 56px; }
.nm-bf-box { position: relative; overflow: hidden; padding: 40px; border-radius: 24px; background: var(--nm-bf-black); color: #fff; }
.nm-bf-box__glow { position: absolute; top: -120px; right: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(246, 190, 44, .16), transparent 65%); pointer-events: none; }
.nm-bf-box__head { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.nm-bf--timer .nm-bf__title { max-width: 560px; font-size: clamp(38px, 5.4vw, 72px); line-height: .98; text-transform: uppercase; }
.nm-bf--timer .nm-bf__title span { display: block; color: var(--nm-yellow); }
.nm-bf--timer .nm-bf__text { max-width: 520px; margin-top: 14px; font-size: 16px; }
.nm-bf--timer .nm-bf__text b { color: #fff; font-weight: 700; }

.nm-bf-timer__title { margin-bottom: 10px; color: #bdb7ae; font-size: 13px; text-align: right; }
.nm-bf-timer__cells { display: flex; gap: 8px; }
.nm-bf-timer__cell { text-align: center; }
.nm-bf-timer__num { min-width: 72px; padding: 12px 8px; border: 1px solid #2c2a27; border-radius: 12px; background: #1f1d1b; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.nm-bf-timer__label { margin-top: 6px; color: #bdb7ae; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.nm-bf-facts { position: relative; display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 24px 0 28px; color: #bdb7ae; font-size: 14px; }
.nm-bf-facts b { margin-right: 4px; color: var(--nm-yellow); font-size: 18px; font-weight: 700; }

/* та же разметка карточки, что в блоке хитов: тёмное оформление здесь, обработчики new_main.js работают без изменений */
.nm-hits.nm-bf--timer .nm-hits__grid {
	position: relative;
	display: grid;
	grid-template-columns: none;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 48px) / 4);
	gap: 16px;
	overflow-x: auto;
	padding: 4px 0;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}
.nm-hits.nm-bf--timer .nm-hits__grid::-webkit-scrollbar { display: none; }
.nm-bf--timer .nm-card { margin: 0; padding: 10px 10px 14px; border-radius: 16px; background: #1f1d1b; box-shadow: none; color: #fff; scroll-snap-align: start; transition: transform .2s; }
.nm-bf--timer .nm-card:hover, .nm-bf--timer .nm-card:focus-within { box-shadow: none; transform: translateY(-4px); }
.nm-bf--timer .nm-card__media { margin-bottom: 12px; }
.nm-bf--timer .nm-card__img { overflow: hidden; border-radius: 12px; background: #fff; }
.nm-bf--timer .nm-card__img img { inset: 7.5%; width: 85%; height: 85%; }
/* плашка «Успей купить» заняла бы место значка, а об остатке и так пишет строка ниже */
.nm-bf--timer .nm-card__stickers, .nm-bf--timer .nm-card__rating, .nm-bf--timer .nm-card__colors, .nm-bf--timer .nm-card__article, .nm-bf--timer .nm-counter, .nm-bf--timer .nm-economy__percent { display: none; }
.nm-bf--timer .nm-card__icons { top: 10px; right: 10px; }
.nm-bf-badge { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 6px 10px; border-radius: 8px; background: var(--nm-yellow); color: var(--nm-ink); font-size: 18px; font-weight: 700; line-height: 1.2; animation: nm-bf-pop .6s ease-out .3s both; }
@keyframes nm-bf-pop { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.15); } 100% { opacity: 1; transform: scale(1); } }
.nm-bf--timer .nm-card__info { padding: 0 4px; }
.nm-bf--timer .nm-card__name { order: -1; display: -webkit-box; min-height: 40px; margin: 0 0 8px; overflow: hidden; color: #fff; font-size: 15px; font-weight: 500; line-height: 20px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.nm-bf--timer .nm-card__name:hover { color: var(--nm-yellow); }
.nm-bf--timer .nm-stock { color: #bdb7ae; font-size: 13px; }
.nm-bf--timer .nm-stock--low { color: #ff6b4a; font-weight: 600; }
.nm-bf--timer .nm-card__price { order: -1; padding-top: 0; margin: 0 0 6px; }
.nm-bf--timer .nm-price__current { color: #fff; font-size: 22px; line-height: 28px; }
.nm-bf--timer .nm-price__old { color: #8c857c; font-size: 14px; line-height: 28px; }
.nm-bf--timer .nm-economy { display: block; margin-top: 2px; padding: 0; background: none; color: var(--nm-yellow); font-size: 13px; line-height: 18px; }
.nm-bf--timer .nm-economy__text { padding: 0; background: none; }
.nm-hits.nm-bf--timer .nm-card__foot { margin: 12px 4px 0; background: none; }
.nm-bf--timer .nm-card__buy { flex-basis: 100%; height: 44px; border-radius: 10px; background: #fff; color: #111; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; transition: background-color .15s; }
.nm-bf--timer .nm-card__buy:hover, .nm-bf--timer .nm-card__buy--in { background: var(--nm-yellow); }
.nm-bf-box__foot { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.nm-bf-box__foot .nm-bf__nav { margin: 0; }
.nm-bf-box__terms { position: relative; margin-top: 16px; color: #8c857c; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
	.nm-bf-ticker__track, .nm-bf-badge { animation: none; }
	.nm-bf--timer .nm-card, .nm-bf--timer .nm-card:hover, .nm-bf--timer .nm-card:focus-within { transform: none; transition: none; }
	.nm-bf__lane .nm-hits__grid, .nm-hits.nm-bf--timer .nm-hits__grid { scroll-behavior: auto; }
}

/* ---------- переключатель вариантов (только для просмотра прототипа) ---------- */
.nm-bf-switch {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 800;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px;
	border-radius: 8px;
	background: var(--nm-bf-black);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
	color: #fff;
	font-family: var(--nm-font);
	font-size: 13px;
}
.nm-bf-switch__title { padding: 0 8px; color: #bdb7ae; }
.nm-bf-switch__item { padding: 6px 10px; border-radius: 5px; color: #fff; font-weight: 500; text-decoration: none; }
.nm-bf-switch__item:hover { color: var(--nm-yellow); }
.nm-bf-switch__item.is-active { background: var(--nm-yellow); color: var(--nm-ink); }

@media (hover: none) {
	.nm-bf-switch__name { display: none; }
}
@media (max-width: 1099px) {
	.nm-bf__layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.nm-bf__nav { display: none; }
	.nm-bf--showcase .nm-bf__title { font-size: 34px; }
	/* лента до краёв экрана, как у акций */
	.nm-bf__lane { margin: 0 calc(var(--nm-gutter) * -1); }
	.nm-bf__lane .nm-hits__grid { padding: 0 var(--nm-gutter); scroll-padding: 0 var(--nm-gutter); }
	.nm-bf__lane .nm-card { flex-basis: 300px; }
}
@media (max-width: 1023px) {
	.nm-hits.nm-bf--showcase, .nm-hits.nm-bf--mosaic { padding: 40px 0 44px; }
	.nm-hits.nm-bf--calm { padding: 32px 0 44px; }
	.nm-bf--mosaic .nm-hits__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nm-bf--mosaic .nm-card:first-child { grid-column: 1 / -1; grid-row: auto; }
	.nm-bf__banner { padding: 18px 20px; }
	.nm-hits.nm-bf--timer { padding: 32px 0 44px; }
	.nm-bf-box { padding: 32px 24px; }
	.nm-hits.nm-bf--timer .nm-hits__grid { grid-auto-columns: calc((100% - 32px) / 3); }
}
@media (max-width: 767px) {
	.nm-bf-timer { width: 100%; }
	.nm-bf-timer__title { text-align: left; }
	.nm-bf-timer__cell { flex: 1; }
	.nm-bf-timer__num { min-width: 0; padding: 10px 4px; font-size: 24px; }
	.nm-hits.nm-bf--timer .nm-hits__grid { grid-auto-columns: 62%; }
	.nm-bf-box__foot .nm-bf__nav { display: none; }
	.nm-bf-box__foot .nm-btn { width: 100%; }
}
@media (max-width: 599px) {
	.nm-bf-box { margin: 0 calc(var(--nm-gutter) * -.5); padding: 26px 16px; border-radius: 18px; }
	.nm-bf-ticker { font-size: 12px; }
	.nm-bf-facts { flex-direction: column; margin: 20px 0 22px; }
	.nm-hits.nm-bf--timer .nm-hits__grid { grid-auto-columns: 72%; }
	.nm-bf--timer .nm-price__current { font-size: 19px; }
	.nm-bf-badge { font-size: 16px; }
	.nm-bf-strip { padding: 9px 16px; font-size: 12px; }
	.nm-bf-strip__more, .nm-bf-switch__name, .nm-bf-switch__title { display: none; }
	.nm-bf .nm-card__foot { margin: 14px -12px 0; }
	.nm-bf__lane .nm-card { flex-basis: 62%; }
	.nm-bf--mosaic .nm-card:first-child .nm-card__name { font-size: 16px; line-height: 23px; }
	.nm-bf--mosaic .nm-card:first-child .nm-price__current { font-size: 22px; }
	.nm-bf--mosaic .nm-card:first-child .nm-price__old { font-size: 14px; }
	.nm-bf__link { margin-left: 0; }
}
