/* ============================================================
   popup.css — Generic Configurable Popup Modal
   Modern, premium, SaaS-style. No external dependencies.
   ============================================================ */

/* ── CSS Variables (overridden per-instance via inline style) ── */
.ppu-root {
  --ppu-theme:       #008f4c;
  --ppu-theme-dark:  #006d39;
  --ppu-theme-light: #e6f7ef;
  --ppu-bg:          #ffffff;
  --ppu-text:        #111827;
  --ppu-radius:      22px;
  --ppu-transition:  0.38s cubic-bezier(0.34, 1.20, 0.64, 1);
}

/* ── Overlay ──────────────────────────────────────────────── */
.ppu-overlay {
  position: fixed;
  inset: 0;
  z-index: 99900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 14, 23, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.ppu-overlay.ppu-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal shell ──────────────────────────────────────────── */
.ppu-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1000px;
  max-height: 96vh;
  background: var(--ppu-bg);
  border-radius: var(--ppu-radius);
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(28px) scale(0.97);
  opacity: 0;
  transition: transform var(--ppu-transition), opacity 0.32s ease;
}
.ppu-overlay.ppu-visible .ppu-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Body: 2-col layout ───────────────────────────────────── */
.ppu-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Close button ─────────────────────────────────────────── */
.ppu-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #374151;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
  backdrop-filter: blur(4px);
}
.ppu-close:hover {
  background: #fff;
  color: #111;
  transform: scale(1.08);
}
.ppu-close:focus-visible {
  outline: 2px solid var(--ppu-theme);
  outline-offset: 2px;
}

/* ── Left content column ──────────────────────────────────── */
.ppu-content {
  flex: 0 0 54%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 40px 32px 44px;
  overflow-y: auto;
  background: var(--ppu-bg);
  scrollbar-width: none;
}
.ppu-content::-webkit-scrollbar { display: none; }

/* ── Badge ────────────────────────────────────────────────── */
.ppu-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 10px;
  background: var(--ppu-theme-light);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ppu-theme);
  margin-bottom: 16px;
  width: fit-content;
}
.ppu-badge-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ── Title ────────────────────────────────────────────────── */
.ppu-title {
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ppu-text);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.ppu-title mark {
  background: none;
  color: var(--ppu-theme);
  font-style: normal;
}

/* ── Description ──────────────────────────────────────────── */
.ppu-description {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.55;
  margin-bottom: 16px;
}
.ppu-description strong {
  color: var(--ppu-theme);
  font-weight: 700;
}

/* ── Bullet list ──────────────────────────────────────────── */
.ppu-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 22px;
}
.ppu-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.93rem;
  color: #1f2937;
  font-weight: 500;
  line-height: 1.45;
}
.ppu-bullet-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--ppu-theme);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.ppu-bullet-icon svg {
  display: block;
}

/* ── CTA button ───────────────────────────────────────────── */
.ppu-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--ppu-theme);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition:
    background 0.2s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 380px;
  margin-bottom: 12px;
}
.ppu-cta:hover {
  background: var(--ppu-theme-dark);
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.12);
}
.ppu-cta:active {
  transform: translateY(0) scale(0.99);
}
.ppu-cta:focus-visible {
  outline: 3px solid var(--ppu-theme);
  outline-offset: 3px;
}
.ppu-cta-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Footer text ──────────────────────────────────────────── */
.ppu-footer-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 500;
}
.ppu-footer-text svg {
  flex-shrink: 0;
  color: #d1d5db;
}

/* ── Footer bar (social proof) ────────────────────────────── */
.ppu-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 52px;
  background: #f9fafb;
  border-top: 1px solid #f0f0f0;
  gap: 12px;
  flex-wrap: wrap;
}
.ppu-social-proof-text {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 500;
}
.ppu-social-proof-rating {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ppu-rating-brand {
  font-size: 0.82rem;
  font-weight: 800;
  color: #00b67a;
  letter-spacing: -0.01em;
}
.ppu-rating-stars {
  display: flex;
  gap: 2px;
}
.ppu-rating-stars svg {
  color: #00b67a;
}
.ppu-rating-score {
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
}
.ppu-rating-reviews {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* ── Right image column ───────────────────────────────────── */
.ppu-image-col {
  flex: 0 0 46%;
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
}
.ppu-image-col img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
/* Gradient fade from left (blends content into image) */
.ppu-image-col::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to right,
    var(--ppu-bg) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    transparent 55%
  );
  pointer-events: none;
}
/* Subtle image caption / overlay text */
.ppu-image-caption {
  position: absolute;
  z-index: 2;
  bottom: 28px;
  right: 22px;
  font-family: 'Caveat', 'Dancing Script', cursive, sans-serif;
  font-size: 1.1rem;
  color: #fff;
  text-align: right;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0,0,0,0.28);
  pointer-events: none;
  white-space: pre-line;
}

/* ── Image left variant ───────────────────────────────────── */
.ppu-body.ppu-img-left .ppu-image-col {
  order: -1;
}
.ppu-body.ppu-img-left .ppu-image-col::before {
  background: linear-gradient(
    to left,
    var(--ppu-bg) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    transparent 55%
  );
}
.ppu-body.ppu-img-left .ppu-content {
  padding: 52px 52px 44px 48px;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 700px) {
  .ppu-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .ppu-modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--ppu-radius) var(--ppu-radius) 0 0;
    transform: translateY(100%);
  }
  .ppu-overlay.ppu-visible .ppu-modal {
    transform: translateY(0);
  }
  .ppu-body {
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(90vh - 54px);
  }
  .ppu-image-col {
    flex: 0 0 220px;
    height: 220px;
    order: -1 !important;
  }
  .ppu-image-col::before {
    background: linear-gradient(
      to bottom,
      transparent 40%,
      var(--ppu-bg) 100%
    ) !important;
  }
  .ppu-content {
    flex: 1;
    padding: 28px 24px 24px;
    overflow-y: visible;
  }
  .ppu-title {
    font-size: 1.45rem;
  }
  .ppu-cta {
    max-width: 100%;
    padding: 16px 24px;
  }
  .ppu-footer-bar {
    padding: 12px 24px;
    justify-content: center;
    text-align: center;
  }
  .ppu-social-proof-text {
    width: 100%;
    text-align: center;
  }
  .ppu-social-proof-rating {
    justify-content: center;
  }
  .ppu-image-caption {
    display: none;
  }
  .ppu-close {
    top: 10px;
    right: 10px;
  }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ppu-overlay,
  .ppu-modal,
  .ppu-cta {
    transition: none !important;
  }
}
