
/* =========================================================
   АНИМАЦИИ ЛЕНДИНГА (landing.js → GTL.animate) — по мотивам страниц Huawei.
   Начальные состояния действуют только при .lp-anim-on и только в блоках с data-anim.
   ========================================================= */
:root { --lp-ease: cubic-bezier(.26, .67, .48, .91); --lp-ease-out: cubic-bezier(.16, .84, .3, 1); }

/* Появление снизу с задержкой по порядку (--i) */
.lp-anim-on [data-anim] .lp-fu {
  opacity: 0; transform: translateY(clamp(26px, 4.2vw, 64px));
  transition: opacity .55s ease-in, transform .8s var(--lp-ease);
  transition-delay: calc(var(--i, 0) * 110ms + var(--d, 0ms));
}
.lp-anim-on [data-anim] .lp-fu.lp-pop { transform: translateY(clamp(30px, 4.6vw, 70px)) scale(.955); }
.lp-anim-on [data-anim].animated .lp-fu { opacity: 1; transform: none; }

/* Фото товара на первом экране и в блоке покупки «всплывает» */
.lp-anim-on [data-anim] .lp-rise { opacity: 0; transform: translateY(80px) scale(.94); transition: opacity 1s ease .3s, transform 1.5s var(--lp-ease-out) .3s; }
.lp-anim-on [data-anim].animated .lp-rise { opacity: 1; transform: none; }
.lp-hero-text { will-change: opacity, transform; }
.lp-hero-img, .lp-cover-media { will-change: transform; }

/* Первый экран на всё фото: медленное приближение фона при загрузке */
.lp-anim-on .lp-hero--cover[data-anim] .lp-hero-bg { transform: scale(1.14); transition: transform 2.8s cubic-bezier(.2, .65, .2, 1); }
.lp-anim-on .lp-hero--cover[data-anim].animated .lp-hero-bg { transform: none; }

/* Карусель: лента въезжает справа; активная карточка яркая, соседние приглушены.
   Секция обрезает ленту, пока та сдвинута, — иначе на телефоне страница шире экрана */
section[data-lp="highlights"] { overflow: hidden; }
.lp-anim-on [data-anim] .lp-slidein { opacity: 0; transform: translateX(14vw); transition: opacity .9s ease .1s, transform 1.3s var(--lp-ease-out) .1s; }
.lp-anim-on [data-anim].animated .lp-slidein { opacity: 1; transform: none; }
.lp-hcard { transition: opacity .6s ease, transform .7s var(--lp-ease-out); }
.lp-carousel.is-ready[data-count] .lp-hcard:not(.is-active) { opacity: .42; transform: scale(.955); }
.lp-carousel[data-count="1"] .lp-hcard { opacity: 1 !important; transform: none !important; }
.lp-hcard-body > * { transition: opacity .6s ease .2s, transform .9s var(--lp-ease-out) .2s; }
.lp-hcard-body > *:nth-child(2) { transition-delay: .3s; }
.lp-hcard-body > *:nth-child(3) { transition-delay: .4s; }
.lp-carousel.is-ready .lp-hcard:not(.is-active) .lp-hcard-body > * { opacity: 0; transform: translateX(56px); transition-delay: 0s; }
.lp-carousel[data-count="1"] .lp-hcard .lp-hcard-body > * { opacity: 1 !important; transform: none !important; }
.lp-hcard.is-active .lp-hcard-img { animation: lpKen 7s ease-out backwards; }
@keyframes lpKen { from { transform: scale(1.08); } to { transform: scale(1); } }
/* Полоса прогресса автопрокрутки в активной точке */
.lp-dot { position: relative; overflow: hidden; }
.lp-dot.active.playing::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gold); transform-origin: left center; animation: lpProg var(--dur, 5s) linear forwards; }
@keyframes lpProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Глава: огромное слово выезжает из-под маски, затем по словам проявляется заголовок
   и слова «подпрыгивают» волной */
.lp-chapter-mask { overflow: hidden; padding-bottom: .02em; }
.lp-anim-on .lp-chapter[data-anim] .lp-chapter-word { transform: translateY(105%); transition: transform .9s cubic-bezier(.3, .7, .2, 1); }
.lp-anim-on .lp-chapter[data-anim].animated .lp-chapter-word { transform: none; }
.lp-w { display: inline-block; }
.lp-anim-on .lp-chapter[data-anim] .lp-w { opacity: 0; transform: translateY(.4em); transition: opacity .6s ease, transform .7s var(--lp-ease); transition-delay: calc(.75s + var(--i, 0) * 80ms); }
.lp-anim-on .lp-chapter[data-anim].animated .lp-w { opacity: 1; transform: none; }
.lp-anim-on .lp-chapter[data-anim].animated1 .lp-w { animation: lpJump .7s ease-in-out calc(var(--i, 0) * 80ms) 1; }
@keyframes lpJump { 0%, 100% { transform: none; } 40% { transform: translateY(-.22em); } 70% { transform: translateY(.05em); } }
.lp-chapter h2 .lp-w { background: linear-gradient(105deg, var(--ink) 0%, var(--gold-deep) 55%, var(--ink) 100%); background-size: 200% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-anim-on .lp-chapter[data-anim].animated .lp-w { background-position: 0 0; transition: opacity .6s ease, transform .7s var(--lp-ease), background-position 2.4s ease; transition-delay: calc(.75s + var(--i, 0) * 80ms); }
.lp-bg-dark .lp-chapter h2 .lp-w, .lp-chapter.lp-bg-dark h2 .lp-w { background-image: linear-gradient(105deg, #fff 0%, var(--gold-soft) 55%, #fff 100%); }

/* Фото + цифры: кадр отъезжает с крупного плана (как раздел «тонкий корпус» у Huawei) */
section[data-lp="media"] { overflow: hidden; }
.lp-anim-on [data-anim] .lp-zoomout { transform: scale(1.22); transform-origin: center 12%; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.lp-anim-on [data-anim] .lp-zoomout .lp-media-el { transform: scale(1.12); transition: transform 1.8s cubic-bezier(.2, .7, .2, 1); }
.lp-anim-on [data-anim].animated .lp-zoomout, .lp-anim-on [data-anim].animated .lp-zoomout .lp-media-el { transform: none; }

/* Фото + текст: фото раскрывается из-под маски, затем появляется текст */
.lp-anim-on [data-anim] .lp-clip { clip-path: inset(7% 50% 0 0 round var(--radius-lg)); transition: clip-path 1s var(--lp-ease); }
.lp-anim-on [data-anim] .lp-clip.rev { clip-path: inset(7% 0 0 50% round var(--radius-lg)); }
.lp-anim-on [data-anim].animated .lp-clip { clip-path: inset(0 round var(--radius-lg)); }
.lp-anim-on [data-anim] .lp-clip img, .lp-anim-on [data-anim] .lp-clip video { transform: scale(1.12); transition: transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.lp-anim-on [data-anim].animated .lp-clip img, .lp-anim-on [data-anim].animated .lp-clip video { transform: none; }

/* Цвета: фото раскрывается из узкой щели, образцы разъезжаются от центра */
.lp-anim-on [data-anim] .lp-slit { clip-path: inset(14% 48% round 8px); opacity: .5; transition: clip-path 1.1s cubic-bezier(.65, 0, .35, 1) .1s, opacity .5s ease .1s; }
.lp-anim-on [data-anim].animated .lp-slit { clip-path: inset(0 round var(--radius-lg)); opacity: 1; }
.lp-anim-on [data-anim] .lp-slit img { transform: scale(1.18) rotate(-4deg); transition: transform 1.6s cubic-bezier(.2, .7, .2, 1) .1s, opacity .18s; }
.lp-anim-on [data-anim].animated .lp-slit img { transform: none; }
.lp-anim-on [data-anim] .lp-fan { opacity: 0; transform: translateX(var(--x, 0)) scale(.6); transition: opacity .6s ease, transform 1s var(--lp-ease-out); transition-delay: calc(.7s + var(--i, 0) * 70ms); }
.lp-anim-on [data-anim].animated .lp-fan { opacity: 1; transform: none; }

/* Полноэкранный баннер: фото медленно отдаляется по ходу прокрутки (JS) */
.lp-feature-bg img, .lp-feature-bg video { will-change: transform; }

/* Фото проявляются из размытия по мере загрузки */
.lp-anim-on img.lp-blur { filter: blur(18px); transition: filter .7s ease; }
.lp-anim-on img.lp-blur.is-loaded { filter: none; }

/* Карточки сетки: мягкий подъём при наведении */
.lp-card { transition: box-shadow .4s var(--lp-ease); }
.lp-card:hover { box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  .lp-hcard-img { animation: none !important; }
  .lp-dot.active.playing::after { animation: none; }
}

/* =========================================================
   ПЕРВЫЙ ЭКРАН «КАК У HUAWEI» (layout: kv)
   Фото на всю высоту окна, товар в одной половине кадра, текст — в другой.
   ========================================================= */
.lp-hero--kv { height: clamp(520px, min(calc(100vh - var(--nav-h)), 56vw), 920px); background: var(--cream); color: var(--ink); }
.lp-kv-media { position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow: hidden; }
.lp-kv-right .lp-kv-media { right: 36%; }
.lp-kv-left .lp-kv-media { left: 36%; }
.lp-kv-nofade .lp-kv-media { left: 0; right: 0; }
.lp-kv-media picture { position: absolute; inset: 0; display: block; }
.lp-kv-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Фото растворяется в фоне в сторону текста */
.lp-kv-right:not(.lp-kv-nofade) .lp-kv-img { -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 48%, transparent 100%); mask-image: linear-gradient(90deg, #000 0%, #000 48%, transparent 100%); }
.lp-kv-left:not(.lp-kv-nofade) .lp-kv-img { -webkit-mask-image: linear-gradient(270deg, #000 0%, #000 48%, transparent 100%); mask-image: linear-gradient(270deg, #000 0%, #000 48%, transparent 100%); }
.lp-kv-inner { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.lp-kv-left .lp-kv-inner { justify-content: flex-start; }
.lp-hero--kv .lp-hero-text { width: min(520px, 38%); text-align: center; }
.lp-hero--kv .lp-hero-name { font-family: var(--font-sans); font-weight: 600; font-size: clamp(28px, 2.9vw, 44px); line-height: 1.12; letter-spacing: .005em; margin: 0; }
.lp-hero-logo { display: block; max-width: 100%; max-height: 72px; margin: 0 auto; }
.lp-hero-slogan { margin-top: clamp(14px, 1.6vw, 22px); font-family: var(--font-serif); font-size: clamp(26px, 2.7vw, 40px); line-height: 1.15; }
.lp-hero--kv .lp-hero-sub { margin-top: clamp(12px, 1.4vw, 20px); font-size: clamp(15px, 1.35vw, 19px); }
.lp-hero--kv .lp-hero-price { margin-top: 18px; }
.lp-hero--kv .lp-hero-price .now { font-size: clamp(22px, 2vw, 30px); }
.lp-hero--kv .lp-hero-actions { margin-top: 24px; }
.lp-hero--kv.lp-th-dark { background: #151412; color: #f3efe7; }
.lp-hero--kv.lp-th-dark .lp-hero-sub { color: rgba(243,239,231,.78); }
.lp-hero--kv.lp-th-dark .lp-hero-note { color: rgba(243,239,231,.6); }

/* Вид «поверх фото» с текстом справа */
.lp-al-right .lp-hero-inner { align-items: center; }
.lp-hero--cover.lp-al-right .lp-hero-text { margin-left: auto; margin-right: 0; max-width: 560px; }
.lp-hero--cover.lp-al-right.lp-th-dark::after { background: linear-gradient(270deg, rgba(15,13,11,.62) 0%, rgba(15,13,11,0) 70%); }
/* Вид «на светлом фоне»: фото целиком помещается в первый экран вместе с текстом */
.lp-hero-stage .lp-hero-img { max-height: min(56vh, 640px); }

@media (max-width: 1100px) {
  .lp-kv-right .lp-kv-media { right: 40%; }
  .lp-kv-left .lp-kv-media { left: 40%; }
  .lp-hero--kv .lp-hero-text { width: min(460px, 44%); }
}
/* Телефон: фото сверху, текст под ним — как мобильная версия Huawei */
@media (max-width: 760px) {
  .lp-hero--kv { height: auto; }
  .lp-kv-media, .lp-kv-right .lp-kv-media, .lp-kv-left .lp-kv-media { position: relative; left: 0; right: 0; width: 100%; aspect-ratio: 1 / 1; max-height: 64vh; }
  .lp-kv-right:not(.lp-kv-nofade) .lp-kv-img, .lp-kv-left:not(.lp-kv-nofade) .lp-kv-img, .lp-kv-nofade .lp-kv-img {
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  }
  .lp-kv-inner, .lp-kv-left .lp-kv-inner { height: auto; justify-content: center; margin-top: -32px; padding-bottom: 44px; }
  .lp-hero--kv .lp-hero-text { width: 100%; max-width: 520px; }
}

/* Анимация первого экрана: фото проявляется с лёгким отдалением, текст — каскадом */
.lp-anim-on [data-anim] .lp-kv-in { opacity: 0; transform: scale(1.06); transition: opacity 1.2s ease, transform 2.4s cubic-bezier(.2, .65, .2, 1); }
.lp-anim-on [data-anim].animated .lp-kv-in { opacity: 1; transform: none; }
.lp-kv-img { will-change: transform; }

/* =========================================================
   ПЛАВАЮЩАЯ КАПСУЛА ПОКУПКИ (одна вместо верхней и нижней панелей)
   Компактная, по центру внизу; появляется после первого экрана.
   ========================================================= */
.lp-pill {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 65;
  display: flex; align-items: center; gap: 4px;
  max-width: min(560px, calc(100vw - 24px)); padding: 6px;
  border-radius: 100px; color: #f3efe7;
  background: rgba(24, 22, 19, .8);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none;
  transition: transform .6s cubic-bezier(.2, .9, .25, 1.12), opacity .35s ease;
}
.lp-pill.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.lp-pill-info { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0 12px 0 0; border-radius: 100px; color: inherit; text-align: left; }
.lp-pill-info img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); }
.lp-pill-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.lp-pill-text b { font-size: 13.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.lp-pill-text span { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--gold-soft); }
.lp-pill-link { padding: 10px 14px; border-left: 1px solid rgba(255, 255, 255, .12); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: rgba(243, 239, 231, .7); white-space: nowrap; transition: color .25s; }
.lp-pill-link:hover { color: #fff; }
.lp-pill-buy {
  position: relative; overflow: hidden; flex-shrink: 0; height: 44px; min-width: 126px; padding: 0 24px; border-radius: 100px;
  background: linear-gradient(120deg, var(--gold), var(--gold-deep)); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.lp-pill-buy:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -10px rgba(198, 154, 81, .85); }
.lp-pill-buy-t, .lp-pill-buy-ok { display: grid; place-items: center; transition: transform .35s var(--ease), opacity .35s; }
.lp-pill-buy-ok { position: absolute; inset: 0; background: #3f7d57; transform: translateY(100%); }
.lp-pill-buy.done .lp-pill-buy-ok { transform: none; }
.lp-pill-buy.done .lp-pill-buy-t { opacity: 0; transform: translateY(-60%); }
/* Уведомление «Добавлено в корзину» — над капсулой, а не поверх неё */
.lp-page .toast-wrap { bottom: 92px; right: 50%; transform: translateX(50%); align-items: center; }

@media (max-width: 760px) {
  .lp-pill { bottom: max(12px, env(safe-area-inset-bottom)); }
  .lp-pill-link { display: none; }
  .lp-pill-text b { max-width: 40vw; }
  .lp-pill-info img { width: 38px; height: 38px; }
  .lp-pill-buy { height: 42px; min-width: 112px; padding: 0 18px; }
}
@media (max-width: 360px) { .lp-pill-info img { display: none; } .lp-pill-info { padding-left: 12px; } }
@media (prefers-reduced-motion: reduce) { .lp-pill { transition: opacity .2s ease; } }
