/* OPTIK61 motion: живость сайта (этап 10, C1 и C4). Владелец — design-marketer.
   Всё движение — под html.o61-motion (класс ставит motion.js): без JS страница статична и полностью видна.
   Анимируем только transform и opacity. Движение у всех: prefers-reduced-motion не учитываем (слово Игоря). */

/* ---------- служебное ---------- */
.o61-mo-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- C4: появление секций ---------- */
html.o61-motion .o61-mo-rv { opacity: 0; transform: translateY(16px); }
html.o61-motion .o61-mo-rv.is-in { opacity: 1; transform: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }

/* ---------- C4: нажатие и загрузка ---------- */
html.o61-motion .o61-btn:not(:disabled):not(.is-loading):active { transform: scale(.98); transition-duration: .06s; }
html.o61-motion .o61-dc:active, html.o61-motion .o61-chip:active, html.o61-motion .o61-hact:active, html.o61-motion .o61-mbar__b:active { transform: scale(.96); }
.o61-mo-busy { pointer-events: none; cursor: progress; }
html.o61-motion .o61-mo-busy { animation: o61-mo-busy .9s var(--ease) infinite alternate; }
@keyframes o61-mo-busy { to { opacity: .62; } }

/* ---------- C4: тосты уходят плавно ---------- */
html.o61-motion .o61-toast.o61-mo-out, html.o61-motion .o61h-toast.o61-mo-out { opacity: 0; transform: translateY(-8px); transition: opacity .3s var(--ease), transform .3s var(--ease); }

/* ---------- C3: меню «Каталог товаров» и кабинета раскрываются ---------- */
html.o61-motion .o61-catwrap.is-open .o61-catpanel { transform-origin: 24px 0; animation: o61-mo-panel .26s cubic-bezier(.2, .8, .2, 1) both; }
html.o61-motion .o61-catwrap.is-open .o61-catpanel__list > li { animation: o61-mo-item .32s var(--ease) both; }
html.o61-motion .o61-catwrap.is-open .o61-catpanel__list > li:nth-child(2) { animation-delay: 30ms; }
html.o61-motion .o61-catwrap.is-open .o61-catpanel__list > li:nth-child(3) { animation-delay: 60ms; }
html.o61-motion .o61-catwrap.is-open .o61-catpanel__list > li:nth-child(4) { animation-delay: 90ms; }
html.o61-motion .o61-catwrap.is-open .o61-catpanel__list > li:nth-child(5) { animation-delay: 120ms; }
html.o61-motion .o61-catwrap.is-open .o61-catpanel__list > li:nth-child(n+6) { animation-delay: 150ms; }
@keyframes o61-mo-panel { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes o61-mo-item { from { opacity: 0; transform: translateY(6px); } }

/* ---------- C3: липкая шапка телефона после прокрутки — глубже тень, логотип компактнее (без смены высоты) ---------- */
@media (max-width: 991px) {
  html.o61-motion .o61-header { transition: box-shadow .25s var(--ease); }
  html.o61-motion.o61-mo-scrolled .o61-header { box-shadow: 0 1px 0 var(--line), 0 10px 24px -16px rgba(10, 27, 61, .45); }
  html.o61-motion .o61-header .o61-logo { transform-origin: 0 50%; transition: transform .25s var(--ease); }
  html.o61-motion.o61-mo-scrolled .o61-header .o61-logo { transform: scale(.9); }
}

/* ---------- C1: перелёт товара в корзину ---------- */
.o61-mo-fly { position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; will-change: transform; }
.o61-mo-fly__y { will-change: transform; }
.o61-mo-fly__card { border-radius: 14px; background: #fff; box-shadow: 0 18px 36px -14px rgba(6, 18, 41, .55), 0 0 0 1px rgba(10, 27, 61, .08); overflow: hidden; will-change: transform, opacity; }
.o61-mo-fly__card img { display: block; width: 100%; height: 100%; object-fit: contain; }
.o61-mo-fly__card.is-dot { border-radius: 50%; background: var(--g-gold); }

/* корзина ловит товар */
html.o61-motion .o61-cartw.o61-mo-catch .o61-cartw__ico { animation: o61-mo-catch .5s cubic-bezier(.3, 1.6, .5, 1); }
html.o61-motion .o61-cartw.o61-mo-catch .o61-cartw__badge { animation: o61-mo-badge .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes o61-mo-catch { 30% { transform: scale(1.28) rotate(-8deg); } 60% { transform: scale(.94); } }
@keyframes o61-mo-badge { 0% { transform: scale(.4); } 55% { transform: scale(1.3); } }

/* сумма докручивается */
.o61-cartw__sum.o61-mo-ticking { font-variant-numeric: tabular-nums; }

/* док: корзина выезжает справа, если шапку не видно */
.o61-mo-dock.o61-cartw { position: fixed; top: 14px; right: 14px; z-index: 96; box-shadow: 0 22px 44px -18px rgba(6, 18, 41, .6), 0 0 0 1px rgba(255, 255, 255, .06); transform: translateX(calc(100% + 40px)); visibility: hidden; transition: transform .38s cubic-bezier(.2, .9, .2, 1), visibility 0s linear .38s, background .16s var(--ease); text-decoration: none; }
.o61-mo-dock.o61-cartw.is-on { transform: none; visibility: visible; transition: transform .38s cubic-bezier(.2, .9, .2, 1), visibility 0s, background .16s var(--ease); }
.o61-mo-dock.o61-cartw--bar { height: 56px; min-width: 200px; }

/* минимум набран: золотое кольцо, блик и подпись — один раз */
.o61-mo-glow { position: absolute; inset: -4px; border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 2px var(--gold-400), 0 0 26px 2px rgba(242, 193, 78, .55); opacity: 0; animation: o61-mo-glow 1.6s var(--ease) both; overflow: hidden; }
.o61-mo-glow i { position: absolute; top: 4px; bottom: 4px; left: 4px; width: 45%; border-radius: 14px; background: linear-gradient(105deg, transparent 10%, rgba(255, 233, 170, .5) 50%, transparent 90%); transform: translateX(-110%); animation: o61-mo-sheen 1.1s .15s var(--ease) both; }
@keyframes o61-mo-glow { 0% { opacity: 0; transform: scale(.96); } 25% { opacity: 1; transform: scale(1.03); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.02); } }
@keyframes o61-mo-sheen { to { transform: translateX(240%); } }
.o61-mo-ok { position: absolute; right: 0; top: calc(100% + 10px); z-index: 3; display: block; padding: 8px 12px; border-radius: 10px; background: var(--g-gold); color: var(--navy-950); box-shadow: var(--sh-gold), 0 14px 26px -14px rgba(6, 18, 41, .6); font: 700 13px/1.2 var(--f-ui); white-space: nowrap; pointer-events: none; animation: o61-mo-ok .42s cubic-bezier(.2, 1.4, .4, 1) both; }
.o61-mo-ok::before { content: ""; position: absolute; right: 26px; top: -5px; width: 10px; height: 10px; background: #FADF8F; transform: rotate(45deg); border-radius: 2px; }
.o61-mo-ok b { font-weight: 800; }
.o61-mo-ok.is-out { opacity: 0; transform: translateY(-4px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
@keyframes o61-mo-ok { from { opacity: 0; transform: translateY(-8px) scale(.94); } }
.o61-cartw--bar .o61-mo-ok { top: auto; bottom: calc(100% + 10px); right: 4px; }
.o61-cartw--bar .o61-mo-ok::before { top: auto; bottom: -5px; background: #E9AE38; }
.o61-cartw--bar .o61-mo-ok__s { display: none; }

@media print { .o61-mo-fly, .o61-mo-dock, .o61-mo-ok, .o61-mo-glow { display: none !important; } }

/* телефон, карточка: итог матрицы ловит товар и вспыхивает вместо нижней панели */
html.o61-motion .o61-sum.o61-mo-catch .o61-sum__money { animation: o61-mo-sum .5s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 0 60%; }
@keyframes o61-mo-sum { 35% { transform: scale(1.08); } }
.o61-sum > .o61-mo-glow { border-radius: 24px; }
.o61-sum > .o61-mo-ok { top: auto; bottom: calc(100% + 10px); right: 12px; }
.o61-sum > .o61-mo-ok::before { top: auto; bottom: -5px; background: #E9AE38; }
