/**
 * Ad reward modal — scoped modal shell + promotion layout.
 * Vanilla JS show/hide (no Bootstrap dependency on pages layout).
 */

/* ---- Modal shell (scoped to #ad-reward-modal) ---- */
.ad-reward-modal-open {
  overflow: hidden;
}

.ad-reward-modal.fade {
  opacity: 0;
  transition: opacity 0.15s linear;
}

.ad-reward-modal.fade.show {
  opacity: 1;
}

.ad-reward-modal.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10050;
  display: none;
  overflow: hidden;
  outline: 0;
}

.ad-reward-modal-open .ad-reward-modal.modal {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
}

.ad-reward-modal .modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}

.ad-reward-modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -25%);
}

.ad-reward-modal.show .modal-dialog {
  transform: translate(0, 0);
}

.ad-reward-modal .modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-clip: padding-box;
  outline: 0;
}

.ad-reward-modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10040;
  background-color: #000;
}

.ad-reward-modal-backdrop.fade {
  opacity: 0;
  transition: opacity 0.15s linear;
}

.ad-reward-modal-backdrop.show {
  opacity: 0.5;
}

.ad-reward-modal .modal-dialog.ad-reward-modal__dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100% - 1rem);
  width: 100%;
  max-width: 100%;
  margin: 30px auto;
}

/* ---- Promotion content ---- */
.ad-reward-modal .modal-dialog.ad-reward-modal__dialog .modal-content.ad-reward-modal__content {
  background: url(/view/static/img/ad_modal/modal_bg.jpg) center/cover no-repeat;
  border: none;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  width: 784px;
  max-width: 100%;
  overflow: visible;
}

.ad-reward-modal__inner {
  padding: 40px;
  color: #fff;
}

.ad-reward-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.ad-reward-modal__badge {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgb(119 55 3);
  font-weight: bold;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}

.ad-reward-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  margin-top: -30px;
}

.ad-reward-modal__dismiss-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  user-select: none;
}

.ad-reward-modal__dismiss-label input[type='checkbox'] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.ad-reward-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ad-reward-modal__close:hover {
  background: rgba(0, 0, 0, 0.5);
}

.ad-reward-modal__close img {
  display: block;
  width: 33px;
  height: 33px;
}

.ad-reward-modal__title {
  margin: 0 0 18px;
  font-size: 32px;
  color: #fff;
  font-weight: normal;
  line-height: 1;
  text-shadow: 0 3px 7px rgba(0, 0, 0, 0.44);
}

.ad-reward-modal__desc {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}

.ad-reward-modal__desc-line {
  flex-shrink: 0;
  width: 4px;
  min-height: 48px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--color-primary, #006b34);
}

.ad-reward-modal__desc p {
  margin: 0;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.ad-reward-modal__goods {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  justify-content: space-between;
}

.ad-reward-modal__goods-item {
  flex: 0 0 153px;
  width: 153px;
  height: 153px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.ad-reward-modal__goods-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-reward-modal__footer {
  display: block;
}

.ad-reward-modal__social {
  min-width: 0;
}

.ad-reward-modal__social-title {
  margin: 0 0 24px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.12em;
}

.ad-reward-modal__footer-row {
  display: flex;
  align-items: flex-end;
  gap: 28px;
}

.ad-reward-modal__footer-row .ad-reward-modal__social-item--telegram {
  flex-shrink: 0;
}

.ad-reward-modal__footer-row .ad-reward-modal__cta {
  flex: 1;
  min-width: 0;
  padding-left: 0;
  padding-right: 28px;
}

.ad-reward-modal__footer-row .ad-reward-modal__cta::before {
  left: auto;
  right: 0;
}

.ad-reward-modal__footer-row .ad-reward-modal__social-icons {
  flex: 0 0 305px;
  max-width: 100%;
  justify-content: center;
}

.ad-reward-modal__social-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ad-reward-modal__social-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ad-reward-modal__social-item:hover {
  transform: translateY(-2px);
}

.ad-reward-modal__social-item img {
  display: block;
}

.ad-reward-modal__gift-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
}

.ad-reward-modal__cta {
  position: relative;
  max-width: 100%;
}

.ad-reward-modal__cta::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 72px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.ad-reward-modal__cta-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
  text-align: center;
}

.ad-reward-modal__cta-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
}

@media screen and (max-width: 767px) {
  .ad-reward-modal .modal-dialog.ad-reward-modal__dialog .modal-content.ad-reward-modal__content {
    background: url(/view/static/img/ad_modal/modal_bg_phone.jpg) center/cover no-repeat;
    margin-bottom: 75px;
  }

  .ad-reward-modal__inner {
    padding: 15px;
  }

  .ad-reward-modal__header {
    flex-wrap: wrap;
    margin-bottom: 15px;
  }

  .ad-reward-modal__badge {
    padding: 6px 10px;
  }

  .ad-reward-modal__header-actions {
    position: absolute;
    bottom: -75px;
    left: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .ad-reward-modal__title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .ad-reward-modal__desc {
    margin-bottom: 15px;
  }

  .ad-reward-modal__desc-line {
    min-height: 54px;
  }

  .ad-reward-modal__desc p {
    font-size: 14px;
    line-height: 1.4;
  }

  .ad-reward-modal__goods {
    margin-bottom: 10px;
  }

  .ad-reward-modal__goods-item {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 10px;
  }

  .ad-reward-modal__footer {
    display: block;
  }

  .ad-reward-modal__footer .ad-reward-modal__social {
    width: 100%;
  }

  .ad-reward-modal__footer .ad-reward-modal__social-title {
    font-size: 12px;
    margin-bottom: 15px;
  }

  .ad-reward-modal__footer-row {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
  }

  .ad-reward-modal__footer-row .ad-reward-modal__cta {
    order: 10;
    flex: 1 1 100%;
    width: 100%;
    padding-right: 0;
    text-align: center;
  }

  .ad-reward-modal__footer-row .ad-reward-modal__social-icons {
    flex: 0 0 auto;
    max-width: none;
    justify-content: flex-end;
  }

  .ad-reward-modal__footer-row .ad-reward-modal__social-item:not(.ad-reward-modal__social-item--telegram) img {
    width: 30px;
    height: 30px;
  }

  .ad-reward-modal__footer-row .ad-reward-modal__social-item--telegram img:not(.ad-reward-modal__gift-badge) {
    width: 50px;
    height: 50px;
  }

  .ad-reward-modal__footer-row .ad-reward-modal__cta-title {
    line-height: 1.2;
    font-size: 12px;
    font-weight: normal;
  }

  .ad-reward-modal__footer-row .ad-reward-modal__cta::before {
    display: none;
  }
}
