.promo-popup-widget {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 12;
}

.promo-popup__trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  background-color: #455268;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.promo-popup__trigger--visible {
  display: inline-flex;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.promo-popup__trigger--hidden {
  display: none !important;
}

.promo-popup__trigger-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  pointer-events: none;
}

.promo-popup__trigger:hover,
.promo-popup__trigger:focus {
  background-color: #3a4558;
}

.promo-popup {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  box-sizing: border-box;
  width: min(380px, calc(100vw - 24px));
  max-height: min(85vh, 520px);
  padding: 18px 18px 14px;
  color: #fff;
  font-family: inherit;
  background-color: #455268;
  border-radius: 2px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  will-change: opacity, transform;
}

.promo-popup--visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

.promo-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.promo-popup__close.icon-close::before {
  margin: 0;
  font-size: 12px;
  line-height: 1;
}

.promo-popup__close:hover,
.promo-popup__close:focus,
.promo-popup__close:hover::before,
.promo-popup__close:focus::before {
  color: #fff;
}

.promo-popup__inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.promo-popup__title {
  margin: 0 24px 6px 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.promo-popup__text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.promo-popup__list {
  flex: 1 1 auto;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.promo-popup__item {
  margin: 0 0 8px;
}

.promo-popup__item:last-child {
  margin-bottom: 0;
}

.promo-popup__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.promo-popup__link:hover,
.promo-popup__link:focus {
  opacity: 0.85;
}

.promo-popup__thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}

.promo-popup__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-popup__name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.promo-popup__all.button--default {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 10px 20px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .promo-popup-widget {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .promo-popup__trigger {
    width: 48px;
    height: 48px;
  }

  .promo-popup__trigger-icon {
    width: 20px;
    height: 20px;
  }

  .promo-popup {
    right: 0;
    bottom: 0;
    width: min(300px, calc(100vw - 20px));
    max-height: min(52vh, 360px);
    padding: 12px 12px 10px;
    border-radius: 4px;
    transform: translate3d(0, 12px, 0);
    transform-origin: right bottom;
  }

  .promo-popup--visible {
    transform: translate3d(0, 0, 0);
  }

  .promo-popup__title {
    margin: 0 20px 4px 0;
    font-size: 13px;
  }

  .promo-popup__text {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.4;
  }

  .promo-popup__list {
    margin: 0 0 10px;
    max-height: 28vh;
  }

  .promo-popup__item {
    margin: 0 0 6px;
  }

  .promo-popup__link {
    gap: 8px;
    padding: 4px 0;
  }

  .promo-popup__thumb {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

  .promo-popup__name {
    font-size: 10px;
    line-height: 1.3;
  }

  .promo-popup__all.button--default {
    padding: 7px 14px;
    font-size: 10px;
  }

  .promo-popup__close {
    top: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
  }

  .promo-popup__close.icon-close::before {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-popup,
  .promo-popup__trigger {
    transition: none;
  }
}
