/* ============================================================
   BLOC ÉCOSYSTÈME
   ============================================================ */

.ecosysteme-aucoffre {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 0 21px rgba(51, 122, 183, 0.2);
    min-height: 450px;
}

/* Border shine animé */
.ecosysteme-aucoffre {
    --border-color: rgba(255, 255, 255, 0);
    --glow-color: rgba(51, 122, 183, 1);
    --arc-start: 60%;
    --arc-peak: 65%;
    --arc-end: 70%;
    --gradient-angle: 0deg;

    border: 2px solid transparent;
    background:
        linear-gradient(var(--color-fond-bleu, #E2F0FF), var(--color-fond-bleu, #E2F0FF)),
        conic-gradient(
            from var(--gradient-angle, 0deg),
            var(--border-color) var(--arc-start),
            var(--glow-color) var(--arc-peak),
            var(--border-color) var(--arc-end),
            var(--border-color) 100%
        );
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    animation: border-spin 5s linear infinite;
}

@property --gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes border-spin {
    to { --gradient-angle: 360deg; }
}

/* Roue orbitale */
.ew-wrap {
    position: absolute;
    right: 25px;
    bottom: -50px;
    width: 450px;
    height: 450px;
    margin: 0 auto;
}

.ew-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--color-primary) 10%, transparent);
    animation: ew-spin 14s linear infinite, ew-bounce 2s ease-in-out infinite alternate;
    pointer-events: none;
    background: #D6E9FF;
}

.ew-wrap.paused .ew-ring {
    animation-play-state: paused;
}

.ew-center {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 500px;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 5;
    padding: 0;
}

.ew-node {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ew-node-logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ew-node:hover .ew-node-logo {
    transform: scale(1.12);
}

.ew-node-logo img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
}

/* Tooltips */
.ew-tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    width: 250px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.ew-tooltip.visible { opacity: 1; }

.ew-tooltip strong {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #0e2340;
    margin-bottom: 4px;
    font-family: "Cabinet";
}

.ew-tooltip p {
    font-size: 16px;
    line-height: 1.5;
    color: #555;
    margin: 0;
}

@keyframes ew-bounce { to { transform: scale(1.025); } }
@keyframes ew-spin   { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1100px) {
    .ecosysteme-aucoffre {
        flex-direction: column;
        min-height: 750px;
        padding: 32px;
    }

    .ecosysteme-aucoffre > .grid-6 {
        width: 100%;
    }

    .ew-wrap {
        right: 50%;
        transform: translateX(50%);
    }
}

@media (max-width: 600px) {
    .ew-wrap {
        scale: 0.7;
        right: calc(50% * 0.65);
        transform: translateX(50%) !important;
    }
}