/*
 * Всплывающий баннер «У нас новый адрес».
 * Открывается автоматически при первом визите, показывается один раз
 * (localStorage). Активно до 10.06.2026 (см. условие в header_new.php).
 *
 * После 10.06 этот файл можно удалить вместе с new-address-popup.js
 * и блоком HTML в header_new.php.
 */

.new-address-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* плавное появление при первом показе */
  animation: nap-fade-in 0.25s ease-out;
}

.new-address-popup[hidden] {
  display: none !important;
}

.new-address-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.new-address-popup__dialog {
  position: relative;
  max-width: min(90vw, 760px);
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  /* лёгкое появление сверху */
  animation: nap-slide-up 0.3s ease-out;
}

.new-address-popup__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #242c6e;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease;
}

.new-address-popup__close:hover,
.new-address-popup__close:focus {
  background: #fff;
  outline: 2px solid #242c6e;
  outline-offset: 2px;
}

.new-address-popup__link {
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.new-address-popup__link:focus-visible {
  outline: 3px solid #242c6e;
  outline-offset: -3px;
}

.new-address-popup__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
}

@keyframes nap-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes nap-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* На узких экранах прячем белый фон диалога — картинка ложится
   прямо на полупрозрачный backdrop, чтобы сверху/снизу не было
   видно белых полос рядом с картинкой. */
@media (max-width: 480px) {
  .new-address-popup__dialog {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: 100vw;
  }
}

/* Уважение к prefers-reduced-motion — выключаем анимации */
@media (prefers-reduced-motion: reduce) {
  .new-address-popup,
  .new-address-popup__dialog {
    animation: none;
  }
}
