/* ============================================================
   androidhappy.ru — Рекламный попап Яндекс
   Подключён только на странице полной новости [aviable=showfull]
   ============================================================ */

.yax-noscroll { overflow: hidden !important; }

/* ── Модальное окно ── */
#yax-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}
#yax-modal.yax-open {
  visibility: visible;
  pointer-events: auto;
}

/* Затемнённый фон */
.yax-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .28s ease;
}
#yax-modal.yax-open .yax-overlay { opacity: 1; }

/* Коробка */
.yax-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  transform: translateY(22px) scale(.95);
  opacity: 0;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease;
}
#yax-modal.yax-open .yax-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Кнопка закрыть */
#yax-modal .yax-close {
  all: unset !important;
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  z-index: 20 !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.18) !important;
  border: 1.5px solid rgba(255,255,255,.35) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  box-shadow: none !important;
  transition: background .15s, transform .15s !important;
  padding: 0 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  font-size: 0 !important;
}
#yax-modal .yax-close::before,
#yax-modal .yax-close::after {
  content: '' !important;
  position: absolute !important;
  width: 13px !important;
  height: 2px !important;
  background: #fff !important;
  border-radius: 2px !important;
}
#yax-modal .yax-close::before { transform: rotate(45deg) !important; }
#yax-modal .yax-close::after  { transform: rotate(-45deg) !important; }
#yax-modal .yax-close:hover {
  background: rgba(255,255,255,.32) !important;
  transform: scale(1.12) !important;
}
#yax-modal .yax-close svg { display: none !important; }

/* ── Рекламный баннер Яндекс ── */
.yax-ad {
  display: block;
  position: relative;
  text-decoration: none !important;
  background: linear-gradient(115deg, #0f0c29, #302b63, #24243e);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: filter .2s;
}
.yax-ad:hover { filter: brightness(1.1); }

.yax-ad__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 200px 130px at 93% 18%, rgba(252, 63, 29, .35) 0%, transparent 65%),
    radial-gradient(ellipse 150px 100px at  5% 88%, rgba(80, 140, 255, .18) 0%, transparent 65%);
}

.yax-ad__body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
}

.yax-ad__logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yax-ad__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.yax-ad__title {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #fff !important;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 !important;
  text-shadow: none !important;
}
.yax-ad__sub {
  font-size: 12px;
  color: rgba(255, 255, 255, .55) !important;
  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: 5px;
}
.yax-ad__cta  { font-size: 13px; font-weight: 700; color: #FC3F1D !important; white-space: nowrap; }
.yax-ad__mark {
  font-size: 9px;
  color: rgba(255, 255, 255, .28) !important;
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 1px 5px;
  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 !important;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 20px;
  transition: filter .2s, transform .15s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Заблокирована */
.yax-dl.yax-dl-locked {
  background: #2a2a2a !important;
  color: rgba(255, 255, 255, .38) !important;
  pointer-events: none;
  cursor: not-allowed;
}

/* Активна */
.yax-dl.yax-dl-ready {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
  color: #fff !important;
  box-shadow: 0 5px 22px rgba(46, 204, 113, .45);
  animation: yax-btn-on .35s cubic-bezier(.34, 1.56, .64, 1) forwards;
  cursor: pointer;
}
.yax-dl.yax-dl-ready:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 9px 28px rgba(46, 204, 113, .55) !important;
  color: #fff !important;
  text-decoration: none !important;
}
.yax-dl.yax-dl-ready:active { transform: translateY(0); }

@keyframes yax-btn-on {
  from { transform: scale(.96); opacity: .6; }
  to   { transform: scale(1);   opacity: 1;  }
}

.yax-dl__icon { font-size: 20px; flex-shrink: 0; }
.yax-dl__text { flex: 1; line-height: 1.3; }
.yax-dl__lock { font-size: 14px; opacity: .45; }

/* ── Мобильный адаптив ── */
@media screen and (max-width: 480px) {
  .yax-ad__body    { padding: 14px 13px; gap: 10px; }
  .yax-ad__logo    { width: 44px; height: 44px; border-radius: 10px; }
  .yax-ad__logo svg { width: 32px; height: 32px; }
  .yax-ad__title   { font-size: 14px !important; }
  .yax-ad__sub     { font-size: 11px; }
  .yax-ad__action  { display: none; }
  .yax-dl          { font-size: 14px; padding: 14px 15px; gap: 9px; }
  .yax-close       { top: -9px; right: -6px; }
}
@media screen and (max-width: 360px) {
  .yax-ad__sub { display: none; }
}
