/**
 * RD Widget Styles
 *
 * Styles pour le widget Elementor rd-widget
 * avec barre orange sinueuse et 3 points clés
 */

.rd-widget {
    width: 100%;
    background: #ffffff;
    position: relative;
    overflow: visible;
}

.rd-widget__container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

.rd-widget__content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
    position: relative;
    min-height: 580px;
    padding-bottom: 120px; /* Espace pour le point 1 et son texte en bas */
}

/* SVG avec la ligne sinueuse - décalé vers le bas pour plus d'espace avec le texte */
.rd-widget__content .rd-widget__path {
    position: absolute;
    top: 60px; /* Décalage vers le bas pour espacer de la description */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

/* Texte gauche - au-dessus de la ligne */
.rd-widget__left {
    position: relative;
    z-index: 3; /* Au-dessus de la ligne */
    padding-top: 20px;
    background: rgba(255, 255, 255, 0.95); /* Fond légèrement opaque pour que la ligne passe derrière */
}

.rd-widget__surtitre {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e3001a;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.rd-widget__titre {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    color: #333333;
    margin: 0 0 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.rd-widget__description {
    font-size: 15px;
    line-height: 1.6;
    color: #666666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.rd-widget__description p {
    margin: 0 0 16px 0;
}

.rd-widget__description p:last-child {
    margin-bottom: 0;
}

/* Points clés droite - conteneur de référence pour les points */
.rd-widget__right {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* Au-dessus de la ligne mais peut être sous le texte */
    pointer-events: none; /* Permet de cliquer à travers */
    overflow: visible; /* Permet aux points de déborder */
}

.rd-widget__number {
    font-size: 150px;
    font-weight: 700;
    fill: #c9c9c9;
    opacity: 0.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    user-select: none;
}

.rd-widget__line {
    filter: drop-shadow(0 2px 4px rgba(227, 0, 26, 0.2));
    stroke: #e3001a;
    stroke-width: 6;
}

/* Points clés - positionnés dynamiquement par JavaScript sur les cercles SVG */
.rd-widget__point {
    position: absolute;
    z-index: 2;
    pointer-events: auto;
    /* Position par défaut avant que JS ne calcule - sera écrasé */
    top: 50%;
    left: 50%;
    transform: translate(-50%, 0);
}

/* Nœud circulaire - masqué car on utilise les cercles SVG directement */
.rd-widget__node {
    display: none;
}

/* Contenu des points - positionné sous le trait rouge */
.rd-widget__point-content {
    padding: 20px;
    position: relative;
    z-index: 3;
    white-space: normal;
    width: 180px;
    margin-top: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ligne de connexion entre le cercle SVG et le texte */
.rd-widget__point::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 25px;
    background: #e3001a;
    z-index: 2;
    top: 0;
    left: 50%;
    margin-left: -1px;
}


.rd-widget__point-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #333333;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Phrase de conclusion - Positionnée tout en bas à droite */
.rd-widget__conclusion {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 4;
    text-align: left;
    max-width: 400px;
}

.rd-widget__conclusion-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #333333;
    font-weight: 500;
    font-style: italic;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    padding: 14px 20px;
    border-left: 4px solid #e3001a;
    border-radius: 4px;
}

/* Responsive Widget */

/* Écrans entre 1200px et 1400px - descente de la ligne */
@media (max-width: 1400px) and (min-width: 1201px) {
    .rd-widget__content {
        min-height: 580px;
        padding-bottom: 160px;
    }

    .rd-widget__content .rd-widget__path {
        top: 170px;
        height: calc(100% - 170px);
    }
}

/* Écrans moyens-grands (900px - 1200px) */
@media (max-width: 1200px) {
    .rd-widget__content {
        gap: 40px;
        min-height: 450px;
    }

    .rd-widget__content .rd-widget__path {
        top: 100px;
        height: calc(100% - 100px);
    }

    .rd-widget__titre {
        font-size: 32px;
    }

    .rd-widget__description {
        font-size: 14px;
    }

    .rd-widget__number {
        font-size: 120px;
    }

    .rd-widget__point-content {
        width: 150px;
        padding: 10px 14px;
    }

    .rd-widget__point-text {
        font-size: 14px;
    }

    .rd-widget__conclusion {
        max-width: 320px;
    }

    .rd-widget__conclusion-text {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* Écrans entre 900px et 1200px - la ligne doit descendre pour ne pas chevaucher le texte */
@media (max-width: 1200px) and (min-width: 901px) {
    .rd-widget__content {
        min-height: 600px;
        padding-bottom: 180px;
    }

    .rd-widget__content .rd-widget__path {
        top: 160px;
        height: calc(100% - 160px);
    }
}

/* Tablettes et petits écrans - passage en mode liste verticale */
@media (max-width: 900px) {
    .rd-widget {
        padding: 40px 20px;
    }

    .rd-widget__content {
        display: block;
        min-height: auto;
        max-height: none;
        padding-top: 0;
    }

    .rd-widget__content .rd-widget__path {
        top: 0;
        height: 100%;
    }

    .rd-widget__left {
        margin-bottom: 40px;
        background: transparent;
    }

    .rd-widget__right {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0;
    }

    .rd-widget__path {
        display: none;
    }

    .rd-widget__number {
        display: none;
    }

    .rd-widget__titre {
        font-size: 30px;
    }

    /* Layout vertical pour tablette/mobile */
    .rd-widget__point {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        display: flex;
        align-items: flex-start;
        gap: 15px;
        flex-direction: row;
    }

    .rd-widget__point::before {
        display: none;
    }

    .rd-widget__node {
        display: block;
        width: 14px;
        height: 14px;
        min-width: 14px;
        border-radius: 50%;
        background: #e3001a;
        border: 3px solid #ffffff;
        box-shadow: 0 2px 8px rgba(227, 0, 26, 0.3);
        margin-top: 4px;
    }

    .rd-widget__point-content {
        position: static !important;
        transform: none !important;
        margin-top: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        white-space: normal !important;
        text-align: left;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    .rd-widget__point-text {
        font-size: 16px;
        font-weight: 500;
    }

    .rd-widget__conclusion {
        position: static;
        margin-top: 30px;
        max-width: 100%;
    }

    .rd-widget__conclusion-text {
        font-size: 16px;
        padding: 16px 20px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .rd-widget {
        padding: 30px 15px;
    }

    .rd-widget__titre {
        font-size: 26px;
    }

    .rd-widget__surtitre {
        font-size: 12px;
    }

    .rd-widget__description {
        font-size: 14px;
    }

    .rd-widget__point-text {
        font-size: 15px;
    }

    .rd-widget__conclusion-text {
        font-size: 15px;
        padding: 14px 18px;
        border-left-width: 3px;
    }
}
