/* 60% scroll slim CTA bar (service pages) */
.pd-service-scroll-cta {
  position: fixed;
  z-index: 43;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.pd-service-scroll-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pd-service-scroll-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(106, 69, 227, 0.2);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 -8px 32px rgba(11, 38, 64, 0.1);
}

.pd-service-scroll-cta__copy {
  margin: 0;
  font-family: var(--font, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: #0b2640;
  line-height: 1.35;
}

.pd-service-scroll-cta__copy span {
  display: block;
  font-weight: 600;
  color: #64748b;
  font-size: 0.85rem;
  margin-top: 2px;
}

.pd-service-scroll-cta__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pd-service-scroll-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6a45e3, #5536c9);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pd-service-scroll-cta__link:hover {
  filter: brightness(1.05);
}

.pd-service-scroll-cta__dismiss {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(11, 38, 64, 0.08);
  color: #475569;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.pd-service-scroll-cta__dismiss:hover {
  background: rgba(11, 38, 64, 0.14);
}

/* Exit prompt — bottom sheet near FAB, light backdrop */
.pd-service-exit-dialog {
  position: fixed;
  inset: auto clamp(12px, 3vw, 24px) calc(88px + env(safe-area-inset-bottom, 0px)) auto;
  width: min(400px, calc(100vw - 24px));
  max-width: 400px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(106, 69, 227, 0.14);
  border-radius: 20px;
  background: #fff;
  color: #0b2640;
  box-shadow:
    0 22px 48px rgba(11, 38, 64, 0.14),
    0 2px 8px rgba(11, 38, 64, 0.06);
  overflow: hidden;
  font-family: var(--font, 'Plus Jakarta Sans', system-ui, sans-serif);
}

.pd-service-exit-dialog:not([open]) {
  display: none;
}

.pd-service-exit-dialog[open] {
  animation: pd-service-exit-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pd-service-exit-dialog--closing[open] {
  animation: pd-service-exit-out 0.22s ease-in both;
}

.pd-service-exit-dialog::backdrop {
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(4px);
}

.pd-service-exit {
  position: relative;
  padding: 18px 20px 20px;
}

.pd-service-exit__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6a45e3, #25d366 55%, #6a45e3);
  opacity: 0.85;
}

.pd-service-exit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pd-service-exit__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pd-service-exit__mark {
  flex-shrink: 0;
  border-radius: 10px;
}

.pd-service-exit__brand-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0b2640;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-service-exit__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e8ecf4;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pd-service-exit__close:hover {
  border-color: rgba(106, 69, 227, 0.35);
  color: #0b2640;
}

.pd-service-exit__eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6a45e3;
}

.pd-service-exit__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b2640;
  line-height: 1.25;
}

.pd-service-exit__text {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.pd-service-exit__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-service-exit__primary {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.pd-service-exit__later {
  width: 100%;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pd-service-exit__later:hover {
  color: #0b2640;
}

@keyframes pd-service-exit-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pd-service-exit-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

body.pd-service-exit-open .pd-whatsapp-widget {
  z-index: 45;
}

body:has(.pd-service-scroll-cta.is-visible) .pd-service-exit-dialog[open] {
  inset-block-end: calc(132px + env(safe-area-inset-bottom, 0px));
}

/* Case study CTA reveal */
.case-study-similar-cta {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.case-study-similar-cta.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

body:has(.pd-service-scroll-cta.is-visible) .pd-whatsapp-widget {
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

body:has(.pd-service-scroll-cta.is-visible) .back-to-top:not([hidden]) {
  bottom: calc(128px + env(safe-area-inset-bottom, 0px));
}

.pd-whatsapp-widget--await-scroll {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
}

.pd-whatsapp-widget--scroll-ready {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

@media (max-width: 720px) {
  .pd-service-scroll-cta__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pd-service-scroll-cta__actions {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-service-scroll-cta,
  .case-study-similar-cta,
  .pd-whatsapp-widget--scroll-ready {
    transition: none;
  }
}
