/* ============================================================
   Campaign Exit Popup — Podium layout
   #1 center (elevated), #2 left, #3 right — award podium style
   Visit Website: full-width amber button matching popular cards
   ============================================================ */

/* ── Overlay — dark bg, click does NOT close ─────────────── */
.cep-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 36, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.cep-overlay.active { opacity: 1; visibility: visible; }

/* ── Modal ───────────────────────────────────────────────── */
.cep-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 780px;
    max-width: 95%;
    background: #f8f9fc;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.28);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.32s cubic-bezier(0.34, 1.3, 0.64, 1);
    overflow: visible; /* allow featured card to overflow upward */
    padding: 52px 28px 28px; /* extra top padding clears the absolute badge */
}
.cep-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Close button ────────────────────────────────────────── */
.cep-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 32px; height: 32px;
    background: #e8eaf0;
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.22s;
    z-index: 10;
}
.cep-close:hover { background: #d1d5db; transform: rotate(90deg); }
.cep-close svg { width: 14px; height: 14px; color: #4b5563; }

/* ── "BEFORE YOU GO" badge — absolutely positioned, zero layout space ── */
.cep-before-badge {
    position: absolute;
    top: 16px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #4f46e5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 100px;
    z-index: 5;
    pointer-events: none;
}
.cep-badge-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
    animation: cep-pulse 2s ease-in-out infinite;
}
@keyframes cep-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.6); }
}

/* ── Header ──────────────────────────────────────────────── */
.cep-header {
    margin-bottom: 28px;
    padding-right: 44px;
    text-align: center;
}

.cep-title {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 5px 0;
    line-height: 1.25;
}
.cep-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ── Podium grid — order: left(#2), center(#1), right(#3) ── */
.cep-products {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: end; /* cards sit on the same baseline — featured rises up */
}

/* ── Base card ───────────────────────────────────────────── */
.cep-card {
    background: #fff;
    border: 1.5px solid #e4e7ef;
    border-radius: 16px;
    padding: 20px 16px 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    transition: box-shadow 0.2s, transform 0.18s;
}
.cep-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* ── Featured card (#1) — lifted like a podium winner ─────── */
.cep-card.cep-featured {
    border-color: #d1d5db;
    box-shadow: 0 12px 36px rgba(0,0,0,0.14);
    /* lift it above the other two — podium effect */
    margin-bottom: -24px;
    padding-top: 28px;
    padding-bottom: 24px;
    z-index: 2;
}
.cep-card.cep-featured:hover {
    box-shadow: 0 18px 44px rgba(0,0,0,0.18);
}

/* ── Rank badge — dark navy pentagon ribbon ──────────────── */
.cep-rank-badge {
    position: absolute;
    top: -2px; right: 12px;
    width: 28px;
    background: #1e2d5a;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    padding: 6px 0 10px;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
    line-height: 1;
    z-index: 3;
}

/* Featured: green "Top Choice / 1" pentagon */
.cep-rank-badge.cep-rank-featured {
    top: -2px; right: 12px;
    width: 46px;
    background: #16a34a;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 4px 16px;
    clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.1;
}
.cep-rank-badge.cep-rank-featured .cep-rank-num {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

/* ── Logo ────────────────────────────────────────────────── */
.cep-logo-wrap {
    width: 60px; height: 60px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid #e4e7ef;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin: 0 auto 12px;
    flex-shrink: 0;
}
.cep-card.cep-featured .cep-logo-wrap {
    width: 70px; height: 70px;
    border-radius: 16px;
}
.cep-logo {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 8px;
}
.cep-logo-placeholder {
    font-size: 22px;
    font-weight: 800;
    color: #4f46e5;
}

/* ── Product name ────────────────────────────────────────── */
.cep-product-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    line-height: 1.3;
    width: 100%;
}
.cep-card.cep-featured .cep-product-name {
    font-size: 15px;
}

/* ── Visit Website / Free Demo button ───────────────────── */
/* Matches .popular-btn from category-style.css exactly */
.cep-btn-visit,
.cep-btn-lead {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    gap: 4px;
    min-height: 32px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: filter 0.2s ease, transform 0.15s ease;
    margin-bottom: 10px;
    color: #fff;
}

@media (min-width: 480px) {
    .cep-btn-visit,
    .cep-btn-lead {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 34px;
    }
}

.cep-btn-visit svg,
.cep-btn-lead svg {
    width: 12px; height: 12px;
    flex-shrink: 0;
}

/* Hover for all button variants */
.cep-btn-visit:hover,
.cep-btn-lead:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #fff;
}

/* #1 featured — orange #FEA122 (matches campaign-btn-pricing) */
.cep-card.cep-featured .cep-btn-visit,
.cep-card.cep-featured .cep-btn-lead {
    background: #FEA122;
}

/* #2, #3 with vendor URL — green #097652 (matches campaign btn) */
.cep-btn-visit.cep-btn-campaign {
    background: #097652;
}

/* #2, #3 lead popup (no vendor URL) — indigo (matches popular-btn default) */
.cep-btn-lead.cep-btn-popup {
    background: #6366f1;
}
.cep-btn-lead.cep-btn-popup:hover {
    background: #4f46e5;
    filter: none;
}

/* ── Starting Price ──────────────────────────────────────── */
.cep-price {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    width: 100%;
}
.cep-price strong {
    color: #0f172a;
    font-weight: 600;
}

/* ── Footer dismiss ──────────────────────────────────────── */
.cep-footer {
    margin-top: 28px;
    text-align: center;
}
.cep-dismiss {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    transition: color 0.2s;
}
.cep-dismiss:hover { color: #64748b; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .cep-modal {
        position: fixed;
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%; max-width: 100%;
        transform: translateY(8%);
        border-radius: 20px 20px 0 0;
        padding: 22px 16px 24px;
        max-height: 90vh;
        overflow-y: auto;
        transition: transform 0.32s ease, opacity 0.32s ease, visibility 0.32s ease;
    }
    .cep-modal.active { transform: translateY(0); }
    /* Stack vertically on mobile — featured first */
    .cep-products {
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: stretch;
    }
    .cep-card.cep-featured {
        margin-bottom: 0;
        order: -1;
    }
    .cep-card { flex-direction: row; text-align: left; padding: 14px; gap: 12px; align-items: center; }
    .cep-logo-wrap { width: 46px; height: 46px; margin: 0; flex-shrink: 0; }
    .cep-card.cep-featured .cep-logo-wrap { width: 50px; height: 50px; }
    .cep-card-body { flex: 1; min-width: 0; }
    .cep-product-name { font-size: 13px; margin-bottom: 8px; }
    .cep-btn-visit, .cep-btn-lead { padding: 8px 12px; font-size: 12px; margin-bottom: 6px; }
    .cep-price { font-size: 11px; }
    .cep-footer { margin-top: 16px; }
}

@media (min-width: 641px) and (max-width: 768px) {
    .cep-modal { width: 96%; }
    .cep-btn-visit, .cep-btn-lead { font-size: 12px; padding: 9px 10px; }
}