/* =============================================
   EXIT-INTENT POPUP — Cart/Checkout Discount
   ============================================= */

/* Overlay */
.mf-exit {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.mf-exit.is-active {
  opacity: 1;
  visibility: visible;
}
.mf-exit.is-closing {
  opacity: 0;
  visibility: hidden;
}

/* Backdrop */
.mf-exit__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

/* Card — follows theme */
.mf-exit__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--mf-surface, #fff);
  border: 1px solid var(--mf-line, rgba(0,0,0,.08));
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0,0,0,.18),
    0 0 80px rgba(198,163,91,.06);
  transform: translateY(24px) scale(.96);
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
:root[data-theme="dark"] .mf-exit__card {
  border-color: rgba(255,255,255,.08);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04),
    0 24px 64px rgba(0,0,0,.5),
    0 0 80px rgba(198,163,91,.08);
}
.mf-exit.is-active .mf-exit__card {
  transform: translateY(0) scale(1);
}
.mf-exit.is-closing .mf-exit__card {
  transform: translateY(24px) scale(.96);
}

/* Close button */
.mf-exit__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.mf-exit__close:hover {
  background: rgba(0,0,0,.7);
  color: #fff;
}

/* ── Video area — always dark for cinematic feel ── */
.mf-exit__video-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #0d0d0d;
}
.mf-exit__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.mf-exit__video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    var(--mf-surface, #fff) 100%
  );
  pointer-events: none;
}
:root[data-theme="dark"] .mf-exit__video-overlay {
  background: linear-gradient(
    to bottom,
    transparent 40%,
    var(--mf-surface, #1a1a1a) 100%
  );
}

/* ── Body content ── */
.mf-exit__body {
  padding: 0 28px 28px;
  text-align: center;
}

.mf-exit__kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 14px;
  border-radius: 100px;
  background: rgba(198,163,91,.12);
  color: var(--mf-gold, #c6a35b);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mf-exit__title {
  margin: 0 0 8px;
  font-family: var(--mf-ff-heading, 'Inter', sans-serif);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--mf-text, #111);
  letter-spacing: -.02em;
}

.mf-exit__text {
  margin: 0 0 20px;
  font-size: .92rem;
  color: var(--mf-muted, rgba(0,0,0,.5));
  line-height: 1.5;
}
.mf-exit__text strong {
  color: var(--mf-text, #111);
}

/* ── Coupon code pill ── */
.mf-exit__code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px 20px;
  border: 1.5px dashed var(--mf-gold, #c6a35b);
  border-radius: 10px;
  background: rgba(198,163,91,.06);
  color: var(--mf-gold, #c6a35b);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.mf-exit__code:hover {
  background: rgba(198,163,91,.12);
  transform: scale(1.03);
}
.mf-exit__code:active {
  transform: scale(.98);
}
.mf-exit__code-copied {
  display: none;
  font-family: var(--mf-ff, 'Inter', sans-serif);
  font-size: .78rem;
  font-weight: 600;
  color: #4ade80;
  letter-spacing: 0;
}
.mf-exit__code.is-copied .mf-exit__code-icon,
.mf-exit__code.is-copied .mf-exit__code-text {
  display: none;
}
.mf-exit__code.is-copied .mf-exit__code-copied {
  display: inline;
}

/* ── CTA button ── */
.mf-exit__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mf-gold, #c6a35b) 0%, #b8923f 100%);
  color: #fff;
  font-family: var(--mf-ff, 'Inter', sans-serif);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
  box-shadow: 0 4px 16px rgba(198,163,91,.25);
}
.mf-exit__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(198,163,91,.35);
  filter: brightness(1.08);
}
.mf-exit__cta:active {
  transform: translateY(0);
}
.mf-exit__cta-loading,
.mf-exit__cta-done {
  display: none;
}

/* Loading state */
.mf-exit__cta.is-loading .mf-exit__cta-label { display: none; }
.mf-exit__cta.is-loading .mf-exit__cta-loading {
  display: flex;
  animation: mf-exit-spin .8s linear infinite;
}
@keyframes mf-exit-spin {
  to { transform: rotate(360deg); }
}

/* Done state */
.mf-exit__cta.is-done {
  background: #16a34a;
  color: #fff;
  pointer-events: none;
}
.mf-exit__cta.is-done .mf-exit__cta-label { display: none; }
.mf-exit__cta.is-done .mf-exit__cta-done { display: inline; }

/* ── Dismiss link ── */
.mf-exit__dismiss {
  display: inline-block;
  margin-top: 14px;
  font-size: .78rem;
  color: var(--mf-muted, rgba(0,0,0,.4));
  text-decoration: none;
  transition: color .2s;
}
.mf-exit__dismiss:hover {
  color: var(--mf-text, #111);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .mf-exit__card {
    max-width: 100%;
    border-radius: 16px;
  }
  .mf-exit__video-wrap {
    height: 140px;
  }
  .mf-exit__body {
    padding: 0 20px 24px;
  }
  .mf-exit__title {
    font-size: 1.35rem;
  }
}

