/* =========================================================
   Всплывающее окно с индивидуальным предложением
   Чистый CSS, без JavaScript
   ========================================================= */

/* --- Скрытый чекбокс — управляет показом/скрытием окна --- */

.popup-close-checkbox {
  position: fixed;     /* было absolute */
  top: 0;              /* новая строка */
  left: 0;             /* новая строка */
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* --- Само окно --- */
.offer-popup {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 9999;

  width: 375px;
  max-width: 92%;
  padding: 28px 26px 26px 26px;

  background: #ffffff;
  border-radius: 20px 0 0 20px;
  box-shadow:
    -10px 0 40px rgba(15, 23, 42, 0.15),
    -2px 0 10px rgba(15, 23, 42, 0.06);

  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  overflow: hidden;

  /* Изначально спрятано справа */
  transform: translateY(-50%) translateX(120%);
  opacity: 0;

  /* Появление через 4 секунды после загрузки страницы */
  animation: popup-show 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 4s forwards;
}

@keyframes popup-show {
  from {
    transform: translateY(-50%) translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }
}

/* --- Закрытие: когда чекбокс отмечен --- */
.popup-close-checkbox:checked ~ .offer-popup {
  animation: popup-hide 0.45s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

@keyframes popup-hide {
  from {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }
  to {
    transform: translateY(-50%) translateX(120%);
    opacity: 0;
  }
}

/* --- Декоративная градиентная полоса слева: золото → тёмное золото --- */
.offer-popup::before {
    height: 100%;
    border-radius: 20px 0 0 20px;
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background-image: repeating-linear-gradient(to bottom, #333333 0px, #343434 10px, #ffe46d 10px, #fed23e 20px);

}

/* --- Мягкое тёплое свечение в правом верхнем углу --- */
.offer-popup::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 194, 7, 0.20), transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

/* --- Заголовок --- */
.offer-popup__title {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 12px 8px;
  line-height: 1.35;
  padding-right: 30px;
}

/* --- Основной текст --- */
.offer-popup__text {
  position: relative;
  z-index: 1;
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 20px 8px;
}

/* --- Ссылка на email --- */
.offer-popup__text a {
  color: #007fcc;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px dashed rgb(7 168 255 / 40%);
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.offer-popup__text a:hover {
  color: #0d90df;
  border-bottom-color: #ffc207;
}

/* --- Кнопка: золотой градиент, чёткая рамка, тёмный текст --- */
.offer-popup__button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  width: calc(100% - 10%);
  margin-left: 8px;
  padding: 13px 21px;

  background: linear-gradient(358deg, #eeb400 0%, #ffe365 100%);
  color: #1e293b;
  border: 1px solid #d2a71e;
  border-radius: 5px;

  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;

  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);

  transition: transform 0.25s ease, box-shadow 0.3s ease, filter 0.25s ease;
}

.offer-popup__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
  filter: brightness(1.04);
  border-bottom: 0px;
}

.offer-popup__button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  filter: brightness(0.98);
}

.offer-popup__button svg {
  flex-shrink: 0;
  fill: currentColor;
}

/* --- Пульсирующая зелёная точка на кнопке --- */
.offer-popup__button::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: #ff3636;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgb(218 87 87 / 75%);

  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(218, 87, 87, 0.75); }
  70%  { box-shadow: 0 0 0 10px rgba(162, 218, 87, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(162, 218, 87, 0);   }
}

/* --- Кнопка закрытия «×» (label для чекбокса) --- */
.offer-popup__close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;

  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;

  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  user-select: none;

  transition: color 0.2s ease, background 0.2s ease, transform 0.25s ease;
}
.offer-popup__close:hover {
  color: #b8860b;
  background: #fff7e0;
  transform: rotate(90deg);
}

/* --- Каскадное появление содержимого после выезда окна --- */
.offer-popup__title,
.offer-popup__text,
.offer-popup__button {
  opacity: 0;
  animation: content-fade 0.5s ease 4.4s forwards;
}
.offer-popup__text   { animation-delay: 4.55s; }
.offer-popup__button { animation-delay: 4.7s; }

@keyframes content-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Уважение к настройкам «уменьшить движение» --- */
@media (prefers-reduced-motion: reduce) {
  .offer-popup,
  .offer-popup__title,
  .offer-popup__text,
  .offer-popup__button,
  .offer-popup__button::after,
  .popup-close-checkbox:checked ~ .offer-popup {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
  .offer-popup {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    animation: none;
  }
  .offer-popup__title,
  .offer-popup__text,
  .offer-popup__button { opacity: 1; }
}

/* --- Мобильная версия: окно выезжает снизу --- */
@media (max-width: 520px) {
  .offer-popup {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: calc(100% - 10%);
    max-width: 100%;
    border-radius: 0px;
    padding: 26px 22px 22px;
    transform: translateY(120%);
    animation: popup-show-mobile 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 4s forwards;
  }

  @keyframes popup-show-mobile {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .popup-close-checkbox:checked ~ .offer-popup {
    animation: popup-hide-mobile 0.45s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
  }

  @keyframes popup-hide-mobile {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(120%); opacity: 0; }
  }

  .offer-popup::before {
    width: 100%;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, #ffc207 0%, #d2a71e 100%);
  }

  .offer-popup__title,
  .offer-popup__text,
  .offer-popup__button { margin-left: 0; }

  .offer-popup__button { width: 90%; }
}