/* ==========================================================================
   Cleerly CTA - Bloc cleerly/cta-pro + shortcode [cleerly_cta]
   5 variants :
     1. bandeau         (DEFAULT) - dark navy + bouton orange (l'ancien d-1)
     2. bandeau-orange  - fond orange + bouton navy (ancien d-2)
     3. bandeau-light   - fond clair + bouton navy (ancien d-3)
     4. editorial       - encart natif border-left (premium)
     5. card            - carte avec icône SVG + preuve sociale (premium)
   ========================================================================== */

:root {
    --cta-navy: #160041;
    --cta-navy-2: #2d0079;
    --cta-navy-3: #4c1d95;
    --cta-orange: #f59e0b;
    --cta-orange-2: #fbbf24;
    --cta-orange-3: #ea580c;
    --cta-accent: #ee4035;
    --cta-accent-2: #d63027;
    --cta-text: #1a1a2e;
    --cta-text-muted: #6b6479;
    --cta-bg-cream: #fdf8f3;
    --cta-bg-soft: #fafafb;
    --cta-border: #eceaf0;
    --cta-success: #16a34a;
}

/* ==========================================================================
   BASE - Animations
   ========================================================================== */
@keyframes cleerly-pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35), 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 6px 22px rgba(245, 158, 11, 0.5), 0 0 0 6px rgba(245, 158, 11, 0.08);
    }
}
@keyframes cleerly-pulse-accent {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(238, 64, 53, 0.3), 0 0 0 0 rgba(238, 64, 53, 0.35);
    }
    50% {
        box-shadow: 0 6px 22px rgba(238, 64, 53, 0.45), 0 0 0 6px rgba(238, 64, 53, 0.08);
    }
}
@keyframes cleerly-arrow-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* ==========================================================================
   COMMON RESET — éviter les conflits avec le thème
   ========================================================================== */
.cleerly-cta {
    box-sizing: border-box;
    margin: 36px 0;
    font-family: inherit;
    color: var(--cta-text);
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}
.cleerly-cta * {
    box-sizing: border-box;
}
.cleerly-cta__body {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
}
.cleerly-cta__action {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Sur les 3 bandeaux : bouton + badge empilés (badge sous le bouton) */
.cleerly-cta--bandeau .cleerly-cta__action,
.cleerly-cta--bandeau-orange .cleerly-cta__action,
.cleerly-cta--bandeau-light .cleerly-cta__action {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Bouton générique */
.cleerly-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none !important;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 300px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    z-index: 2;
    line-height: 1.3;
    text-align: center;
}
.cleerly-cta__btn-arrow {
    display: inline-block;
    font-weight: 800;
    transition: transform 0.25s ease;
}
.cleerly-cta__btn:hover .cleerly-cta__btn-arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   VARIANT 1 : BANDEAU (DEFAULT) — navy gradient + bouton orange
   ========================================================================== */
.cleerly-cta--bandeau {
    background: linear-gradient(135deg, var(--cta-navy) 0%, var(--cta-navy-2) 50%, var(--cta-navy) 100%);
    border-radius: 18px;
    padding: 22px 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    box-shadow: 0 16px 48px -12px rgba(22, 0, 65, 0.35);
}
/* Cercles décoratifs en background pour la profondeur */
.cleerly-cta--bandeau::before {
    content: '';
    position: absolute;
    top: -55%;
    right: -8%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.cleerly-cta--bandeau::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 4%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.cleerly-cta--bandeau .cleerly-cta__titre {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.015em;
}
.cleerly-cta--bandeau .cleerly-cta__texte {
    margin: 0 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 540px;
}
.cleerly-cta--bandeau .cleerly-cta__btn {
    background: linear-gradient(135deg, var(--cta-orange) 0%, var(--cta-orange-2) 100%);
    color: var(--cta-navy) !important;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    animation: cleerly-pulse-glow 2.6s infinite ease-in-out;
}
.cleerly-cta--bandeau .cleerly-cta__btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--cta-orange-2) 0%, #fcd34d 100%);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.55);
    animation: none;
}
.cleerly-cta--bandeau .cleerly-cta__badge {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   VARIANT 2 : BANDEAU-ORANGE — fond orange + bouton navy
   ========================================================================== */
.cleerly-cta--bandeau-orange {
    background: linear-gradient(135deg, var(--cta-orange) 0%, var(--cta-orange-3) 100%);
    border-radius: 18px;
    padding: 22px 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    box-shadow: 0 16px 48px -12px rgba(234, 88, 12, 0.35);
}
.cleerly-cta--bandeau-orange::before {
    content: '';
    position: absolute;
    top: -55%;
    right: -8%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.cleerly-cta--bandeau-orange .cleerly-cta__titre {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.015em;
    text-shadow: 0 1px 2px rgba(180, 80, 0, 0.15);
}
.cleerly-cta--bandeau-orange .cleerly-cta__texte {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 540px;
}
.cleerly-cta--bandeau-orange .cleerly-cta__btn {
    background: linear-gradient(135deg, var(--cta-navy) 0%, var(--cta-navy-2) 100%);
    color: #fff !important;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(22, 0, 65, 0.4);
}
.cleerly-cta--bandeau-orange .cleerly-cta__btn:hover {
    background: linear-gradient(135deg, var(--cta-navy-2) 0%, var(--cta-navy-3) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(22, 0, 65, 0.5);
}
.cleerly-cta--bandeau-orange .cleerly-cta__badge {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   VARIANT 3 : BANDEAU-LIGHT — fond crème/blanc + bouton navy
   ========================================================================== */
.cleerly-cta--bandeau-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #fdf8f3 100%);
    border: 1px solid #eef0f4;
    border-radius: 18px;
    padding: 22px 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    box-shadow: 0 16px 48px -16px rgba(22, 0, 65, 0.12);
}
.cleerly-cta--bandeau-light::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.cleerly-cta--bandeau-light::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 4%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(238, 64, 53, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.cleerly-cta--bandeau-light .cleerly-cta__titre {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cta-navy);
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.cleerly-cta--bandeau-light .cleerly-cta__texte {
    margin: 0;
    color: var(--cta-text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 540px;
}
.cleerly-cta--bandeau-light .cleerly-cta__btn {
    background: linear-gradient(135deg, var(--cta-navy) 0%, var(--cta-navy-2) 100%);
    color: #fff !important;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(22, 0, 65, 0.25);
}
.cleerly-cta--bandeau-light .cleerly-cta__btn:hover {
    background: linear-gradient(135deg, var(--cta-navy-2) 0%, var(--cta-navy-3) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(22, 0, 65, 0.35);
}
.cleerly-cta--bandeau-light .cleerly-cta__badge {
    color: var(--cta-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   VARIANT 4 : EDITORIAL — encart natif premium
   ========================================================================== */
.cleerly-cta--editorial {
    background:
        url("../img/cleerly-star-light.svg") no-repeat right -40px center / auto 140%,
        linear-gradient(135deg, #fdf6ec 0%, #fef3df 50%, #fdf8f3 100%);
    border: 1px solid #f4e4c8;
    border-left: 5px solid var(--cta-orange);
    border-radius: 0;
    padding: 22px 25px;
    box-shadow: 0 4px 18px -8px rgba(180, 100, 0, 0.12);
}
/* Sur mobile, on cache le watermark (le bloc est trop étroit, il devient parasite) */
@media (max-width: 700px) {
    .cleerly-cta--editorial {
        background:
            linear-gradient(135deg, #fdf6ec 0%, #fef3df 50%, #fdf8f3 100%);
    }
}
/* L'ancien cercle décoratif est remplacé par le watermark étoile Cleerly
   appliqué via background-image sur .cleerly-cta--editorial. */
.cleerly-cta--editorial .cleerly-cta__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--cta-orange-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 12px;
}
.cleerly-cta--editorial .cleerly-cta__eyebrow-icon {
    width: 14px;
    height: 14px;
}
.cleerly-cta--editorial .cleerly-cta__titre {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--cta-navy);
    margin: 0 0 10px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.cleerly-cta--editorial .cleerly-cta__texte {
    margin: 0 0 20px;
    font-size: 0.98rem;
    color: var(--cta-text);
    line-height: 1.6;
    max-width: 620px;
}
.cleerly-cta--editorial .cleerly-cta__btn {
    background: linear-gradient(135deg, var(--cta-navy) 0%, var(--cta-navy-2) 100%);
    color: #fff !important;
    font-size: 0.98rem;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(22, 0, 65, 0.22);
}
.cleerly-cta--editorial .cleerly-cta__btn:hover {
    background: linear-gradient(135deg, var(--cta-navy-2) 0%, var(--cta-navy-3) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(22, 0, 65, 0.32);
}
.cleerly-cta--editorial .cleerly-cta__badge {
    color: var(--cta-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cleerly-cta--editorial .cleerly-cta__badge::before {
    content: '✓';
    color: var(--cta-success);
    font-weight: 800;
}

/* ==========================================================================
   VARIANT 5 : CARD — premium avec SVG icon + preuve sociale + étoiles
   ========================================================================== */
.cleerly-cta--card {
    background: #fff;
    border: 1px solid var(--cta-border);
    border-left: 4px solid #160041;
    border-radius: 0;
    padding: 28px 32px;
    box-shadow:
        0 1px 3px rgba(22, 0, 65, 0.04),
        0 12px 32px -10px rgba(22, 0, 65, 0.10);
    display: flex;
    align-items: flex-start;
    gap: 22px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.cleerly-cta--card:hover {
    box-shadow:
        0 1px 3px rgba(22, 0, 65, 0.05),
        0 20px 48px -10px rgba(22, 0, 65, 0.18);
    transform: translateY(-2px);
}
.cleerly-cta--card .cleerly-cta__icone-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #ede7ff;
    color: #160041;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}
.cleerly-cta--card .cleerly-cta__icone-wrap svg {
    width: 28px;
    height: 28px;
    color: #160041;
}
/* Force le stacking vertical dans le body de la card */
.cleerly-cta--card .cleerly-cta__body {
    display: flex;
    flex-direction: column;
}
.cleerly-cta--card .cleerly-cta__action {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.cleerly-cta--card .cleerly-cta__titre {
    font-size: 1.2rem;
    font-weight: 800;
    color: #160041;
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.cleerly-cta--card .cleerly-cta__texte {
    margin: 0 0 18px;
    font-size: 0.96rem;
    color: var(--cta-text-muted);
    line-height: 1.55;
}
.cleerly-cta--card .cleerly-cta__rating {
    display: flex;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--cta-text-muted);
    margin: 0 0 16px;
    font-weight: 500;
    background: #f5f3fa;
    border: 1px solid #ede9f5;
    padding: 6px 14px;
    border-radius: 999px;
}
.cleerly-cta--card .cleerly-cta__rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    color: #f59e0b;
    font-size: 0.95rem;
    line-height: 1;
}
.cleerly-cta--card .cleerly-cta__btn {
    background: #EE4035;
    color: #fff !important;
    font-size: 15px;
    padding: 14px 28px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(238, 64, 53, 0.28);
    animation: cleerly-pulse-accent 2.8s infinite ease-in-out;
}
.cleerly-cta--card .cleerly-cta__btn:hover {
    background: #d63027;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(238, 64, 53, 0.42);
    animation: none;
}
.cleerly-cta--card .cleerly-cta__badge {
    color: var(--cta-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cleerly-cta--card .cleerly-cta__badge::before {
    content: '✓';
    color: var(--cta-success);
    font-weight: 800;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .cleerly-cta {
        margin: 28px 0;
    }

    /* Bandeaux : empilent en column, bouton full width */
    .cleerly-cta--bandeau,
    .cleerly-cta--bandeau-orange,
    .cleerly-cta--bandeau-light {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 26px 22px;
        gap: 18px;
    }
    .cleerly-cta--bandeau .cleerly-cta__titre,
    .cleerly-cta--bandeau-orange .cleerly-cta__titre,
    .cleerly-cta--bandeau-light .cleerly-cta__titre {
        font-size: 1.2rem;
    }
    .cleerly-cta--bandeau .cleerly-cta__texte,
    .cleerly-cta--bandeau-orange .cleerly-cta__texte,
    .cleerly-cta--bandeau-light .cleerly-cta__texte {
        font-size: 0.92rem;
        margin-left: auto;
        margin-right: auto;
    }
    .cleerly-cta--bandeau .cleerly-cta__action,
    .cleerly-cta--bandeau-orange .cleerly-cta__action,
    .cleerly-cta--bandeau-light .cleerly-cta__action {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    .cleerly-cta--bandeau .cleerly-cta__btn,
    .cleerly-cta--bandeau-orange .cleerly-cta__btn,
    .cleerly-cta--bandeau-light .cleerly-cta__btn {
        width: 100%;
        max-width: none;
        justify-content: center;
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    /* Editorial : padding réduit */
    .cleerly-cta--editorial {
        padding: 22px 22px 22px 24px;
        border-left-width: 4px;
    }
    .cleerly-cta--editorial .cleerly-cta__titre {
        font-size: 1.15rem;
    }
    .cleerly-cta--editorial .cleerly-cta__texte {
        font-size: 0.92rem;
    }
    .cleerly-cta--editorial .cleerly-cta__action {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    .cleerly-cta--editorial .cleerly-cta__btn {
        width: 100%;
        max-width: none;
        justify-content: center;
    }

    /* Card : icône au-dessus, contenu empilé */
    .cleerly-cta--card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
        gap: 16px;
    }
    .cleerly-cta--card .cleerly-cta__icone-wrap {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    .cleerly-cta--card .cleerly-cta__icone-wrap svg {
        width: 24px;
        height: 24px;
    }
    .cleerly-cta--card .cleerly-cta__titre {
        font-size: 1.1rem;
    }
    .cleerly-cta--card .cleerly-cta__action {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    .cleerly-cta--card .cleerly-cta__btn {
        width: 100%;
        max-width: none;
        justify-content: center;
    }
}

/* ==========================================================================
   Wrapper d'aperçu dans l'éditeur
   ========================================================================== */
.cleerly-cta-preview-wrap {
    padding: 12px;
    background: #f6f7f9;
    border-radius: 8px;
    border: 1px dashed #d6d8de;
}

/* Fix SVG icône qui explose dans l'éditeur Gutenberg (wp_block, posts, etc.) */
.cleerly-cta__icone-wrap {
    overflow: hidden;
    min-width: 56px;
    min-height: 56px;
    max-width: 56px;
    max-height: 56px;
}
.cleerly-cta__icone-wrap svg {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    display: block;
}
/* Idem en mobile */
@media (max-width: 768px) {
    .cleerly-cta__icone-wrap {
        min-width: 48px;
        min-height: 48px;
        max-width: 48px;
        max-height: 48px;
    }
    .cleerly-cta__icone-wrap svg {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
    }
}
