/* CTA پاپ‌اوت — بنر مشاوره‌ای با تصویر بیرون‌زده */
.hpb-popout-cta {
  direction: rtl;
  /* فضا برای بیرون‌زدگی تصویر از بالا */
  padding: 48px 0 40px;
  overflow: visible;
}

.hpb-popout-cta .crafto-container {
  overflow: visible;
}

.hpb-popout-cta__shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.75fr);
  align-items: end;
  min-height: 220px;
  overflow: visible;
}

.hpb-popout-cta__shell--img-right {
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.35fr);
}

.hpb-popout-cta__shell--img-right .hpb-popout-cta__figure {
  order: 1;
}

.hpb-popout-cta__shell--img-right .hpb-popout-cta__panel {
  order: 2;
}

.hpb-popout-cta__panel {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 220px;
  border-radius: var(--hpb-po-radius, 40px);
  background: linear-gradient(115deg, var(--hpb-po-from, #0d9488) 0%, var(--hpb-po-to, #14b8a6) 100%);
  color: var(--hpb-po-text, #fff);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.hpb-popout-cta__watermark {
  position: absolute;
  inset-inline-start: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(280px, 42%);
  height: auto;
  opacity: 0.14;
  pointer-events: none;
  user-select: none;
}

.hpb-popout-cta__watermark--fallback {
  width: 180px;
  height: 180px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 55%),
    rgba(255, 255, 255, 0.08);
  inset-inline-start: auto;
  inset-inline-end: 18%;
}

.hpb-popout-cta__content {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px);
  padding-inline-end: clamp(24px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: right;
}

.hpb-popout-cta__shell--img-left .hpb-popout-cta__content {
  /* جا برای تصویر در سمت چپ بصری */
  margin-inline-end: clamp(140px, 28%, 280px);
}

.hpb-popout-cta__shell--img-right .hpb-popout-cta__content {
  margin-inline-start: clamp(140px, 28%, 280px);
  margin-inline-end: 0;
}

.hpb-popout-cta__title {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  color: inherit;
}

.hpb-popout-cta__body {
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.85;
  opacity: 0.95;
  max-width: 38ch;
}

.hpb-popout-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0.72rem 1.45rem;
  border-radius: 999px;
  background: var(--hpb-po-btn-bg, #fff);
  color: var(--hpb-po-btn-fg, #0d9488) !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hpb-popout-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.hpb-popout-cta__btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  transform: none;
}

.hpb-popout-cta__btn-pin {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.hpb-popout-cta__figure {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  align-self: end;
  justify-self: center;
  width: min(100%, 300px);
  pointer-events: none;
}

.hpb-popout-cta__shell--img-right .hpb-popout-cta__figure {
  grid-column: 1;
}

.hpb-popout-cta__person {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  object-position: bottom center;
  /* بیرون‌زدگی از بالای پنل */
  transform: translateY(-18%);
  filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.18));
  user-select: none;
}

/* ——— موبایل: تصویر بزرگ‌تر روی بنفش، فقط عنوان، دکمه جمع‌وجور ——— */
@media (max-width: 860px) {
  .hpb-popout-cta {
    padding: 28px 0 12px;
  }

  .hpb-popout-cta .crafto-container {
    padding-inline: 0;
  }

  .hpb-popout-cta__shell,
  .hpb-popout-cta__shell--img-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .hpb-popout-cta__figure {
    order: 1;
    grid-column: auto;
    grid-row: auto;
    width: 150px;
    height: 150px;
    margin: 0 auto -44px;
    z-index: 4;
    justify-self: center;
  }

  .hpb-popout-cta__person {
    max-height: 100%;
    width: 100%;
    height: auto;
    transform: none;
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.18));
  }

  .hpb-popout-cta__panel {
    order: 2;
    min-height: 0;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  }

  .hpb-popout-cta__shell--img-left .hpb-popout-cta__content,
  .hpb-popout-cta__shell--img-right .hpb-popout-cta__content {
    margin: 0;
    /* پدینگ تاپ بیشتر تا تصویر بیشتر روی بنفش بنشیند */
    padding: 56px 16px 14px;
    max-width: none;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .hpb-popout-cta__title {
    font-size: 1.12rem;
    line-height: 1.35;
  }

  /* فقط عنوان بماند */
  .hpb-popout-cta__body {
    display: none !important;
  }

  .hpb-popout-cta__btn {
    width: auto;
    min-width: 7.5rem;
    max-width: 70%;
    justify-content: center;
    margin-top: 2px;
    padding: 0.42rem 0.95rem;
    font-size: 0.82rem;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  }

  .hpb-popout-cta__btn-icon {
    font-size: 0.95rem;
  }

  .hpb-popout-cta__watermark,
  .hpb-popout-cta__watermark--fallback {
    display: none;
  }
}

@media (max-width: 480px) {
  .hpb-popout-cta {
    padding: 24px 0 10px;
  }

  .hpb-popout-cta__figure {
    width: 150px;
    height: 150px;
    margin-bottom: -44px;
  }

  .hpb-popout-cta__person {
    width: 100%;
    max-height: 100%;
  }

  .hpb-popout-cta__content {
    padding: 52px 14px 12px;
  }

  .hpb-popout-cta__title {
    font-size: 1.05rem;
  }

  .hpb-popout-cta__btn {
    padding: 0.38rem 0.85rem;
    font-size: 0.8rem;
  }
}
