/*
 * Alef Rehitim – חלון מבצע. Всё под корнем .asp, чужие стили не трогает.
 * Три шага переключает атрибут data-step на корне; ширина ≥ 800 px — сцена сбоку, уже — сверху.
 * Цвета и размеры — переменные ниже.
 */

/* Шрифт заголовков и цифр. Браузер скачивает файл только когда поп-ап показан. */
@font-face {
	font-family: "Karantina";
	font-weight: 700;
	font-display: swap;
	src: url(fonts/karantina-700-hebrew.woff2) format("woff2");
	unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
	font-family: "Karantina";
	font-weight: 700;
	font-display: swap;
	src: url(fonts/karantina-700-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212;
}

html.asp-lock { overflow: hidden; }

.asp {
	--asp-ink: #14213a;
	--asp-text: #4a4f5c;
	--asp-muted: #7b8090;
	--asp-line: #e3e7ef;
	--asp-paper: #fff;
	--asp-blue: #1d3f72;
	--asp-blue-dark: #142c52;
	--asp-gold: #f4b730;
	--asp-wa: #1faa59;
	--asp-red: #d8452f;
	--asp-r: 28px;
	--asp-display: "Karantina", "Assistant", sans-serif;
	--asp-card-h: min(660px, calc(100vh - 20px));
	--asp-card-h: min(660px, calc(100dvh - 20px));

	position: fixed;
	inset: 0;
	/* Выше нижней панели alef-mobile (99991), кружков WhatsApp / cookie и баннера cookie: пока поп-ап открыт, он один. */
	z-index: 2147483000;
	display: grid;
	place-items: center;
	font-family: "Assistant", var(--font-text, sans-serif), sans-serif;
	font-size: 15px;
	line-height: 1.35;
	color: var(--asp-ink);
	text-align: start;
}
.asp[hidden] { display: none; }
.asp *, .asp *::before, .asp *::after { box-sizing: border-box; }
.asp :focus-visible { outline: 3px solid var(--asp-gold); outline-offset: 2px; }
.asp .asp-card:focus-visible { outline: 0; } /* карточка получает фокус при открытии — рамка нужна только кнопкам */
.asp button { font: inherit; color: inherit; }

.asp-dim {
	position: absolute;
	inset: 0;
	background: rgba(20, 15, 10, .62);
	animation: asp-fade .35s both;
}
.asp-card {
	position: relative;
	width: min(430px, calc(100% - 20px));
	height: var(--asp-card-h);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	overflow: clip;
	background: var(--asp-paper);
	border-radius: var(--asp-r);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
	outline: 0;
	animation: asp-in .5s cubic-bezier(.2, .9, .2, 1) both;
}
@keyframes asp-fade { from { opacity: 0; } }
@keyframes asp-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }

.asp-close {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 9;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	color: #111;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/* ── Сцена ── */
.asp-stage {
	position: relative;
	flex: 0 0 auto;
	height: calc(var(--asp-card-h) * .3);
	overflow: hidden;
	overflow: clip;
	background: var(--asp-blue);
	transition: height .55s cubic-bezier(.2, .8, .2, 1);
}
.asp[data-step="2"] .asp-stage { height: calc(var(--asp-card-h) * .6); }
.asp[data-step="3"] .asp-stage { height: calc(var(--asp-card-h) * .24); }

/* Итог: фото товара и «עד N%». Лежит под молнией, виден после раскрытия. */
.asp-result { position: absolute; inset: 0; z-index: 0; background: var(--asp-blue-dark); }
.asp-result-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.asp-result::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to left, var(--asp-blue) 0%, rgba(29, 63, 114, .82) 44%, transparent 78%);
}
.asp-result-text {
	position: absolute;
	inset: 0 16px 0 44%;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	align-content: center;
	gap: 0 10px;
	color: #fff;
	font-weight: 700;
	font-size: 20px;
}
.asp-result-num { font-family: var(--asp-display); font-weight: 700; font-size: 84px; line-height: .8; color: var(--asp-gold); }
.asp-result-what { flex-basis: 100%; margin-top: 4px; font-size: 16px; }

/* Молния. Блок всегда высотой «как на шаге 2»: на шаге 1 видна его верхняя часть. */
.asp-zipper { position: absolute; inset: 0 0 auto 0; z-index: 1; height: calc(var(--asp-card-h) * .6); outline-offset: -4px; }
.asp[data-step="2"] .asp-zipper { touch-action: none; cursor: grab; }
.asp-zipper > * { position: absolute; }
.asp-lining {
	inset: 0;
	background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .16) 0 14px, transparent 14px 34px), linear-gradient(160deg, #f9c84d, #eda51c);
	transition: opacity .6s .15s;
}
.asp-lining-text { position: absolute; top: 0; left: 0; right: 0; text-align: center; color: var(--asp-blue-dark); transform-origin: 50% 0; white-space: nowrap; }
.asp-lining-text span { display: block; font-weight: 800; font-size: 26px; line-height: 1.1; }
.asp-lining-text b { display: block; font-family: var(--asp-display); font-weight: 700; font-size: 150px; line-height: .82; }
.asp-zip { inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .4)); }
.asp-zip .asp-flap { transition: transform .6s cubic-bezier(.6, 0, .9, .4); }
.asp-zip .asp-zip-rest { transition: opacity .3s; }

/* Бирка на подушке: на шаге 1 — название акции, на шаге 2 — выбранная категория и вопрос. */
.asp-tag {
	top: 74px;
	right: 6%;
	width: 36%;
	min-width: 132px;
	padding: 10px 8px 9px;
	border-radius: 8px;
	background: #fff;
	color: var(--asp-blue-dark);
	text-align: center;
	outline: 2px dashed rgba(29, 63, 114, .45);
	outline-offset: -5px;
	transform: rotate(-4deg);
	box-shadow: 0 6px 14px rgba(0, 0, 0, .28);
	pointer-events: none;
	transition: opacity .35s;
}
.asp-tag b { display: block; font-family: var(--asp-display); font-weight: 700; font-size: 44px; line-height: .85; }
.asp-tag small { display: block; font-size: 13px; font-weight: 700; }

/* Подсказка у замка: видна только на шаге 2, пока посетитель не начал тянуть. */
.asp-hint {
	top: 46%;
	left: 7%;
	display: none;
	align-items: center;
	gap: 6px;
	padding: 7px 12px 7px 10px;
	border-radius: 999px;
	background: var(--asp-gold);
	color: var(--asp-blue-dark);
	font-weight: 800;
	font-size: 15px;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
	animation: asp-nod 1.3s ease-in-out infinite;
}
.asp-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.asp[data-step="2"] .asp-hint { display: flex; }
@keyframes asp-nod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
@keyframes asp-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.asp[data-step="1"] .asp-zip-pull { animation: asp-swing 3s ease-in-out infinite; }

.asp.is-busy .asp-tag, .asp.is-busy .asp-hint { opacity: 0; animation: none; }
.asp.is-done .asp-flap-l { transform: translateX(-110%); }
.asp.is-done .asp-flap-r { transform: translateX(110%); }
.asp.is-done .asp-zip-rest, .asp.is-done .asp-lining { opacity: 0; }
.asp.is-done .asp-zipper { pointer-events: none; }

/* ── Нижняя часть: три вида, виден тот, чей номер в data-step ── */
.asp-panel { position: relative; flex: 1; min-height: 0; }
.asp-view {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 16px 12px;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .25s, transform .25s, visibility 0s .25s;
}
.asp[data-step="1"] .asp-view[data-view="1"],
.asp[data-step="2"] .asp-view[data-view="2"],
.asp[data-step="3"] .asp-view[data-view="3"] { opacity: 1; visibility: visible; transform: none; transition: opacity .4s .2s, transform .4s .2s; }

.asp .asp-title { margin: 0; padding: 0; font-family: var(--asp-display); font-weight: 700; font-size: 38px; line-height: .95; color: var(--asp-ink); text-wrap: balance; }
.asp .asp-sub { margin: 0; color: var(--asp-text); font-size: 15px; }

.asp-tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(84px, 1fr); gap: 8px; }
.asp .asp-tile { position: relative; min-height: 84px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--asp-blue-dark); color: #fff; text-align: start; cursor: pointer; }
.asp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .5s; }
.asp-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent 58%); }
.asp-tile span { position: absolute; inset: auto 10px 8px 10px; z-index: 1; font-weight: 800; font-size: 16px; line-height: 1.1; }
@media (hover: hover) { .asp-tile:hover img { transform: scale(1.07); } }

.asp-meter { flex: none; height: 8px; border-radius: 8px; background: var(--asp-line); overflow: hidden; }
.asp-meter i { display: block; width: 0; height: 100%; border-radius: 8px; background: var(--asp-gold); }
.asp-peek { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--asp-text); }
.asp-peek div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.asp-peek i { position: relative; display: block; height: 54px; border-radius: 11px; overflow: hidden; background: var(--asp-line); }
.asp-peek img { width: 100%; height: 100%; max-width: none; object-fit: cover; filter: blur(7px) saturate(.8); transform: scale(1.2); }
.asp-peek i::after { content: "?%"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .28); color: #fff; font-weight: 800; font-size: 20px; direction: ltr; }

.asp-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; margin-top: auto; }
.asp .asp-link { min-height: 40px; padding: 10px 0; border: 0; background: none; color: var(--asp-ink); font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.asp .asp-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.asp .asp-list li { margin: 0; padding: 0; }
.asp .asp-item { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--asp-line); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; }
.asp-item img { width: 76px; height: 64px; max-width: none; object-fit: cover; border-radius: 10px; }
.asp-item-name { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; font-size: 14px; line-height: 1.2; }
.asp-item-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.asp-item-price b { font-weight: 800; font-size: 18px; }
.asp-item-price s { color: var(--asp-muted); font-size: 13px; }
.asp-badge { padding: 5px 9px; border-radius: 999px; background: var(--asp-red); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; }

.asp-timer { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }
.asp-clock { display: flex; gap: 5px; direction: ltr; font-variant-numeric: tabular-nums; }
.asp-clock span { min-width: 42px; padding: 4px 6px; border-radius: 7px; background: var(--asp-ink); color: #fff; text-align: center; font-weight: 800; font-size: 17px; line-height: 1.05; }
.asp-clock small { display: block; font-size: 10px; font-weight: 600; opacity: .8; }

.asp-cta { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.asp .asp-wa, .asp .asp-call { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; font-weight: 800; text-decoration: none; }
.asp .asp-wa { background: var(--asp-wa); color: #fff; font-size: 18px; box-shadow: 0 6px 16px rgba(31, 170, 89, .35); }
.asp .asp-call { padding: 0 16px; border: 2px solid var(--asp-ink); color: var(--asp-ink); font-size: 16px; }
.asp-cta svg { width: 22px; height: 22px; fill: currentColor; }
.asp .asp-legal { margin: 0; color: var(--asp-muted); font-size: 12px; text-align: center; }

/* Низкое узкое окно: сцена на шаге 1 ниже — бирка меньше, чтобы не обрезалась. */
@media (max-width: 799px) and (max-height: 640px) {
	.asp-tag { top: 40px; padding: 8px 8px 7px; }
	.asp-tag b { font-size: 34px; }
	.asp-tag small { font-size: 12px; }
}

/* ── Широкий экран: сцена справа, содержимое слева ── */
@media (min-width: 800px) {
	.asp { --asp-card-h: min(620px, calc(100vh - 40px)); }
	.asp-card { flex-direction: row; width: min(980px, calc(100% - 40px)); }
	.asp[data-step] .asp-stage { flex: 0 0 44%; height: 100%; }
	.asp-zipper { height: 100%; }
	.asp-result::after { background: linear-gradient(to top, var(--asp-blue) 0%, rgba(29, 63, 114, .7) 30%, transparent 62%); }
	.asp-result-text { inset: auto 18px 14px 18px; align-content: flex-end; }
	.asp-result-num { font-size: 112px; }
	.asp-result-what { font-size: 19px; }
	.asp-view { gap: 12px; padding: 26px 28px 18px; }
	.asp-view[data-view="2"] { justify-content: center; gap: 16px; }
	.asp-view[data-view="2"] .asp-links { margin-top: 8px; }
	.asp .asp-title { font-size: 48px; }
	.asp .asp-sub { font-size: 17px; }
	.asp-tiles { grid-template-columns: repeat(3, 1fr); }
	.asp-peek i { height: 96px; }
	.asp .asp-item { grid-template-columns: 104px 1fr auto; }
	.asp-item img { width: 104px; height: 78px; }
	.asp-item-name { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.asp *, .asp *::after { animation: none !important; transition: none !important; }
}
