/* ============================================================
   Рекламный попап Яндекс — HTML версия
   Подключить к странице: <link rel="stylesheet" href="popup.css">
   ============================================================ */

/* Запрет прокрутки body при открытом попапе */
.yax-noscroll { overflow: hidden !important; }

/* ══════════════════════════════════════════════
   МОДАЛЬНОЕ ОКНО
   ══════════════════════════════════════════════ */
#yax-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}

#yax-modal.open {
  visibility: visible;
  pointer-events: auto;
}

/* Затемнённый фон */
.yax-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .28s ease;
}
#yax-modal.open .yax-overlay { opacity: 1; }

/* Коробка попапа */
.yax-box {
  position: relative;
  width: 100%;
  max-width: 540px;
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  transform: translateY(20px) scale(.96);
  opacity: 0;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .24s ease;
}
#yax-modal.open .yax-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Кнопка закрыть */
.yax-close {
  position: absolute;
  top: -12px; right: -12px;
  z-index: 10;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #333;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  transition: background .15s, transform .15s;
  padding: 0;
}
.yax-close:hover { background: #f5f5f5; transform: scale(1.1); }

/* ══════════════════════════════════════════════
   РЕКЛАМНЫЙ БАННЕР ЯНДЕКС
   ══════════════════════════════════════════════ */
.yax-ad {
  display: block;
  position: relative;
  text-decoration: none;
  background: linear-gradient(115deg, #0f0c29, #302b63, #24243e);
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  transition: filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.yax-ad:hover { filter: brightness(1.10); }

/* Свечение */
.yax-ad__glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 200px 130px at 95% 15%, rgba(252,63,29,.35) 0%, transparent 65%),
    radial-gradient(ellipse 140px 100px at  5% 90%, rgba(80,140,255,.18) 0%, transparent 65%);
}

.yax-ad__body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
}

.yax-ad__logo {
  flex-shrink: 0;
  width: 56px; height: 56px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}

.yax-ad__info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.yax-ad__title {
  font-size: 17px; font-weight: 800; color: #fff;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yax-ad__sub {
  font-size: 12.5px; color: rgba(255,255,255,.55);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.yax-ad__action {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.yax-ad__cta  { font-size: 13.5px; font-weight: 700; color: #FC3F1D; white-space: nowrap; }
.yax-ad__mark {
  font-size: 9px; color: rgba(255,255,255,.28);
  border: 1px solid rgba(255,255,255,.16);
  padding: 1px 6px; border-radius: 3px; letter-spacing: .4px;
}

/* Прогресс-бар (CSS-анимация 10 сек) */
.yax-progress { height: 5px; background: rgba(255,255,255,.10); }
.yax-progress__bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #FC3F1D, #ff7a00);
  transform-origin: left center;
  transform: scaleX(0);
  animation: yax-fill 10s linear forwards;
}
@keyframes yax-fill { from{transform:scaleX(0)} to{transform:scaleX(1)} }

/* ══════════════════════════════════════════════
   КНОПКА СКАЧАТЬ В ПОПАПЕ
   ══════════════════════════════════════════════ */
.yax-dl {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 17px 22px;
  border-radius: 0 0 14px 14px;
  transition: filter .2s, transform .15s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Заблокирована */
.yax-dl.locked {
  background: #2e2e2e;
  color: rgba(255,255,255,.40);
  pointer-events: none;
  cursor: not-allowed;
}

/* Активна */
.yax-dl:not(.locked) {
  background: linear-gradient(135deg, #FC3F1D 0%, #d9340d 100%);
  color: #fff;
  box-shadow: 0 6px 26px rgba(252,63,29,.44);
  animation: yax-btn-on .35s cubic-bezier(.34,1.56,.64,1) forwards;
  cursor: pointer;
}
.yax-dl:not(.locked):hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(252,63,29,.55);
  color: #fff; text-decoration: none;
}
.yax-dl:not(.locked):active { transform: translateY(0); }

@keyframes yax-btn-on {
  from { transform: scale(.96); opacity: .6; }
  to   { transform: scale(1);   opacity: 1; }
}

.yax-dl svg { flex-shrink: 0; }
.yax-dl__text { flex: 1; }
.yax-dl__lock { font-size: 16px; opacity: .45; }

/* ══════════════════════════════════════════════
   СТИЛИ КНОПКИ СКАЧИВАНИЯ НА СТРАНИЦЕ
   (опционально — можно заменить своими стилями)
   ══════════════════════════════════════════════ */
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FC3F1D, #d9340d);
  color: #fff;
  text-decoration: none;
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: 50px;
  box-shadow: 0 4px 18px rgba(252,63,29,.38);
  transition: transform .18s, box-shadow .18s, filter .18s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.download-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(252,63,29,.50);
  color: #fff; text-decoration: none;
}
.download-button:active { transform: translateY(0); }

/* ── Мобильный адаптив ── */
@media (max-width: 480px) {
  .yax-ad__body  { padding: 15px 14px; gap: 10px; }
  .yax-ad__logo  { width: 46px; height: 46px; border-radius: 10px; }
  .yax-ad__logo svg { width: 34px; height: 34px; }
  .yax-ad__title { font-size: 15px; }
  .yax-ad__sub   { font-size: 11px; }
  .yax-ad__action { display: none; }
  .yax-dl        { font-size: 14px; padding: 15px 16px; gap: 10px; }
  .yax-close     { top: -10px; right: -6px; }
}
@media (max-width: 360px) {
  .yax-ad__sub { display: none; }
}
