/* ==========================================
   Affili Boost CRO — Sticky Bar + Exit Popup
   v1.0.4 — Adapté cabinetkinecaenlaprairie.fr
   ========================================== */

/* ---------- Utility ---------- */
.ab-hidden {
    display: none !important;
}

/* ---------- Sticky Bar ---------- */
.ab-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    padding: 0 20px;
    animation: abSlideUp 0.4s ease-out;
    border-radius: 16px 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ab-sticky-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.ab-sticky-name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.ab-sticky-price {
    color: #ffd700;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.ab-sticky-price .ab-old-price {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    margin-right: 6px;
    font-size: 14px;
}

.ab-sticky-cta {
    display: inline-block;
    background: linear-gradient(135deg, #00a651 0%, #007d40 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 11px 28px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 166, 81, 0.3);
}

.ab-sticky-cta:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(0, 166, 81, 0.4);
    color: #fff !important;
}

.ab-sticky-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ab-sticky-close:hover {
    background: rgba(0, 0, 0, 0.55);
}

@keyframes abSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ---------- Exit Popup ---------- */
.ab-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: abFadeIn 0.3s ease-out;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ab-popup-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
    position: relative;
    animation: abScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ab-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ab-popup-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.ab-popup-image {
    width: 100%;
    height: 200px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fa;
    position: relative;
}

.ab-popup-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, #fff, transparent);
}

.ab-popup-content {
    padding: 20px 24px 24px;
    text-align: center;
}

.ab-popup-hook {
    font-size: 12px;
    color: #1565c0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
    display: inline-block;
    background: #e3f2fd;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #90caf9;
}

.ab-popup-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.3;
}

.ab-popup-price {
    font-size: 20px;
    font-weight: 800;
    color: #007d40;
    margin-bottom: 20px;
}

.ab-popup-price .ab-old-price {
    text-decoration: line-through;
    color: #aaa;
    font-weight: 400;
    margin-right: 8px;
    font-size: 16px;
}

.ab-popup-price .ab-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00a651, #007d40);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.ab-popup-cta {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #00a651 0%, #007d40 100%);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none !important;
    text-align: center;
    padding: 15px 24px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 166, 81, 0.35);
    animation: abPulse 2.5s ease-in-out infinite;
}

.ab-popup-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(0, 166, 81, 0.45);
    color: #fff !important;
}

.ab-popup-dismiss {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    margin-top: 14px;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s;
    border-radius: 6px;
}

.ab-popup-dismiss:hover {
    color: #555;
    text-decoration: underline;
}

@keyframes abFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes abScaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes abPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0, 166, 81, 0.35); }
    50%      { box-shadow: 0 4px 24px rgba(0, 166, 81, 0.55); }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .ab-sticky-bar {
        border-radius: 14px 14px 0 0;
        padding: 0 12px;
    }

    .ab-sticky-inner {
        gap: 6px;
        padding: 8px 0;
        justify-content: space-between;
    }

    .ab-sticky-name {
        max-width: 50%;
        font-size: 12px;
        flex-shrink: 1;
    }

    .ab-sticky-price {
        font-size: 13px;
        flex-shrink: 0;
    }

    .ab-sticky-price .ab-old-price {
        font-size: 11px;
    }

    .ab-sticky-cta {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 8px;
        order: 3;
    }

    .ab-sticky-close {
        top: 6px;
        right: 6px;
        width: 26px;
        height: 26px;
        font-size: 16px;
    }

    .ab-popup-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .ab-popup-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        animation: abSlideUp 0.35s ease-out;
    }

    .ab-popup-image {
        height: 140px;
    }

    .ab-popup-content {
        padding: 16px;
    }

    .ab-popup-hook {
        font-size: 11px;
        padding: 4px 12px;
    }

    .ab-popup-title {
        font-size: 18px;
    }

    .ab-popup-price {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .ab-popup-cta {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 10px;
    }
}
