/* =========================================================
   AB Popup Widget — Styles
   ========================================================= */

/* ---------------------------------------------------------
   OVERLAY (Modal / Exit-Intent)
   --------------------------------------------------------- */
.ab-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.65);
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ab-popup-overlay.ab-popup--visible {
  opacity: 1;
}

/* ---------------------------------------------------------
   POPUP BOX (shared)
   --------------------------------------------------------- */
.ab-popup-box {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  transform: translateY(24px) scale(0.97);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  opacity: 0;
  max-height: 90vh;
  overflow-y: auto;
}

.ab-popup-overlay.ab-popup--visible .ab-popup-box,
.ab-popup-notification.ab-popup--visible .ab-popup-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---------------------------------------------------------
   LAYOUT: Image Position
   --------------------------------------------------------- */
.ab-popup-box.ab-popup-layout--top {
  display: flex;
  flex-direction: column;
}

.ab-popup-box.ab-popup-layout--left,
.ab-popup-box.ab-popup-layout--right {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}

.ab-popup-box.ab-popup-layout--right {
  flex-direction: row-reverse;
}

.ab-popup-box.ab-popup-layout--left .ab-popup-image,
.ab-popup-box.ab-popup-layout--right .ab-popup-image {
  flex: 0 0 40%;
  max-width: 40%;
}

/* ---------------------------------------------------------
   IMAGE
   --------------------------------------------------------- */
.ab-popup-image {
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.ab-popup-box.ab-popup-layout--left .ab-popup-image,
.ab-popup-box.ab-popup-layout--right .ab-popup-image {
  margin-bottom: 0;
}

.ab-popup-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ---------------------------------------------------------
   BODY / TEXT
   --------------------------------------------------------- */
.ab-popup-body {
  flex: 1;
}

.ab-popup-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a2e;
  margin: 0 0 12px;
  padding: 0;
}

.ab-popup-description {
  font-size: 0.975rem;
  line-height: 1.7;
  color: #555555;
  margin: 0 0 24px;
}

/* ---------------------------------------------------------
   CTA BUTTON
   --------------------------------------------------------- */
.ab-popup-cta {
  display: inline-block;
  padding: 12px 28px;
  background-color: #6c63ff;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
}

.ab-popup-cta:hover {
  background-color: #574fd6;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.45);
  color: #ffffff;
  text-decoration: none;
}

/* ---------------------------------------------------------
   CLOSE BUTTON
   --------------------------------------------------------- */
.ab-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  padding: 6px;
  font-size: 18px;
  line-height: 1;
  color: #888888;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.ab-popup-close:hover {
  color: #222222;
  background: rgba(0, 0, 0, 0.06);
}

/* ---------------------------------------------------------
   NOTIFICATION / BANNER
   --------------------------------------------------------- */
.ab-popup-notification {
  position: fixed;
  z-index: 999990;
  max-width: 380px;
  width: calc(100% - 40px);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
}

.ab-popup-notification.ab-popup--visible {
  opacity: 1;
  pointer-events: auto;
}

.ab-popup-notification .ab-popup-box {
  max-width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

/* Positions */
.ab-popup-notification.ab-popup-notif--top-left {
  top: 20px;
  left: 20px;
}
.ab-popup-notification.ab-popup-notif--top-center {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.ab-popup-notification.ab-popup-notif--top-right {
  top: 20px;
  right: 20px;
}
.ab-popup-notification.ab-popup-notif--bottom-left {
  bottom: 20px;
  left: 20px;
}
.ab-popup-notification.ab-popup-notif--bottom-center {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.ab-popup-notification.ab-popup-notif--bottom-right {
  bottom: 20px;
  right: 20px;
}

/* Slide-in from bottom for bottom variants */
.ab-popup-notification.ab-popup-notif--bottom-left,
.ab-popup-notification.ab-popup-notif--bottom-right {
  transform: translateY(20px);
}
.ab-popup-notification.ab-popup-notif--bottom-center {
  transform: translateX(-50%) translateY(20px);
}
.ab-popup-notification.ab-popup-notif--top-left,
.ab-popup-notification.ab-popup-notif--top-right {
  transform: translateY(-20px);
}
.ab-popup-notification.ab-popup-notif--top-center {
  transform: translateX(-50%) translateY(-20px);
}

/* Visible states restore translations */
.ab-popup-notification.ab-popup-notif--bottom-left.ab-popup--visible,
.ab-popup-notification.ab-popup-notif--bottom-right.ab-popup--visible,
.ab-popup-notification.ab-popup-notif--top-left.ab-popup--visible,
.ab-popup-notification.ab-popup-notif--top-right.ab-popup--visible {
  transform: translateY(0);
}
.ab-popup-notification.ab-popup-notif--bottom-center.ab-popup--visible,
.ab-popup-notification.ab-popup-notif--top-center.ab-popup--visible {
  transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------
   BODY SCROLL LOCK
   --------------------------------------------------------- */
body.ab-popup-open {
  overflow: hidden;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 767px) {
  .ab-popup-box.ab-popup-layout--left,
  .ab-popup-box.ab-popup-layout--right {
    flex-direction: column;
  }

  .ab-popup-box.ab-popup-layout--left .ab-popup-image,
  .ab-popup-box.ab-popup-layout--right .ab-popup-image {
    flex: unset;
    max-width: 100%;
    margin-bottom: 16px;
  }

  .ab-popup-notification {
    max-width: calc(100% - 24px);
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
  }

  .ab-popup-notification.ab-popup--visible {
    transform: none !important;
  }
}

/* ---------------------------------------------------------
   EDITOR PREVIEW MODE
   --------------------------------------------------------- */
.ab-popup-editor-preview {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  padding: 28px 20px;
  border-radius: 14px;
  border: 2px dashed rgba(108, 99, 255, 0.4);
  margin: 20px 0;
  box-sizing: border-box;
}

.ab-popup-editor-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #1e1e2d;
  color: #ffffff;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ab-popup-badge-hint {
  color: #a0a0b8;
  font-size: 11px;
}

.ab-popup-editor-preview .ab-popup-box {
  opacity: 1 !important;
  transform: none !important;
  margin: 0 auto;
  box-sizing: border-box;
  display: block;
}

.ab-popup-editor-preview .ab-popup-box.ab-popup-layout--left,
.ab-popup-editor-preview .ab-popup-box.ab-popup-layout--right {
  display: flex !important;
}

.ab-popup-shortcode-wrapper,
.ab-popup-custom-html-wrapper,
.ab-popup-elementor-wrapper {
  width: 100%;
  box-sizing: border-box;
}

.ab-popup-shortcode-placeholder {
  padding: 24px;
  text-align: center;
  color: #718096;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-family: sans-serif;
}
