/* Зум-лайтбокс + автокарусель скриншотов на лендингах. Подключается на всех
   статических лендингах и в Landing.tsx. Селекторы класс-ориентированные, чтобы
   работать и с <figure> (статика), и с <div>/MUI Card (SPA). Виджет вешает .zw-fig. */

.zw-fig { position: relative; }
.zw-fig img { cursor: zoom-in; }

/* Лупа при наведении */
.zw-mag {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(15,23,42,.60); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  opacity: 0; transform: scale(.75); transition: opacity .18s ease, transform .18s ease;
  pointer-events: none; z-index: 4; box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.zw-fig:hover .zw-mag { opacity: 1; transform: scale(1); }

/* Плавная смена большого кадра (карусель) */
.browser.zw-fig img { transition: opacity .45s ease; }
.browser.zw-fading img { opacity: 0; }

/* Активная миниатюра */
.shot-card.zw-fig { transition: outline-color .2s ease; }
.shot-card.zw-active { outline: 2px solid var(--brand, #2563eb); outline-offset: 2px; }

/* Лайтбокс */
.zw-lb {
  position: fixed; inset: 0; z-index: 99999; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(2,6,23,.87); opacity: 0; transition: opacity .22s ease;
}
.zw-lb.zw-open { opacity: 1; }
.zw-lb img {
  max-width: min(1200px, 94vw); max-height: 88vh; width: auto; height: auto;
  border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.55); background: #fff;
}
.zw-lb .zw-cap {
  position: absolute; left: 0; right: 0; bottom: 20px; text-align: center;
  color: #e2e8f0; font-size: 14px; padding: 0 16px; pointer-events: none;
}
.zw-lb button {
  position: absolute; background: rgba(255,255,255,.14); color: #fff; border: none;
  border-radius: 50%; width: 46px; height: 46px; font-size: 24px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.zw-lb button:hover { background: rgba(255,255,255,.28); }
.zw-lb .zw-close { top: 20px; right: 20px; }
.zw-lb .zw-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.zw-lb .zw-next { right: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 620px) {
  .zw-lb .zw-prev, .zw-lb .zw-next { top: auto; bottom: 22px; transform: none; }
  .zw-lb .zw-prev { left: calc(50% - 58px); }
  .zw-lb .zw-next { right: calc(50% - 58px); }
}
@media (prefers-reduced-motion: reduce) {
  .browser.zw-fig img { transition: none; }
  .zw-lb { transition: none; }
}
