/* =============================================
   WC Abandoned Cart Recovery Pro — Frontend CSS
   ============================================= */

/* ── Exit intent overlay ─────────────────────── */
#acr-exit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

#acr-exit-overlay.acr-is-visible {
    opacity: 1;
    visibility: visible;
}

/* ── Popup box ───────────────────────────────── */
#acr-exit-popup {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    position: relative;
    overflow: hidden;
    transform: scale(0.92) translateY(16px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#acr-exit-overlay.acr-is-visible #acr-exit-popup {
    transform: scale(1) translateY(0);
}

/* ── Popup accent bar ────────────────────────── */
#acr-exit-popup::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, #7c3aed, #4f46e5);
}

/* ── Close button ────────────────────────────── */
#acr-exit-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #9ca3af;
    font-size: 1.3rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

#acr-exit-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ── Popup inner ─────────────────────────────── */
.acr-popup-inner {
    padding: 32px 36px 36px;
}

/* ── Popup icon / badge ──────────────────────── */
.acr-popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.acr-popup-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Heading ─────────────────────────────────── */
.acr-popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.25;
}

.acr-popup-text {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Form ────────────────────────────────────── */
#acr-exit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#acr-exit-email {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    color: #111827;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
}

#acr-exit-email::placeholder { color: #9ca3af; }

#acr-exit-email:focus {
    border-color: #7c3aed;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

#acr-exit-submit {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#acr-exit-submit:hover { opacity: 0.92; transform: translateY(-1px); }
#acr-exit-submit:active { transform: translateY(0); }

#acr-exit-submit.loading { opacity: 0.75; pointer-events: none; }

/* ── Mini spinner inside button ──────────────── */
.acr-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: acr-spin 0.7s linear infinite;
    display: none;
}

#acr-exit-submit.loading .acr-btn-spinner { display: block; }
#acr-exit-submit.loading .acr-btn-label  { display: none; }

@keyframes acr-spin { to { transform: rotate(360deg); } }

/* ── Success state ───────────────────────────── */
#acr-exit-success {
    display: none;
    text-align: center;
    padding: 24px 0 8px;
}

#acr-exit-success.is-visible { display: block; }

.acr-success-icon {
    width: 56px;
    height: 56px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}

.acr-success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.acr-success-text {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* ── Error message ───────────────────────────── */
#acr-exit-error {
    display: none;
    color: #dc2626;
    font-size: 0.8125rem;
    padding: 8px 12px;
    background: #fee2e2;
    border-radius: 6px;
}

#acr-exit-error.is-visible { display: block; }

/* ── Dismiss link ────────────────────────────── */
.acr-popup-dismiss {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.8125rem;
    color: #9ca3af;
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.acr-popup-dismiss:hover { color: #6b7280; }

/* ── Trust badges row ────────────────────────── */
.acr-trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.acr-trust-row span { display: flex; align-items: center; gap: 4px; }

.acr-trust-row svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #d1d5db;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 520px) {
    #acr-exit-popup { border-radius: 12px; }
    .acr-popup-inner { padding: 24px 22px 28px; }
    .acr-popup-title { font-size: 1.25rem; }
}
