/* =========================
   Variables (facile à ajuster)
========================= */
:root{
    --fd-red: #d1122b;          /* accent proche d'un rouge e-commerce */
    --fd-red-2: #b80f25;
    --fd-text: #1f2937;         /* gris très foncé */
    --fd-muted: #6b7280;        /* gris */
    --fd-border: #e5e7eb;       /* gris clair */
    --fd-bg: #ffffff;
    --fd-soft: #f8fafc;         /* fond doux */
    --fd-shadow: 0 14px 40px rgba(0,0,0,.18);
    --fd-radius: 14px;
    --fd-radius-sm: 10px;
}


/* =========================
   Dialog / popup
========================= */
.fd_popup-spareparts-dialog{
    border: 0;
    padding: 0;
    width: min(900px, calc(100vw - 32px));
    border-radius: var(--fd-radius);
    background: var(--fd-bg);
    box-shadow: var(--fd-shadow);
    color: var(--fd-text);
}

.fd_popup-spareparts-dialog::backdrop{
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

.parent-container{
    display: flex;
    flex-direction: column;
    max-height: min(86vh, 90vh);
}

.dialog-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--fd-border);
    background: linear-gradient(#fff, #fff);
    border-top-left-radius: var(--fd-radius);
    border-top-right-radius: var(--fd-radius);
    button {
        min-height: 46px;
        height: 100%;
        border: 1px solid #DDDFE7;
        border-radius: 8px;
        background-color: #FFFFFF;
        padding: 0 8px;
        display: block;
        margin-bottom: 0;
    }
}

/* Bouton fermer */
.closeButton{
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--fd-border);
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    position: relative;
}

.closeButton::before{
    content: "×";
    font-size: 26px;
    line-height: 1;
    color: var(--fd-text);
    transform: translateY(-1px);
}

.closeButton:hover{
    transform: translateY(-1px);
    border-color: #d1d5db;
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

.closeButton:active{
    transform: translateY(0);
    box-shadow: none;
}

/* Zone contenu */
.dialog-body{
    padding: 18px 30px 30px;
    overflow: auto;
    background: var(--fd-soft);
}

/* Footer existant */
.dialog-footer{
    padding: 14px 18px;
    border-top: 1px solid var(--fd-border);
    background: #fff;
    border-bottom-left-radius: var(--fd-radius);
    border-bottom-right-radius: var(--fd-radius);
    text-align: center;
}

.dialog-footer .text{
    font-weight: 700;
    color: #183157;
    text-align: center;
    margin: 0;
}

/* =========================
   Funnel steps
========================= */
.funnel-step{
    display: none;
    background: transparent;
}

.funnel-step.active{
    display: block;
}

.funnel-title{
    font: normal normal bold 14px/22px Karla;
    letter-spacing: 0px;
    color: #1C2123;
    position: absolute;
    margin-top: 26px;
    top: 50%;
}

/* Grille des choix */
.funnel-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
    overflow: scroll;
    max-height: 500px;
}

/* =========================
   Option cards (avec photo)
========================= */
.option-card{
    appearance: none;
    border: 1px solid var(--fd-border);
    background: #fff;
    border-radius: var(--fd-radius-sm);
    padding: 0;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: start;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);

    &.start-option {
        justify-content: center;
        align-items: center;
        display: flex;
        min-height: 170px;
        .option-label {
            text-align: center;
        }
    }
}


.option-card:hover{
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 12px 26px rgba(0,0,0,.10);
}

/* Zone image */
.option-media{
    display: block;
    background: #fff;
    position: relative;
    justify-items: center;
}

.option-media img{
    width: auto;
    height: 100%;
    object-fit: cover; /* super pour des photos */
    display: block;
    max-width: 220px;
    max-height: 220px;
}

/* Zone texte */
.option-label{
    padding: 16px;
    display: grid;
    gap: 4px;
}

.option-name{
    font-weight: 800;
    font-size: 15px;
}

.option-desc{
    font-size: 12.5px;
    color: var(--fd-muted);
}

/* État sélectionné */
.option-card.selected{
    border-color: rgba(209, 18, 43, .55);
    box-shadow: 0 12px 28px rgba(209, 18, 43, .20);
    transform: translateY(-1px);
}

/* Liseré/Badge rouge en sélection */
.option-card.selected .option-media::after{
    content: "Sélectionné";
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--fd-red);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 10px 20px rgba(0,0,0,.15);
}

.option-card:focus-visible{
    outline: 3px solid rgba(209, 18, 43, .25);
    outline-offset: 2px;
}
.fd_popup-spareparts-dialog {
    #recognizeBarnumDlLink {
        cursor:pointer;
        font-weight: 500;
        color: #183157;
        text-align: center;
    }

    .wrapper-stepper {
        width: 100%;
        border-radius: 6px;
        margin-bottom: 50px;
        /*background-color: #fff;*/
        /*border: 1px solid silver;*/
    }

    .wrapper-stepper .container {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        --stepper-progress: 0%;
    }

    .wrapper-stepper .container::before {
        content: '';
        position: absolute;
        top: 50%;
        width: 75%;
        margin: 0 auto;
        height: 2px;
        /*z-index: -1;*/
        /*background-color: #ccc;*/
        background: linear-gradient(
                to right,
                #0bcc6c 0%,
                #0bcc6c var(--stepper-progress),
                #ccc var(--stepper-progress),
                #ccc 100%
        );    }

    .wrapper-stepper .item label {
        display: inline-block;
        width: 100%;
        position: relative;
        z-index: 2;
        padding: 10px 0;
    }

    .wrapper-stepper .item .title {
        display: block;
        color: #a1a0a0;
        font-size: 0.9rem;
        padding-top: 10px;
    }

    .wrapper-stepper .item .line {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #ddd;
    }

    .wrapper-stepper .item {
        width: 50%;
        display: flex;
        padding: 10px 0;
        align-items: center;
        justify-content: center;
        text-align: center;
        z-index: 1;
        flex-direction: column;
        /*background-color: #e6e6e6;*/
    }

    .wrapper-stepper .item.active .title {
        color: #303030;
    }

    .wrapper-stepper .item.active button {
        background: #183157;
        border-color: #183157;
        color: #fff;
    }

    .wrapper-stepper .item.done button {
        background: #0bcc6c;      /* vert */
        border-color: #0bcc6c;
        color: #fff;
    }

    .wrapper-stepper button {
        border-radius: 50%;
        width: 30px;
        text-align: center;
        height: 30px;
        padding: 0;
        background-color: #ababab;
        color: #fff;
        border: 0;
        cursor: default;
    }
}
#fd_popup-spareparts-all .option-card .option-label {
    text-align: center;
}
.result-div {
    display:flex;
    .result-div-left {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .result-pre2016-notice {
        box-sizing: border-box;
        margin: 0;
        padding: 12px 14px;
        font: normal normal 600 14px/1.4 Karla, sans-serif;
        color: #721c24;
        background-color: #f8d7da;
        border-radius: 8px;
    }
    .result-pre2016-notice a {
        color: inherit;
        font-weight: 700;
        text-decoration: underline;
    }
    .label-result {
        text-align: left;
        font: normal normal bold 16px/22px Karla;
        letter-spacing: 0px;
        color: #1C2123;
    }
    .option-card-result {
        background: #fff;
        padding: 30px;
        border-radius: 10px;
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;
        gap: 16px 20px;

        /* Colonne gauche : moitié haute = titre (aligné en bas), moitié basse = message pré-2016 */
        .result-label-notice-column {
            display: flex;
            flex-direction: column;
            flex: 0 1 35%;
            max-width: 320px;
            min-height: 220px;
            align-self: stretch;
        }

        .result-label-half {
            flex: 1 1 50%;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            min-height: 0;
        }

        .result-notice-half {
            flex: 1 1 50%;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: stretch;
            min-height: 0;
        }

        .result-pre2016-notice {
            width: 100%;
            max-width: none;
            text-align: left;
        }

        /* Sans message pré-2016 : pas de zone basse, titre seul en haut */
        &:not(.option-card-result--pre2016) .result-notice-half {
            display: none;
        }

        &:not(.option-card-result--pre2016) .result-label-half {
            flex: 1 1 auto;
            justify-content: center;
        }

        &:not(.option-card-result--pre2016) .result-label-notice-column {
            min-height: 0;
        }

        .option-card-result-main {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 0;
        }

        .result-gamme-div {
            border: solid #e5e7eb 1px;
            border-radius: 15px;
            padding: 6px;
            margin-left: 0;
        }
    }
    .result-div-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 0 0 30px ;
        #dp_popup_show_result {
            width: 245px;
            height: 40px;
            background: #FED417;
            border-radius: 4px;
            align-content: center;
            text-align: center;
            font: normal normal bold 14px/22px Karla;
            letter-spacing: 0px;
            color: #1C2123;
            text-transform: uppercase;

            &:hover{
                background: #CC2028 !important;
                color: white;
                border: 1px solid #CC2028;
                svg path{
                    fill: #FFF;
                }
                .elementor-icon-list-text{
                    color:  white;
                }
            }
        }
        #dp_popup_btn_retry {
            margin-top:10px;
            width: 245px;
            height: 40px;
            background: #183157 0% 0% no-repeat padding-box;
            border-radius: 4px;
            align-content: center;
            text-align: center;
            font: normal normal bold 14px/22px Karla;
            letter-spacing: 0px;
            color: #FFFFFF;
            text-transform: uppercase;

            &:hover{
                background: #FFF !important;
                color: #183157;
                border: 1px solid #183157;
                svg path{
                    fill: #183157;
                }
            }
        }
    }
}

/* =========================
   Responsive
========================= */
@media (max-width: 900px){
    .funnel-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wrapper-stepper {
        .item {
            .funnel-title { text-align: center; display: none}
            &.active .funnel-title {display: block; width: 100%; left: 0;}
        }
    }
    .option-card{ flex-direction: row; align-items: normal; height: 152px}
    .result-div {
        flex-direction: column;
        justify-content: space-evenly;
        min-height: 350px;
        .result-div-left {
            width: 100%;
            align-items: stretch;
        }
        .option-card-result {
            padding: 0 0 50px 0;
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
            background: transparent;
            flex: 0;

            /* Ordre mobile : titre → visuel → message (display:contents sur la colonne) */
            .result-label-notice-column {
                display: contents;
            }

            .result-label-half {
                order: 1;
                flex: none;
                min-height: 0;
                justify-content: flex-start;
            }

            .option-card-result-main {
                order: 2;
                width: 100%;
                flex-direction: column;
            }

            .result-notice-half {
                order: 3;
                flex: none;
                min-height: 0;
                align-items: stretch;
            }

            .result-pre2016-notice {
                width: 100%;
                max-width: 100%;
                text-align: center;
            }

            &:not(.option-card-result--pre2016) .result-notice-half {
                display: none;
            }

            .label-result {
                text-align: center;
            }

            .result-gamme-div {
                display: flex;
                align-items: center;
                justify-content: space-around;
                width: 90%;
                background: #fff;
                margin: 0;
                padding: 12px;
                .option-media {
                    img {
                        max-height: 130px;
                    }
                }
                .option-label {
                    padding: 6px;
                }
            }
        }
        .result-div-btn {
            padding:0;
            align-items: center;
        }
    }
}

@media (max-width: 560px){
    .dialog-body{ padding: 14px 14px 6px; }
    .dialog-footer{ padding: 12px 14px; }
    .funnel-grid{ grid-template-columns: 1fr; max-height: 400px;}
    .option-card {
        height: 152px;

        .option-media img {
            max-width: 130px;
            max-height: 130px;
        }
    }
}

@media (min-width: 901px){
    .funnel-grid{
        /* 3 colonnes fixes de 210px (et centrées) */
        grid-template-columns: repeat(auto-fit, 220px);
        justify-content: center; /* centre la grille si l'espace est plus large */
    }

    .option-card{
        width: 220px;
        height: 300px;
        grid-template-rows: 220px 1fr; /* image + texte (texte prend le reste) */
    }

    #fd_popup-spareparts-all .option-card{
        height: 270px;
    }

    .option-media{
        height: 220px; /* cohérent avec la row au-dessus */
    }
    .label-result {
        min-width: 253px;
    }
    .option-media img{
        width: 100%;
        height: 100%;
        object-fit: cover;

    }
}

#Calque_1 {
    width: 20px;
}