.sft-promo {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.sft-promo[hidden] {
  display: none !important;
}

.sft-promo__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.72);
}

.sft-promo__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: min(560px, 100%);
  max-height: min(92vh, 920px);
  height: auto;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  padding: 6px;
  box-sizing: border-box;
  animation: sft-promo-in 0.28s ease-out;
}

@keyframes sft-promo-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sft-promo__close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  color: #111;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.sft-promo__close:hover {
  background: #fff;
}

.sft-promo__panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
}

.sft-promo__panel[hidden] {
  display: none !important;
}

.sft-promo__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sft-promo__image-wrap {
  display: block;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.sft-promo__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(548px, calc(100vw - 28px));
  max-height: calc(92vh - 100px);
  object-fit: contain;
}

.sft-promo__footer {
  flex: 0 0 auto;
  margin-top: 6px;
  background: #fff;
  width: 100%;
}

.sft-promo__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.sft-promo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

.sft-promo__btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.sft-promo__btn--wa {
  background: #25d366;
  color: #fff !important;
}

.sft-promo__btn--tg {
  background: #229ed9;
  color: #fff !important;
}

.sft-promo__btn--form {
  background: #c8161d;
  color: #fff !important;
}

.sft-promo__mute {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: #555;
  user-select: none;
}

@media (max-width: 720px) {
  .sft-promo {
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .sft-promo__dialog {
    width: fit-content;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  }

  .sft-promo__image {
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 140px);
  }

  .sft-promo__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .sft-promo__btn {
    min-height: 36px;
    font-size: 11px;
    padding: 6px 4px;
  }
}

@media (max-width: 380px) {
  .sft-promo__btn {
    font-size: 10px;
    min-height: 34px;
    padding: 5px 2px;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .sft-promo__image {
    max-height: calc(100dvh - 96px);
  }

  .sft-promo__btn {
    min-height: 30px;
    font-size: 10px;
  }
}
