/* ─────────────────────────────────────────────────────────────────────────────
   Vue éclatée — styles front
   ───────────────────────────────────────────────────────────────────────────── */

#module-pliciwebmainv2-explodedview section#main {
    margin: 1.45vw 1.82vw 0;
}

/* ── Conteneur image (viewport overflow:hidden) ─────────────────────────────── */

.ev-image-container {
    position: relative;
    display: block;
    width: 100%;
    max-width: 850px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    touch-action: pan-y; /* scroll vertical natif par défaut ; le JS passe à none dès qu'un pinch démarre */
}

.ev-image-container.ev-zoomed {
    cursor: grab;
}

.ev-image-container.ev-dragging {
    cursor: grabbing;
}

/* ── Inner (position et taille gérées par JS) ───────────────────────────────── */

#ev-zoom-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

#ev-image {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

/* ── Boutons de zoom ────────────────────────────────────────────────────────── */

.ev-zoom-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
}

.ev-zoom-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding: 0;
    transition: background 0.1s;
}

.ev-zoom-btn:hover {
    background: #fff;
}

/* ── Dots (pastilles rectangulaires) ───────────────────────────────────────── */

.ev-dot {
    position: absolute;
    border: 2px solid #0069d9;
    background: rgba(0, 105, 217, 0.12);
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ev-dot:hover{
    background: rgba(0, 105, 217, 0.3);
    border-color: #004ba0;
    z-index: 10;
}

.ev-dot.highlight,
.ev-dot.active {
    background: rgba(255, 193, 7, 0.35);
    border-color: #e0a800;
    z-index: 9;
}

.ev-dot-label {
    position: absolute;
    top: -1px;
    left: -1px;
    background: #0069d9;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 0 0 3px 0;
    pointer-events: none;
    white-space: nowrap;
}

.ev-dot.active .ev-dot-label,
.ev-dot:hover .ev-dot-label {
    background: #004ba0;
}

.ev-dot.highlight .ev-dot-label {
    background: #c69500;
}

/* ── Panneau latéral ────────────────────────────────────────────────────────── */

.ev-panel {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    background: #fff;
    
}

.ev-panel-container {
    position: sticky;
    top: 80px;
}

.ev-panel-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

/* ── Product items ──────────────────────────────────────────────────────────── */

.ev-product-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.ev-product-item:last-child {
    border-bottom: none;
}

/* En-tête pièce (badge numéro + référence + désignation) */
.ev-piece-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ev-item-numero {
    font-size: 10px;
    min-width: 20px;
    flex-shrink: 0;
}

.ev-product-ref {
    font-size: 11px;
    color: #495057;
}

.ev-piece-name {
    font-size: 12px;
    color: #6c757d;
}

/* Sections pièce d'origine / cross-références */
.ev-origin-section,
.ev-crossref-section {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.ev-origin-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.ev-crossref-section {
    background: #fff8e1;
    border: 1px solid #ffe082;
}

.ev-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* Carte produit — 3 lignes explicites */
.ev-product-card {
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.ev-product-card:last-child {
    border-bottom: none;
}

/* Ligne 1 : image + nom + référence */
.ev-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.ev-product-img {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.ev-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ev-card-info {
    flex: 1;
    min-width: 0;
}

.ev-product-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.3;
}

/* Ligne 2 : stock + prix côte à côte */
.ev-card-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.ev-card-meta .product-miniature__pricing {
    margin-left: auto;
}

/* Ligne 3 : actions — pleine largeur naturellement (block) */

.ev-add-to-cart-form {
    margin-bottom: 4px;
}

.ev-qty-input {
    max-width: 60px;
}

.ev-product-link {
    display: inline-block;
    margin-top: 2px;
    color: #6c757d;
    text-decoration: underline;
}

/* ── Lien ancre vers la liste ───────────────────────────────────────────────── */

.ev-scroll-to-list {
    text-decoration: underline;
}

/* ── Liste complète des pièces (table) ──────────────────────────────────────── */

.ev-parts-table {
    table-layout: fixed;
}

.ev-parts-table td,
.ev-parts-table th {
    vertical-align: middle;
    overflow: hidden;
}

.ev-list-col-img {
    width: 56px;
    padding-right: 0 !important;
}

.ev-list-col-img img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    background: #f8f9fa;
}

.ev-list-col-numero {
    width: 48px;
    text-align: center;
}

.ev-list-col-name {
    width: 22%;
    max-width: 220px;
}

.ev-list-col-stock {
    width: 170px;
    white-space: nowrap;
}

.ev-list-col-price {
    width: 140px;
    white-space: nowrap;
}

.ev-list-col-actions {
    width: 240px;
}

.ev-list-product-name {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.ev-list-ref {
    font-size: 11px;
    color: #6c757d;
}

.ev-list-unavailable td {
    color: #6c757d;
}

.ev-list-group-start td {
    border-top: 20px solid #f0f2f5 !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 991px) {
    .ev-panel {
        max-height: 420px;
        position: static;
    }
}

@media (max-width: 767px) {

    /* ── Panneau de droite : même rendu compact que la liste du bas ─────────── */

    /* Sections moins volumineuses */
    .ev-origin-section,
    .ev-crossref-section {
        padding: 0.4rem 0.5rem;
        margin-bottom: 0.4rem;
    }

    .ev-section-title {
        font-size: 10px;
        margin-bottom: 0.3rem;
    }

    /* Image un peu plus petite, ne s'étire pas en hauteur */
    .ev-product-card .ev-product-img {
        width: 48px;
        height: 48px;
        align-self: flex-start;
    }

    /* Body : flex-wrap pour réorganiser les éléments */
    .ev-product-card .ev-product-body {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.15rem 0.4rem;
    }

    .ev-product-card .ev-product-name  { order: 1; width: 100%; }
    .ev-product-card .ev-product-ref   { order: 2; width: 100%; }
    .ev-product-card .product-stock    { order: 3; flex: 1; }
    .ev-product-card .product-miniature__pricing { order: 4; flex-shrink: 0; }
    .ev-product-card .ev-add-to-cart-form { order: 5; width: 100%; }
    .ev-product-card .ev-product-link  { order: 6; width: 100%; }

    /* ── Liste du bas : désactive le scroll horizontal ──────────────────────── */

    /* Désactive le scroll horizontal du wrapper Bootstrap */
    .ev-full-list .table-responsive {
        overflow-x: visible;
    }

    /* Transforme les lignes en mini-cartes flex */
    .ev-parts-table thead {
        display: none;
    }

    .ev-parts-table,
    .ev-parts-table tbody,
    .ev-parts-table tr,
    .ev-parts-table td {
        display: block;
        width: 100% !important;
    }

    .ev-parts-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.4rem 0.5rem;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        background: #fff;
    }

    .ev-parts-table td {
        padding: 0 !important;
        border: none !important;
    }

    /* Ligne 1 : image | badge | nom + ref */
    .ev-parts-table .ev-list-col-img  { order: 1; width: 48px !important; flex-shrink: 0; }
    .ev-parts-table .ev-list-col-numero { order: 2; width: auto !important; flex-shrink: 0; align-self: center; }
    .ev-parts-table .ev-list-col-name  { order: 3; flex: 1; min-width: 0; max-width: none !important; }

    /* Ligne 2 : stock + prix côte à côte */
    .ev-parts-table .ev-list-col-stock { order: 4; width: auto !important; white-space: normal !important; }
    .ev-parts-table .ev-list-col-price { order: 5; width: auto !important; white-space: normal !important; margin-left: auto; }

    /* Ligne 3 : actions pleine largeur */
    .ev-parts-table .ev-list-col-actions { order: 6; width: 100% !important; }

    /* Gap entre groupes de pastilles : border au lieu de padding */
    .ev-parts-table tr.ev-list-group-start {
        margin-top: 1rem;
        border-top: 1px solid #dee2e6 !important;
    }

    .ev-list-group-start td {
        border-top: none !important;
    }

    .ev-card-meta {
        flex-direction: column;
    }
}
