/* =====================================================
   MODULE AFFILIATION – STYLE GLOBAL
   ===================================================== */

/* 1. CONTENEUR PRINCIPAL */
.lev-product-wrapper {
    position: relative;
    margin: 40px 0;
    box-sizing: border-box;
    font-family: inherit;
}

/* 2. CARTE (Base commune) */
.lev-product-card {
    display: flex;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-left: 5px solid #49a6ed;
    border-radius: 8px;
    padding: 28px 32px; /* Padding par défaut OK pour Groupes */
    box-shadow: 0 10px 25px rgba(73, 166, 237, 0.15);
    position: relative;
    transition: transform 0.2s;
    overflow: visible !important; 
    flex-direction: column; 
}

.lev-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(73, 166, 237, 0.25);
}

/* 3. EXCEPTION 1 : Module Horizontal Solo */
.lev-product-wrapper:not(.lev-vertical-context) .lev-product-card {
    padding: 0 !important;
}

/* 4. EXCEPTION 2 : Module Vertical Solo COMPLET */
.lev-product-card.lev-vertical-complete {
    padding: 0 !important; 
    height: 100%;
    justify-content: space-between;
}

/* 5. PAS D'EXCEPTION POUR LE GROUPE : .lev-vertical garde le padding */
.lev-product-card.lev-vertical {
    padding: 28px 24px 32px !important;
    height: 100%;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

/* =====================================================
   CONTENU INTERNE
   ===================================================== */
.lev-product-main {
    padding: 28px 32px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
}

/* SÉCURITÉ HORIZONTALE */
.lev-product-wrapper:not(.lev-vertical-context) .lev-product-main {
    flex-direction: row !important;
    align-items: stretch !important;
}

/* Vertical Solo */
.lev-product-main.lev-vertical-main {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 28px 24px 32px;
}

/* =====================================================
   ELEMENTS COMMUNS
   ===================================================== */
.lev-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lev-product-image img {
    max-width: 170px;
    height: auto;
    display: block;
    margin: 0;
}

.lev-product-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    color: #111;
    width: 100%;
}

/* Ajustements Vertical */
.lev-product-card.lev-vertical .lev-product-title,
.lev-product-card.lev-vertical-complete .lev-product-title {
    font-size: 19px;
    margin: 0 0 25px !important;
}

.lev-product-card.lev-vertical .lev-product-image,
.lev-product-card.lev-vertical-complete .lev-product-image {
    margin-top: 45px;
    margin-bottom: 20px;
    min-height: 140px;
}
.lev-product-card.lev-vertical .lev-product-image img,
.lev-product-card.lev-vertical-complete .lev-product-image img {
    max-height: 120px;
    margin: 0 auto;
}

/* CTA */
.lev-product-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.lev-product-wrapper:not(.lev-vertical-context) .lev-product-cta {
    width: auto !important;
}
.lev-product-cta a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 56px !important;
    padding: 0 32px !important;
    margin: 0 !important;
    line-height: normal !important;
    background: #2ecc71; 
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 12px;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s;
    animation: lev-cta-halo 3s infinite;
}
.lev-product-cta a:hover {
    background: #27ae60;
    transform: translateY(-2px);
    animation-play-state: paused;
}

/* Ajustement CTA Vertical */
.lev-product-card.lev-vertical .lev-product-cta a,
.lev-product-card.lev-vertical-complete .lev-product-cta a {
    height: 52px;
    width: 100%;
    white-space: normal;
}

/* Horizontal Elements */
.lev-product-wrapper:not(.lev-vertical-context) .lev-product-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 30px;
}
.lev-product-wrapper:not(.lev-vertical-context) .lev-product-separator {
    width: 1px;
    background: #e6e6e6;
    margin: 0 30px;
    flex-shrink: 0;
}

/* =====================================================
   GRILLE COMPARATIVE
   ===================================================== */
.lev-products-grid {
    display: flex !important;
    gap: 28px;
    margin: 60px 0;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}
.lev-products-grid > .lev-product-wrapper.lev-vertical-context {
    flex: 1 1 0;
    min-width: 0;
    max-width: none !important;
    float: none !important;
    position: relative;
    margin: 0;
}

/* =====================================================
   ÉTIQUETTES & BADGES
   ===================================================== */
.lev-product-wrapper .lev-product-toplabel {
    position: absolute;
    top: -12px;
    left: 18px;
    background: #ffffff;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #49a6ed;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    z-index: 10;
    margin: 0 !important;
}
.lev-vertical-context .lev-badge + .lev-product-toplabel {
    top: 35px !important;
    left: 18px !important;
    right: auto !important;
    z-index: 9;
    border: 1px solid #f0f0f1;
    box-shadow: none;
}
.lev-badge {
    position: absolute;
    top: -15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    color: #ffffff;
    white-space: nowrap;
    z-index: 12;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}
.lev-badge::before {
    content: attr(data-icon);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-size: 14px;
}
.lev-badge-heart { background: linear-gradient(135deg, #ff5f6d, #e74c3c); animation: lev-pulse 2.5s infinite; }
.lev-badge-value { background: linear-gradient(135deg, #6fcf97, #2ecc71); }
.lev-badge-editor { background: linear-gradient(135deg, #5f72be, #2c3e50); }

/* =====================================================
   AVIS EXPERT
   ===================================================== */
.lev-expert-review {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e1e8ed;
    line-height: 0 !important;
}
.lev-expert-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    min-height: 45px;
}
.lev-expert-text cite {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-style: italic;
    font-size: 15px !important;
    line-height: 1.3 !important;
    color: #333;
    text-align: right;
}
.lev-expert-avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    object-fit: cover;
    display: block;
    margin: 0 !important;
}
/* Centrage Expert pour Vertical Solo */
.lev-vertical-main .lev-expert-review {
    justify-content: center !important;
    text-align: center !important;
    width: 100%;
}
.lev-vertical-main .lev-expert-text {
    align-items: center !important;
    text-align: center !important;
}

/* =====================================================
   BANDEAU COACHING
   ===================================================== */
.lev-coaching-bar {
    background: #eef8ff !important; 
    border-top: 1px solid #cceeff !important;
    padding: 12px 32px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important; 
    text-align: left !important;
    gap: 15px;
    font-size: 15px;
    color: #506070;
}
.lev-coaching-icon {
    font-size: 26px;
    line-height: 1;
    width: 26px;
    min-width: 26px;
    height: 26px;
    display: inline-block;
    margin-top: -3px;
}
.lev-coaching-content { line-height: 1.4; flex: 0 1 auto; }
.lev-coaching-content strong {
    color: #1a3a5a !important;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    margin-right: 5px;
    text-transform: none;
}
.lev-coaching-link {
    text-decoration: none !important;
    color: #2ecc71 !important; 
    font-weight: 800 !important;
    font-size: 15px;
    border-bottom: 2px solid #2ecc71 !important;
    margin-left: 10px !important;
    margin-right: 0 !important;
    white-space: nowrap;
    transition: all 0.2s;
}
.lev-coaching-link:hover { color: #27ae60 !important; border-color: #27ae60 !important; }

/* OVERRIDE POUR LE MODULE VERTICAL SOLO : TEXTE ET LIEN EMPILÉS */
.lev-product-card.lev-vertical-complete .lev-coaching-bar {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 10px;
}
.lev-product-card.lev-vertical-complete .lev-coaching-link {
    margin-left: 0 !important;
    border-bottom: 2px solid #2ecc71 !important;
}

/* ANIMATION CTA */
@keyframes lev-cta-halo {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
@keyframes lev-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .lev-products-grid { flex-direction: column; gap: 40px; }
    .lev-product-card.lev-vertical .lev-product-image,
    .lev-product-card.lev-vertical-complete .lev-product-image { margin-top: 10px; }
    .lev-product-wrapper.lev-vertical-context { margin-bottom: 20px; }
    .lev-product-wrapper.lev-vertical-context .lev-product-toplabel, .lev-badge { position: absolute !important; }
}

@media (max-width: 768px) {
    /* Horizontal devient vertical sur mobile */
    .lev-product-main { flex-direction: column; align-items: center; text-align: center; }
    .lev-product-wrapper:not(.lev-vertical-context) .lev-product-main { flex-direction: column !important; }

    .lev-product-wrapper:not(.lev-vertical-context) .lev-product-image { margin-bottom: 16px; }
    .lev-product-wrapper:not(.lev-vertical-context) .lev-product-content { padding: 0; margin-bottom: 16px; justify-content: center; text-align: center; }
    .lev-product-wrapper:not(.lev-vertical-context) .lev-product-cta { width: 100% !important; margin-top: 8px; }
    .lev-product-wrapper:not(.lev-vertical-context) .lev-product-cta a { width: 100%; }
    
    .lev-expert-review { justify-content: center; }
    .lev-expert-text { text-align: center; align-items: center; }
    
    .lev-coaching-bar {
        flex-direction: column !important;
        text-align: center !important;
        justify-content: center !important;
        gap: 10px;
        padding: 15px !important;
    }
    .lev-coaching-icon { display: block !important; margin: 0 auto 5px auto !important; }
    .lev-coaching-link { margin: 5px 0 0 0 !important; display: inline-block; }
}