.ecm-ev-page {
    width: 100%;
    margin: 0 auto;
}

.ecm-ev-header {
    margin-bottom: 25px;
}

.ecm-ev-header h1 {
    margin-bottom: 10px;
}

.ecm-ev-intro {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.5;
}


/* =========================================================
   ONGLETS DES VUES
   ========================================================= */

.ecm-ev-document-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ecm-ev-document-button {
    padding: 10px 16px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
}

.ecm-ev-document-button:hover {
    background: #f4f4f4;
}

.ecm-ev-document-button.active {
    background: #2fb5d2;
    border-color: #2fb5d2;
    color: #fff;
}


/* =========================================================
   DOCUMENT
   ========================================================= */

.ecm-ev-document {
    display: none;
}

.ecm-ev-document.active {
    display: block;
}


/* =========================================================
   BARRE RECHERCHE / ZOOM
   ========================================================= */

.ecm-ev-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 15px;
}

.ecm-ev-search-wrapper {
    flex: 1;
    max-width: 600px;
}

.ecm-ev-search-wrapper label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.ecm-ev-search {
    width: 100%;
}

.ecm-ev-zoom-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ecm-ev-zoom-controls button {
    min-width: 48px;
}


/* =========================================================
   VIEWER
   ========================================================= */

.ecm-ev-viewer {
    position: relative;
    width: 100%;
    height: 650px;
    overflow: auto;
    margin-bottom: 25px;
    border: 1px solid #ddd;
    background: #fff;
}

.ecm-ev-image-stage {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.ecm-ev-image-transform {
    position: relative;
    display: inline-block;
    transform-origin: top left;
}

.ecm-ev-image {
    display: block;
    max-width: none;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}


/* =========================================================
   SVG / HOTSPOTS
   ========================================================= */

.ecm-ev-svg {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    pointer-events: none;
}

.ecm-ev-hotspot {
    fill: rgba(47, 181, 210, 0.10);
    stroke: rgba(47, 181, 210, 0.80);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    pointer-events: all;
    transition:
        fill 0.15s ease,
        stroke 0.15s ease;
}

.ecm-ev-hotspot:hover {
    fill: rgba(255, 193, 7, 0.30);
    stroke: rgba(255, 152, 0, 1);
}

.ecm-ev-hotspot.selected {
    fill: rgba(220, 53, 69, 0.35);
    stroke: rgba(220, 53, 69, 1);
    stroke-width: 5;
}


/* =========================================================
   PARTIE BASSE
   ========================================================= */

.ecm-ev-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 25px;
    align-items: start;
}

.ecm-ev-parts h2,
.ecm-ev-selection h2 {
    margin-top: 0;
}


/* =========================================================
   TABLEAU PIÈCES
   ========================================================= */

.ecm-ev-parts-table {
    width: 100%;
}

.ecm-ev-parts-table th {
    white-space: nowrap;
}

.ecm-ev-part-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.ecm-ev-part-row:hover {
    background: #f6f6f6;
}

.ecm-ev-part-row.selected {
    background: #fff3cd;
}

.ecm-ev-repere {
    width: 80px;
    font-weight: 700;
}

.ecm-ev-reference {
    font-family: monospace;
    font-weight: 700;
    white-space: nowrap;
}

.ecm-ev-description {
    min-width: 200px;
}

.ecm-ev-action {
    text-align: right;
    white-space: nowrap;
}


/* =========================================================
   STATUTS
   ========================================================= */

.ecm-ev-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.ecm-ev-status-match {
    background: #d4edda;
    color: #155724;
}

.ecm-ev-status-missing {
    background: #f1f1f1;
    color: #666;
}

.ecm-ev-status-duplicate {
    background: #fff3cd;
    color: #856404;
}


/* =========================================================
   PIÈCE SÉLECTIONNÉE
   ========================================================= */

.ecm-ev-selection {
    position: sticky;
    top: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
}

.ecm-ev-selection-empty {
    color: #777;
    line-height: 1.5;
}

.ecm-ev-selection-content p {
    margin-bottom: 12px;
}

.ecm-ev-selected-reference {
    font-family: monospace;
    font-weight: 700;
}

.ecm-ev-selected-action {
    margin-top: 20px;
}

.ecm-ev-selected-action .btn {
    width: 100%;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991px) {

    .ecm-ev-viewer {
        height: 550px;
    }

    .ecm-ev-layout {
        grid-template-columns: 1fr;
    }

    .ecm-ev-selection {
        position: static;
    }
}


@media (max-width: 767px) {

    .ecm-ev-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ecm-ev-search-wrapper {
        max-width: none;
    }

    .ecm-ev-zoom-controls {
        justify-content: center;
    }

    .ecm-ev-viewer {
        height: 450px;
    }

    .ecm-ev-document-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .ecm-ev-document-button {
        width: 100%;
    }

    .ecm-ev-parts-table {
        font-size: 13px;
    }
}


@media (max-width: 480px) {

    .ecm-ev-viewer {
        height: 380px;
    }

    .ecm-ev-document-tabs {
        grid-template-columns: 1fr;
    }

    .ecm-ev-action .btn {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 12px;
    }
}
/* =========================================================
   COMPATIBILITÉS SUR FICHE PRODUIT
   ========================================================= */

.ecm-ev-compatibility {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
}

.ecm-ev-compatibility h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.ecm-ev-compatibility p {
    margin-bottom: 15px;
}

.ecm-ev-compatibility-list {
    margin: 0;
    padding-left: 20px;
}

.ecm-ev-compatibility-list li {
    margin-bottom: 7px;
}

.ecm-ev-compatibility-list li:last-child {
    margin-bottom: 0;
}

.ecm-ev-compatibility-list a {
    font-weight: 600;
    text-decoration: none;
}

.ecm-ev-compatibility-list a:hover {
    text-decoration: underline;
}
/* ===== ECM - AFFICHAGE COMPACT ===== */

.ecm-exploded-view {
    font-size: 14px;
}

.ecm-exploded-view h1 {
    font-size: 26px;
    line-height: 1.25;
}

.ecm-exploded-view h2 {
    font-size: 20px;
    line-height: 1.3;
}

.ecm-exploded-view h3 {
    font-size: 17px;
    line-height: 1.3;
}

.ecm-exploded-view button,
.ecm-exploded-view .btn,
.ecm-exploded-view input {
    font-size: 13px;
}

.ecm-exploded-view table {
    font-size: 13px;
}

.ecm-exploded-view th,
.ecm-exploded-view td {
    padding: 6px 8px;
}

.ecm-exploded-view img {
    max-width: 100%;
    height: auto;
}

.ecm-product-compatibility {
    font-size: 14px;
}

.ecm-product-compatibility h2,
.ecm-product-compatibility h3 {
    font-size: 18px;
}
/* ===== ECM - AFFICHAGE ENCORE PLUS COMPACT ===== */

.ecm-exploded-view {
    font-size: 12px;
}

.ecm-exploded-view h1 {
    font-size: 22px;
}

.ecm-exploded-view h2 {
    font-size: 17px;
}

.ecm-exploded-view h3 {
    font-size: 15px;
}

.ecm-exploded-view button,
.ecm-exploded-view .btn,
.ecm-exploded-view input {
    font-size: 11px;
}

.ecm-exploded-view table {
    font-size: 11px;
}

.ecm-exploded-view th,
.ecm-exploded-view td {
    padding: 4px 6px;
}

.ecm-product-compatibility {
    font-size: 12px;
}

.ecm-product-compatibility h2,
.ecm-product-compatibility h3 {
    font-size: 15px;
}
/* ===== ECM - REDUCTION VUE ECLATEE ===== */

.ecm-viewer,
.ecm-image-container,
.ecm-exploded-image-container {
    max-width: 75% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.ecm-viewer img,
.ecm-image-container img,
.ecm-exploded-image-container img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
}
/* ===== ECM - TAILLE REELLE VUE ECLATEE ===== */

.ecm-ev-viewer {
    width: 75% !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.ecm-ev-image-stage {
    width: 100% !important;
}

.ecm-ev-image-transform {
    width: 100% !important;
}

.ecm-ev-image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

.ecm-ev-svg {
    width: 100% !important;
    height: 100% !important;
}