/**
 * Bonus Talep (iframe embed) — zümrüt kabuk.
 * Mobil: tam ekran, flex zinciri (taşma yok); içerik kaydı iframe içindeki .wrap’te.
 */

/* ----- Overlay (embed açıkken) — promosyon modalı ile aynı zemin / z-index ----- */
#bonus-detail-modal-overlay.bonus-modal-overlay--embed.bonus-modal-overlay {
  z-index: 1060;
  background: rgba(7, 15, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ----- Kabuk ----- */
#bonus-detail-modal.bonus-modal.is-embed-mode {
  background: linear-gradient(
    165deg,
    rgba(21, 61, 30, 0.95) 0%,
    #0f1f17 42%,
    #0b1511 100%
  );
  color: #e8e8e8;
  border: 1px solid rgba(47, 132, 68, 0.5);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-title {
  color: #f1f5f4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-close,
#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back {
  color: rgba(232, 232, 232, 0.92);
}

#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-close:hover,
#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-close:focus-visible,
#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back:hover,
#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back:focus-visible {
  color: #fff;
  background: rgba(47, 132, 68, 0.32);
}

#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back-icon {
  fill: currentColor;
}

/* Mobil şablonda kapat X gizleniyor — embed’de mutlaka göster */
body.mobile-site #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-close {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

body.mobile-site #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back {
  display: inline-flex !important;
  background: rgba(255, 255, 255, 0.08);
  color: #ecfdf5;
  border: 1px solid rgba(47, 132, 68, 0.45);
}

body.mobile-site #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back:hover,
body.mobile-site #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back:focus-visible {
  background: rgba(47, 132, 68, 0.35);
  color: #fff;
}

#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-host {
  background: rgba(11, 21, 17, 0.9);
  border: 1px solid rgba(47, 132, 68, 0.38);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-iframe {
  background: #f8faf9;
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  width: 100%;
}

/* ========== Masaüstü: promosyon kodu modalı ile aynı kart (hero + gövde, 420px) ========== */
@media (min-width: 768px) {
  #bonus-detail-modal-overlay.bonus-modal-overlay--embed.bonus-modal-overlay {
    padding: 20px;
    align-items: center;
    justify-content: center;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  #bonus-detail-modal-overlay.bonus-modal-overlay--embed .bonus-modal-close {
    color: rgba(232, 232, 232, 0.92);
    top: 10px;
    right: 12px;
  }

  #bonus-detail-modal-overlay.bonus-modal-overlay--embed .bonus-modal-close:hover,
  #bonus-detail-modal-overlay.bonus-modal-overlay--embed .bonus-modal-close:focus-visible {
    color: #fff;
    background: rgba(47, 132, 68, 0.35);
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode {
    width: min(100%, calc(100vw - 40px));
    max-width: min(420px, calc(100vw - 40px));
    max-height: min(92dvh, 92vh);
    min-height: 0;
    margin: auto;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
  }

  /* promosyon modalı .promo-code-modal__hero ile aynı düzen */
  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-header {
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 22px 18px;
    gap: 0;
    background: linear-gradient(180deg, rgba(4, 120, 87, 0.35) 0%, rgba(11, 21, 17, 0.2) 100%);
    border-bottom: 1px solid rgba(47, 132, 68, 0.28);
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back {
    position: absolute;
    left: 10px;
    top: 22px;
    transform: none;
    margin: 0;
    z-index: 2;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-title.promo-code-modal__title {
    margin: 0 0 8px;
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
    background: rgba(11, 21, 17, 0.72);
    overflow: hidden;
    grid-template-columns: 1fr;
    align-content: stretch;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-host {
    flex: 1 1 auto;
    min-height: min(48vh, 380px);
    max-height: none;
    border-radius: 12px;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(47, 132, 68, 0.42);
    box-shadow: none;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-iframe {
    flex: 1 1 auto;
    min-height: min(44vh, 340px);
    height: 100%;
    width: 100%;
    border: 0;
    border-radius: 10px;
  }
}

/* ========== Mobil: tam ekran, taşma yok (kaydırma iframe içi) ========== */
@media (max-width: 767px) {
  #bonus-detail-modal-overlay.bonus-modal-overlay--embed.bonus-modal-overlay {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    max-height: 100vh;
    max-height: 100dvh;
    max-height: -webkit-fill-available;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode {
    width: 100%;
    max-width: none;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: 10px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(21, 61, 30, 0.88) 0%, rgba(11, 21, 17, 0.82) 100%);
    border-bottom: 1px solid rgba(47, 132, 68, 0.28);
  }

  /* Mobil tam ekranda promosyon kartındaki rozet / lead kullanılmıyor */
  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-only {
    display: none !important;
  }

  /* Kapat (absolute) — çentik / status bar ile hizalı; m. şablonda gizlenmesin */
  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    top: max(8px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.08);
    color: #ecfdf5;
    border: 1px solid rgba(47, 132, 68, 0.45);
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back:hover,
  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-back:focus-visible {
    background: rgba(47, 132, 68, 0.35);
    color: #fff;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding-right: max(44px, calc(36px + env(safe-area-inset-right, 0px)));
    font-size: clamp(0.7rem, 3.2vw, 0.8125rem);
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    /* safe-area yalnız iframe içi .wrap’te — çift boşluk / taşma olmasın */
    overflow: hidden;
    grid-template-columns: 1fr;
    background: rgba(11, 21, 17, 0.65);
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-host {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(47, 132, 68, 0.35);
    margin: 0;
    padding: 0;
  }

  #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-iframe {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
  }
}

/*
 * m. şablonu: .bonus-modal-overlay promo sheet (top bar altı) ile başlar.
 * Embed tam ekran olmalı; aksi halde min-height: 100dvh ile alt taşma oluşur.
 */
body.mobile-site #bonus-detail-modal-overlay.bonus-modal-overlay--embed.bonus-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0 !important;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  max-height: 100dvh;
  max-height: -webkit-fill-available;
  overflow: hidden;
  z-index: 1060;
}

body.mobile-site #bonus-detail-modal.bonus-modal.is-embed-mode {
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

body.mobile-site #bonus-detail-modal.bonus-modal.is-embed-mode .bonus-modal-embed-host {
  max-height: none;
}
