/* Import Poppins (Google Fonts) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ============================================
   TABLEAU FONCTIONNALITÉS CSE FINANCE
   ============================================ */

.cse-fonctions {
    --cse-violet: #6708FF;
    --cse-bleu-header: #D6EDFF;    /* Cloud berry 500 / 100% (Header) */
    --cse-zebra: #F0F6FF;          /* Cloud berry 200 / 10% (Lignes paires) */
    --cse-texte: #363636;
    
    font-family: 'Poppins', sans-serif;
    color: var(--cse-texte) !important;
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.cse-fonctions *,
.cse-fonctions *::before,
.cse-fonctions *::after {
    box-sizing: border-box;
}

/* --- TABLEAU --- */
.cse-fonctions__wrapper {
    position: relative;
    overflow: hidden;
}

/* Overlay fondu (visible en mode partiel) */
.cse-fonctions__wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 1) 100%
    );
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.cse-fonctions--complet .cse-fonctions__wrapper::after {
    opacity: 0;
}

.cse-fonctions__table {
    width: 100%;
    border-collapse: collapse !important; /* Collapse aide à tuer les espaces inter-bordures */
    border-spacing: 0;
    background: #fff;
    table-layout: fixed;
    border-radius: 16px;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    border: none !important;
}

/* Forcer la suppression des bordures d'Elementor */
.cse-fonctions__table th,
.cse-fonctions__table td {
    border: none !important;
}

.cse-fonctions__table th:nth-child(1),
.cse-fonctions__table td:nth-child(1) { width: 40%; }
.cse-fonctions__table th:nth-child(2),
.cse-fonctions__table td:nth-child(2) { width: 60%; }

/* --- HEADER --- */
.cse-fonctions__th {
    background: var(--cse-bleu-header) !important;
    padding: 24px 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-align: left; /* Aligné à gauche comme sur la maquette */
    color: var(--cse-texte) !important;
}

.cse-fonctions__table thead th:first-child {
    border-top-left-radius: 16px;
}

.cse-fonctions__table thead th:last-child {
    border-top-right-radius: 16px;
}

/* --- CELLULES --- */
.cse-fonctions__td {
    padding: 20px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cse-texte) !important;
    vertical-align: middle;
    background: #FFFFFF !important; /* Blanc par défaut pour écraser les styles du thème */
}

.cse-fonctions__td--titre {
    font-weight: 600;
}

/* Zebra striping (lignes alternées) */
.cse-fonctions__table tbody tr:nth-child(even) .cse-fonctions__td {
    background: var(--cse-zebra) !important;
}

/* --- LIGNES MASQUÉES PAR DÉFAUT --- */
.cse-fonctions__row--cachee {
    display: none;
}

.cse-fonctions--complet .cse-fonctions__row--cachee {
    display: table-row;
    animation: cse-fonctions-fadein 0.5s ease both;
}

@keyframes cse-fonctions-fadein {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- NOTE --- */
.cse-fonctions__note {
    margin-top: 24px;
    padding: 0 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--cse-texte) !important;
}

/* --- FOOTER (séparateur + bouton) --- */
.cse-fonctions__footer {
    margin-top: 32px;
    text-align: center;
}

.cse-fonctions__separateur {
    border: none;
    border-top: 1px solid var(--cse-violet) !important;
    margin: 0 0 24px 0;
}

/* Bouton outline (spécificité renforcée pour écraser Elementor) */
.cse-fonctions .cse-fonctions__replier,
.cse-fonctions button.cse-fonctions__replier {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    border: 1px solid var(--cse-violet) !important;
    border-radius: 5px !important;
    cursor: pointer;
    padding: 12px 28px !important;
    margin-top: 12px;
    font-family: 'Poppins', sans-serif !important;
    color: var(--cse-violet) !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: none !important;
    transition: background 0.25s ease, color 0.25s ease, gap 0.25s ease, box-shadow 0.25s ease;
}

.cse-fonctions .cse-fonctions__replier:hover,
.cse-fonctions button.cse-fonctions__replier:hover {
    background: var(--cse-violet) !important;
    background-color: var(--cse-violet) !important;
    color: #FFFFFF !important;
    gap: 14px;
    box-shadow: 0 4px 12px rgba(103, 8, 255, 0.25) !important;
}

.cse-fonctions .cse-fonctions__replier:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(103, 8, 255, 0.2) !important;
}

.cse-fonctions__replier-icone {
    display: inline-flex;
    font-size: 18px;
    line-height: 1;
}

/* ============================================
   TABLEAU FONCTIONNALITÉS CSE FINANCE (FLUIDE)
   ============================================ */

.cse-fonctions {
    --cse-violet: #6708FF;
    --cse-bleu-header: #D6EDFF; 
    --cse-zebra: #F0F6FF;       
    --cse-texte: #363636;
    
    font-family: 'Poppins', sans-serif;
    color: var(--cse-texte) !important;
    max-width: 1300px;
    margin: 0 auto;
    /* Padding fluide : diminue progressivement sur les petits écrans */
    padding: clamp(20px, 4vw, 40px) clamp(10px, 2vw, 20px);
    box-sizing: border-box;
}

.cse-fonctions *, .cse-fonctions *::before, .cse-fonctions *::after { box-sizing: border-box; }

.cse-fonctions__wrapper { position: relative; overflow: hidden; }

.cse-fonctions__wrapper::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,1) 100%);
    pointer-events: none; z-index: 2; transition: opacity 0.4s ease;
}
.cse-fonctions--complet .cse-fonctions__wrapper::after { opacity: 0; }

.cse-fonctions__table {
    width: 100%; border-collapse: collapse !important; border-spacing: 0;
    background: #fff; table-layout: fixed; border-radius: 16px; overflow: hidden;
    font-family: 'Poppins', sans-serif; border: none !important;
}

.cse-fonctions__table th, .cse-fonctions__table td { border: none !important; }
.cse-fonctions__table th:nth-child(1), .cse-fonctions__table td:nth-child(1) { width: 40%; }
.cse-fonctions__table th:nth-child(2), .cse-fonctions__table td:nth-child(2) { width: 60%; }

.cse-fonctions__th {
    background: var(--cse-bleu-header) !important;
    /* Padding et police fluides */
    padding: clamp(16px, 2vw, 24px) clamp(12px, 1.5vw, 20px);
    font-family: 'Poppins', sans-serif; font-weight: 600;
    font-size: clamp(14px, 1.5vw, 16px);
    text-align: left; color: var(--cse-texte) !important;
}

.cse-fonctions__td {
    /* Padding et police fluides */
    padding: clamp(14px, 2vw, 20px) clamp(12px, 1.5vw, 24px);
    font-family: 'Poppins', sans-serif;
    font-size: clamp(13px, 1.2vw, 14px);
    line-height: 1.5; color: var(--cse-texte) !important;
    vertical-align: middle; background: #FFFFFF !important;
}

.cse-fonctions__td--titre { font-weight: 600; }
.cse-fonctions__table tbody tr:nth-child(even) .cse-fonctions__td { background: var(--cse-zebra) !important; }
.cse-fonctions__row--cachee { display: none; }
.cse-fonctions--complet .cse-fonctions__row--cachee { display: table-row; animation: cse-fonctions-fadein 0.5s ease both; }

@keyframes cse-fonctions-fadein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.cse-fonctions__footer { margin-top: clamp(24px, 3vw, 32px); text-align: center; }
.cse-fonctions__separateur { border: none; border-top: 1px solid var(--cse-violet) !important; margin: 0 0 24px 0; }

.cse-fonctions .cse-fonctions__replier {
    background: #FFFFFF !important; border: 1px solid var(--cse-violet) !important;
    border-radius: 5px !important; cursor: pointer; padding: 12px 28px !important;
    font-family: 'Poppins', sans-serif !important; color: var(--cse-violet) !important;
    font-weight: 600 !important; font-size: 15px !important;
    display: inline-flex; align-items: center; gap: 10px; box-shadow: none !important;
    transition: all 0.25s ease;
}
.cse-fonctions .cse-fonctions__replier:hover {
    background: var(--cse-violet) !important; color: #FFFFFF !important; gap: 14px;
    box-shadow: 0 4px 12px rgba(103, 8, 255, 0.25) !important;
}
.cse-fonctions__replier-icone { display: inline-flex; font-size: 18px; line-height: 1; }

/* --- BASCULE MOBILE (CARTES) --- */
@media (max-width: 768px) {
    .cse-fonctions__wrapper::after { height: 120px; }
    .cse-fonctions__table, .cse-fonctions__table tbody, .cse-fonctions__table tr, .cse-fonctions__table td { display: block; width: 100% !important; }
    .cse-fonctions__table thead { display: none; }
    .cse-fonctions__table tr {
        margin-bottom: 16px; border: 1px solid var(--cse-bleu-header);
        border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    .cse-fonctions__table td:nth-child(1) {
        background: var(--cse-bleu-header) !important; font-weight: 600;
        padding: 12px 16px !important; border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }
    .cse-fonctions__table td:nth-child(2) { background: #FFFFFF !important; padding: 16px !important; }
    .cse-fonctions__row--cachee { display: none !important; }
    .cse-fonctions--complet .cse-fonctions__row--cachee { display: block !important; }
}