.safa-service-duo {
    --safa-navy: #132E4F;
    --safa-yellow: #E4CD18;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 60px;
    width: 100%;
    font-family: Inter, var(--e-global-typography-text-font-family), Arial, sans-serif;
}

.safa-service-duo,
.safa-service-duo * {
    box-sizing: border-box;
}

.safa-service-duo__card {
    position: relative;
    min-width: 0;
    min-height: 330px;
    overflow: visible;
    background: #E7EAEE;
    border-radius: 24px;
}

/*
 * Le panneau a une hauteur verrouillée : le texte ne peut plus pousser
 * l'icône ni modifier la géométrie du composant.
 */
.safa-service-duo__panel {
    position: absolute;
    z-index: 2;
    left: -7%;
    top: 50%;
    transform: translateY(-50%);
    width: 62%;
    height: 230px;
    padding: 34px 34px 30px;
    display: grid;
    grid-template-rows: minmax(2.55em, auto) minmax(4.65em, auto) auto;
    align-content: start;
    background: #E4CD18;
    border-radius: 22px;
}

.safa-service-duo__title {
    margin: 0;
    color: var(--safa-navy);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.safa-service-duo__description {
    margin-top: 10px;
    color: #536176;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.safa-service-duo__button {
    align-self: end;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 20px;
    border-radius: 4px;
    background: var(--safa-navy);
    color: var(--safa-yellow) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

.safa-service-duo__button:hover {
    transform: translateY(-1px);
    background: #0A335B;
    color: #fff !important;
}

/* L'icône est ancrée à la carte, pas au panneau texte. */
.safa-service-duo__visual {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 5%;
    width: var(--safa-card-visual-width, 39%);
    height: 82%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.safa-service-duo__visual img {
    display: block;
    width: var(--safa-card-img-width, 190px);
    max-width: none;
    max-height: none;
    height: auto;
    object-fit: contain;
    transform: translate(var(--safa-card-img-x, 0px), var(--safa-card-img-y, 0px));
    transform-origin: center center;
}

@media (max-width: 1024px) {
    .safa-service-duo {
        gap: 30px;
    }
    .safa-service-duo__panel {
        left: -3%;
        padding: 28px 26px;
    }
    .safa-service-duo__visual {
        right: 3%;
    }
}

@media (max-width: 767px) {
    .safa-service-duo {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .safa-service-duo__card {
        min-height: 420px;
        overflow: hidden;
    }

    .safa-service-duo__panel {
        position: absolute;
        left: 6%;
        top: 22px;
        transform: none;
        width: 88% !important;
        height: 225px !important;
        padding: 28px;
    }

    .safa-service-duo__visual {
        top: auto;
        right: 0;
        bottom: 16px;
        transform: none;
        width: 100%;
        height: 150px;
    }

}

/* =========================================================
 * Popup « À savoir » — SAFA Duo Services
 * ======================================================= */
.safa-service-duo__button--popup {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.safa-service-popup,
.safa-service-popup * {
    box-sizing: border-box;
}

.safa-service-popup {
    --safa-popup-width: 610px;
    --safa-popup-accent: #FCD116;
    --safa-popup-navy: #0A335B;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
    font-family: Inter, var(--e-global-typography-text-font-family), Arial, sans-serif;
}

.safa-service-popup.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.safa-service-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 24, 46, .67);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
}

.safa-service-popup__dialog {
    position: relative;
    z-index: 2;
    width: min(var(--safa-popup-width), calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: 38px 40px 0;
    border-radius: 22px;
    background: #fff;
    color: #4C5D70;
    border: 1px solid rgba(10, 51, 91, .11);
    box-shadow: 0 28px 80px rgba(4, 25, 48, .24);
    transform: translateY(16px) scale(.985);
    transition: transform .24s ease;
    scrollbar-width: thin;
}

.safa-service-popup.is-open .safa-service-popup__dialog {
    transform: translateY(0) scale(1);
}

.safa-service-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #DCE5ED;
    border-radius: 50%;
    background: #fff;
    color: var(--safa-popup-navy);
    font: 400 25px/32px Arial, sans-serif;
    cursor: pointer;
    transition: background-color .18s ease, transform .18s ease;
}

.safa-service-popup__close:hover {
    background: #F5F8FA;
    transform: rotate(3deg);
}

.safa-service-popup__body {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.safa-service-popup__visual {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 34px;
}

.safa-service-popup__visual[hidden] {
    display: none !important;
}

.safa-service-popup__image {
    display: block;
    width: 94px;
    height: 94px;
    object-fit: contain;
}

.safa-service-popup__eyebrow {
    margin: 0 0 8px;
    color: #92A4B8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.safa-service-popup__accent {
    display: block;
    width: 47px;
    height: 6px;
    margin-bottom: 14px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--safa-popup-accent) 0 72%, rgba(252, 209, 22, .25) 72% 100%);
}

.safa-service-popup__title {
    margin: 0 0 13px;
    color: var(--safa-popup-navy);
    font-size: clamp(25px, 2.1vw, 31px);
    font-weight: 750;
    line-height: 1.15;
}

.safa-service-popup__text {
    margin: 0;
    color: #596778;
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.65;
}

.safa-service-popup__points {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.safa-service-popup__points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #5D6876;
    font-size: 14px;
    line-height: 1.45;
}

.safa-service-popup__check {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--safa-popup-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.safa-service-popup__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 30px;
    margin-left: 138px;
    padding: 18px 0 24px;
    border-top: 1px solid #E6ECF1;
}

.safa-service-popup__primary,
.safa-service-popup__secondary {
    min-height: 38px;
    padding: 9px 19px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.safa-service-popup__primary {
    border: 1px solid var(--safa-popup-navy);
    background: var(--safa-popup-navy);
    color: #fff;
    box-shadow: 0 6px 16px rgba(10, 51, 91, .14);
}

.safa-service-popup__secondary {
    border: 1px solid transparent;
    background: transparent;
    color: var(--safa-popup-navy);
}

.safa-service-popup__primary:hover {
    filter: brightness(1.08);
}

.safa-service-popup__secondary:hover {
    background: #F4F7F9;
}

html.safa-popup-open,
body.safa-popup-open {
    overflow: hidden !important;
}

@media (max-width: 767px) {
    .safa-service-popup {
        padding: 16px;
    }

    .safa-service-popup__dialog {
        width: min(var(--safa-popup-width), calc(100vw - 24px));
        max-height: calc(100vh - 24px);
        padding: 30px 24px 0;
        border-radius: 19px;
    }

    .safa-service-popup__body {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 17px;
    }

    .safa-service-popup__visual {
        padding-top: 37px;
    }

    .safa-service-popup__image {
        width: 67px;
        height: 67px;
    }

    .safa-service-popup__title {
        font-size: 23px;
    }

    .safa-service-popup__text {
        font-size: 14.5px;
        line-height: 1.58;
    }

    .safa-service-popup__footer {
        margin-left: 89px;
        margin-top: 24px;
        padding-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .safa-service-popup__body {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .safa-service-popup__visual {
        justify-content: flex-start;
        padding-top: 0;
    }

    .safa-service-popup__image {
        width: 64px;
        height: 64px;
    }

    .safa-service-popup__footer {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .safa-service-popup,
    .safa-service-popup__dialog,
    .safa-service-popup__close {
        transition: none !important;
    }
}
