/* ═══════════════════════════════════════════════════════════════
   popups.css — Всплывающие окна (объявления) на сайте
   Работает поверх переменных style.css (тёмная/светлая темы).
═══════════════════════════════════════════════════════════════ */

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 12, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
  overscroll-behavior: contain;
}

.popup-overlay.popup-visible { opacity: 1; }

.popup-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow: hidden auto;
  background: var(--card-bg, #151A23);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow, 0 8px 32px rgba(0, 0, 0, 0.5));
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.popup-overlay.popup-visible .popup-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.popup-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: cover;
  background: var(--surface-1, #1B212C);
}

.popup-body {
  padding: 20px 20px 22px;
}

.popup-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--txt-primary, rgba(255, 255, 255, 0.95));
}

.popup-text {
  margin: 10px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--txt-secondary, rgba(255, 255, 255, 0.62));
  white-space: pre-line;
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.popup-btn {
  flex: 1 1 auto;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: var(--radius-md, 14px);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition, 0.22s ease), filter var(--transition, 0.22s ease), background var(--transition, 0.22s ease);
}

.popup-btn:active { transform: scale(0.97); }

.popup-btn-primary {
  color: #fff;
  background: var(--accent-grad, linear-gradient(135deg, #3B82F6, #2563EB));
  box-shadow: var(--accent-glow, 0 4px 20px rgba(59, 130, 246, 0.35));
}
.popup-btn-primary:hover { filter: brightness(1.08); }

.popup-btn-secondary {
  color: var(--txt-primary, rgba(255, 255, 255, 0.95));
  background: var(--glass-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.09));
}
.popup-btn-secondary:hover { background: var(--glass-hover, rgba(255, 255, 255, 0.08)); }

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: var(--txt-primary, rgba(255, 255, 255, 0.95));
  background: rgba(11, 14, 20, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background var(--transition, 0.22s ease), transform var(--transition, 0.22s ease);
}
.popup-close:hover { background: rgba(11, 14, 20, 0.78); transform: scale(1.06); }

/* Картинка занимает верх — кнопку закрытия делаем светлее на всякий случай */
.popup-card:has(.popup-img) .popup-close { color: #fff; }

@media (max-width: 480px) {
  .popup-overlay { padding: 14px; align-items: flex-end; }
  .popup-card { max-width: 100%; border-radius: var(--radius-lg, 20px); }
  .popup-img { max-height: 38vh; }
  .popup-body { padding: 16px 16px 18px; }
  .popup-title { font-size: 1.12rem; }
  .popup-btn { min-width: 100%; }
}
