/* Попап «Получить подарок» */

.gift-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.gift-popup[hidden] {
  display: none;
}

.gift-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 49, 64, 0.55);
  cursor: pointer;
}

.gift-popup__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.683fr) minmax(0, 1.1fr);
  width: min(100%, 907px);
  max-height: min(90svh, 628px);
  height: 100%;
  overflow: hidden;
  border-radius: 30px;
}

.gift-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.gift-popup__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.gift-popup__close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.gift-popup__media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 6px 18px;
  background: #ffc702;
  box-sizing: border-box;
  border-radius: 30px;
}

.gift-popup__media picture,
.gift-popup__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.gift-popup__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 0;
  padding: 40px 30px 40px;
  text-align: center;
  box-sizing: border-box;
  border-radius: 30px;
  background: #233140;
}

.gift-popup__logo {
  display: block;
  width: 138px;
  height: auto;
  margin: 0 auto 15px;
}

.gift-popup__title {
  margin: 0;
  max-width: 18ch;
  font-family: "Cocomat Pro", sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.625rem);
  line-height: 54.6px;
  color: #ffffff;
}

.gift-popup__text {
  margin: 0;
  max-width: 28ch;
  font-family: "Cocomat Pro", sans-serif;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.4vw, 1.5rem);
  line-height: 1.6;
  color: #ffffff;
  opacity: 0.5;
}

.gift-popup__actions {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: 250px;
  margin-top: 15px;
}

.gift-popup__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: "Cocomat Pro", sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
  color: #ffffff;
  text-decoration: none;
  box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gift-popup__btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  color: #ffffff;
}

.gift-popup__btn--max {
  background: linear-gradient(90deg, #3ABFFD 0%, #3F48EA 50.48%, #994FE1 100%);
}

.gift-popup__btn--telegram {
  background: #28A9EB;
}

.gift-popup__btn--vk {
  background: #2E8AFD;
}

body.gift-popup-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .gift-popup {
    padding: 12px;
  }

  .gift-popup__dialog {
    display: flex;
    flex-direction: column;
    width: min(100%, 420px);
    max-height: min(92svh, 720px);
    border-radius: 30px;
    overflow: hidden; /* Важно: обрезает всё, что вылезает, сохраняя круглые углы */
  }

  .gift-popup__media {
    padding: 20px 20px 0; /* Обнуляем отступ снизу, чтобы кот стоял на черном фоне */
    border-radius: 0;
    align-items: flex-end;
  }

  .gift-popup__media img {
    max-height: 200px;
    margin: 0 auto;
  }

.gift-popup__content {
    gap: 14px;
    padding: 24px 20px 28px;
    border-radius: 0 0 30px 30px; /* Вернули скругление нижних углов */
    margin-top: 0;
  }

  .gift-popup__logo {
    width: 175px; /* Увеличили логотип примерно на 25% от десктопного 138px */
    margin: 0 auto 10px;
  }

  .gift-popup__title {
    max-width: none;
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .gift-popup__text {
    max-width: none;
    font-size: 0.95rem;
  }

  .gift-popup__actions {
    max-width: none;
    margin-top: 4px;
    gap: 10px; /* Расстояние между кнопками уменьшено в 3 раза (было 30px) */
  }

  .gift-popup__btn {
    min-height: 58px;
    font-size: 1rem;
  }

  .gift-popup__close {
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.4); /* Делаем крестик заметнее на желтом фоне */
  }
}
