/**
 * Catalogues → cartes empilées sur mobile (≤ 992px), style embase partout.
 */
@media (max-width: 992px) {
    .tendeur-table-scroll,
    .fil-table-scroll,
    .cable-tech-scroll,
    .veg-embase-scroll,
    .veg-table-scroll,
    .inner-specs-scroll {
        border: none !important;
        overflow: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        -webkit-overflow-scrolling: auto !important;
    }

    .tendeur-table-scroll::after,
    .fil-table-scroll::after,
    .veg-table-scroll::after,
    .inner-specs-scroll::after {
        display: none !important;
        content: none !important;
    }

    .fil-catalog-table,
    .tendeur-catalog-table,
    .cable-tech-table,
    .veg-embase-table,
    .veg-catalog-table,
    .inner-specs-table,
    .catalog-mobile-cards {
        min-width: 0 !important;
        width: 100% !important;
        display: block !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 0.88rem;
        table-layout: auto !important;
    }

    .fil-catalog-table thead,
    .tendeur-catalog-table thead,
    .cable-tech-table thead,
    .veg-embase-table thead,
    .veg-catalog-table thead,
    .inner-specs-table thead,
    .catalog-mobile-cards thead {
        display: none !important;
    }

    .fil-catalog-table tbody,
    .tendeur-catalog-table tbody,
    .cable-tech-table tbody,
    .veg-embase-table tbody,
    .veg-catalog-table tbody,
    .inner-specs-table tbody,
    .catalog-mobile-cards tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
    }

    .fil-catalog-table tbody tr,
    .tendeur-catalog-table tbody tr,
    .cable-tech-table tbody tr,
    .veg-embase-table tbody tr,
    .veg-catalog-table tbody tr,
    .inner-specs-table tbody tr,
    .catalog-mobile-cards tbody tr {
        display: grid !important;
        grid-template-columns: 64px 1fr;
        gap: 8px 12px;
        padding: 14px;
        border: 1px solid #e4e4e4;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .inner-specs-table tbody tr,
    .cable-tech-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) {
        grid-template-columns: 1fr;
    }

    .fil-catalog-table tbody tr:hover,
    .tendeur-catalog-table tbody tr:hover,
    .cable-tech-table tbody tr:hover,
    .veg-embase-table tbody tr:hover,
    .inner-specs-table tbody tr:hover,
    .catalog-mobile-cards tbody tr:hover {
        background: #fff !important;
    }

    .fil-catalog-table tbody td,
    .tendeur-catalog-table tbody td,
    .cable-tech-table tbody td,
    .veg-embase-table tbody td,
    .veg-catalog-table tbody td,
    .inner-specs-table tbody td,
    .catalog-mobile-cards tbody td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        vertical-align: top;
        min-width: 0;
        width: auto !important;
        white-space: normal !important;
    }

    /* Visuels produit */
    .fil-catalog-table .tendeur-photo-cell,
    .fil-catalog-table .fil-photo-cell,
    .tendeur-catalog-table .tendeur-photo-cell,
    .veg-embase-table .tendeur-photo-cell,
    .catalog-mobile-cards .tendeur-photo-cell,
    .catalog-mobile-cards .fil-photo-cell {
        grid-column: 1;
        grid-row: 1 / span 3;
        align-self: start;
        width: auto !important;
    }

    .fil-catalog-table .tendeur-photo-slot,
    .fil-catalog-table .fil-photo-slot,
    .tendeur-catalog-table .tendeur-photo-slot,
    .veg-embase-table .tendeur-photo-slot,
    .catalog-mobile-cards .tendeur-photo-slot,
    .catalog-mobile-cards .fil-photo-slot {
        width: 64px;
        height: 64px;
        border: 1px dashed #ddd;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #fafafa;
    }

    .fil-catalog-table .tendeur-photo-slot img,
    .fil-catalog-table .tendeur-photo-slot .tendeur-photo-img,
    .fil-catalog-table .fil-photo-slot img,
    .fil-catalog-table .fil-photo-slot .fil-photo-img,
    .tendeur-catalog-table .tendeur-photo-slot img,
    .tendeur-catalog-table .tendeur-photo-slot .tendeur-photo-img,
    .veg-embase-table .tendeur-photo-slot img,
    .veg-embase-table .tendeur-photo-slot .tendeur-photo-img,
    .catalog-mobile-cards .tendeur-photo-slot img,
    .catalog-mobile-cards .fil-photo-slot img {
        position: static !important;
        max-width: 64px;
        max-height: 64px;
        object-fit: contain;
    }

    /* Référence & nom */
    .fil-catalog-table .tendeur-col-ref,
    .fil-catalog-table .fil-col-ref,
    .tendeur-catalog-table .tendeur-col-ref,
    .cable-tech-table .col-ref,
    .veg-embase-table .tendeur-col-ref,
    .inner-specs-table .catalog-mobile-ref-cell,
    .catalog-mobile-cards .tendeur-col-ref,
    .catalog-mobile-cards .fil-col-ref,
    .catalog-mobile-cards .col-ref {
        grid-column: 2;
        font-size: 0.72rem;
        color: #777;
        letter-spacing: 0.02em;
        word-break: break-word;
        font-weight: 400 !important;
    }

    .inner-specs-table .catalog-mobile-ref-cell {
        grid-column: 1 / -1;
        font-size: 0.72rem;
        color: #777;
    }

    .fil-catalog-table .tendeur-col-nom,
    .fil-catalog-table .fil-col-nom,
    .tendeur-catalog-table .tendeur-col-nom,
    .cable-tech-table .col-nom,
    .veg-embase-table .tendeur-col-nom,
    .inner-specs-table .catalog-mobile-title-cell,
    .catalog-mobile-cards .tendeur-col-nom,
    .catalog-mobile-cards .fil-col-nom,
    .catalog-mobile-cards .col-nom {
        grid-column: 2;
        font-weight: 600;
        font-size: 0.95rem;
        line-height: 1.3;
        max-width: none !important;
    }

    .inner-specs-table .catalog-mobile-title-cell {
        grid-column: 1 / -1;
        font-weight: 600;
        font-size: 0.95rem;
    }

    .veg-embase-table .tendeur-col-nom strong,
    .fil-catalog-table .fil-col-nom strong,
    .tendeur-catalog-table .tendeur-col-nom strong {
        display: block;
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .veg-embase-table .tendeur-col-nom span,
    .fil-catalog-table .fil-col-nom span,
    .tendeur-catalog-table .tendeur-col-nom span {
        display: block;
        font-size: 0.8rem;
        font-weight: 400;
        color: #666;
        line-height: 1.45;
        margin-top: 6px;
    }

    /* Schéma construction câbles */
    .cable-tech-table .cable-construction-cell,
    .catalog-mobile-cards .cable-construction-cell {
        grid-column: 1 / -1;
        text-align: center;
        padding-bottom: 10px !important;
        margin-bottom: 4px;
        border-bottom: 1px solid #eee !important;
    }

    .cable-tech-table .cable-construction-cell img,
    .catalog-mobile-cards .cable-construction-cell img {
        max-width: min(200px, 100%);
        height: auto;
        margin: 0 auto 8px;
        display: block;
    }

    /* Lignes sans photo */
    .fil-catalog-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) .col-ref,
    .fil-catalog-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) .col-nom,
    .fil-catalog-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) .tendeur-col-ref,
    .fil-catalog-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) .tendeur-col-nom,
    .fil-catalog-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) .fil-col-ref,
    .fil-catalog-table tbody tr:not(:has(.tendeur-photo-cell, .fil-photo-cell)) .fil-col-nom,
    .tendeur-catalog-table tbody tr:not(:has(.tendeur-photo-cell)) .tendeur-col-ref,
    .tendeur-catalog-table tbody tr:not(:has(.tendeur-photo-cell)) .tendeur-col-nom,
    .cable-tech-table tbody tr:not(:has(.cable-construction-cell)) .col-ref,
    .cable-tech-table tbody tr:not(:has(.cable-construction-cell)) .col-nom {
        grid-column: 1 / -1;
    }

    /* Séparateur avant 1er champ (style embase) */
    .catalog-mobile-field--first,
    .veg-embase-table .veg-embase-cell-matiere {
        grid-column: 1 / -1;
        padding-top: 10px !important;
        margin-top: 4px;
        border-top: 1px solid #eee !important;
    }

    /* Champs avec label */
    .catalog-mobile-field,
    .fil-catalog-table tbody td[data-label],
    .tendeur-catalog-table tbody td[data-label],
    .cable-tech-table tbody td[data-label],
    .veg-embase-table tbody td[data-label],
    .inner-specs-table tbody td[data-label],
    .catalog-mobile-cards tbody td[data-label] {
        grid-column: 1 / -1;
        font-size: 0.82rem;
        color: #555;
        line-height: 1.45;
    }

    .catalog-mobile-field::before,
    .fil-catalog-table tbody td[data-label]:not(.tendeur-photo-cell):not(.fil-photo-cell):not(.tendeur-col-ref):not(.fil-col-ref):not(.col-ref):not(.tendeur-col-nom):not(.fil-col-nom):not(.col-nom):not(.catalog-mobile-unite-cell):not(.fil-unite-cell):not(.veg-embase-cell-unite):not(.quote-action-cell):not(.veg-embase-cell-action):not(.col-action):not(.quote-qty-cell):not(.veg-embase-qty-cell):not(.catalog-mobile-ref-cell):not(.catalog-mobile-title-cell)::before,
    .tendeur-catalog-table tbody td[data-label]:not(.tendeur-photo-cell):not(.tendeur-col-ref):not(.tendeur-col-nom):not(.catalog-mobile-unite-cell):not(.quote-action-cell):not(.quote-qty-cell)::before,
    .cable-tech-table tbody td[data-label]:not(.cable-construction-cell):not(.col-ref):not(.col-nom):not(.col-action)::before,
    .veg-embase-table tbody td[data-label]:not(.tendeur-photo-cell):not(.tendeur-col-ref):not(.tendeur-col-nom):not(.veg-embase-cell-unite):not(.veg-embase-qty-cell):not(.veg-embase-cell-action)::before,
    .inner-specs-table tbody td[data-label]:not(.catalog-mobile-ref-cell):not(.catalog-mobile-title-cell):not(.quote-action-cell)::before,
    .catalog-mobile-cards tbody td[data-label]:not(.tendeur-photo-cell):not(.fil-photo-cell):not(.tendeur-col-ref):not(.fil-col-ref):not(.col-ref):not(.tendeur-col-nom):not(.fil-col-nom):not(.col-nom):not(.catalog-mobile-unite-cell):not(.fil-unite-cell):not(.veg-embase-cell-unite):not(.quote-action-cell):not(.veg-embase-cell-action):not(.col-action):not(.quote-qty-cell):not(.veg-embase-qty-cell)::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        color: #333;
        margin-right: 8px;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        vertical-align: baseline;
    }

    .veg-embase-table .veg-embase-cell-matiere::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        color: #333;
        margin-right: 8px;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    /* Masquer colonne unité séparée */
    .fil-catalog-table .catalog-mobile-unite-cell,
    .fil-catalog-table .fil-unite-cell,
    .tendeur-catalog-table .catalog-mobile-unite-cell,
    .veg-embase-table .veg-embase-cell-unite,
    .catalog-mobile-cards .catalog-mobile-unite-cell,
    .catalog-mobile-cards .fil-unite-cell,
    .catalog-mobile-cards .veg-embase-cell-unite {
        display: none !important;
    }

    /* Quantité */
    .fil-catalog-table .quote-qty-cell,
    .tendeur-catalog-table .quote-qty-cell,
    .veg-embase-table .veg-embase-qty-cell,
    .catalog-mobile-cards .quote-qty-cell,
    .catalog-mobile-cards .veg-embase-qty-cell {
        grid-column: 1 / -1;
        display: flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 10px !important;
        margin-top: 4px;
        border-top: 1px solid #eee !important;
    }

    .fil-catalog-table .quote-qty-cell::before,
    .tendeur-catalog-table .quote-qty-cell::before,
    .veg-embase-table .veg-embase-qty-cell::before,
    .catalog-mobile-cards .quote-qty-cell::before,
    .catalog-mobile-cards .veg-embase-qty-cell::before {
        content: attr(data-qty-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #333;
        flex-shrink: 0;
    }

    .catalog-mobile-qty-suffix,
    .veg-embase-qty-suffix {
        font-size: 0.82rem;
        color: #777;
    }

    .fil-catalog-table .quote-qty-input,
    .tendeur-catalog-table .quote-qty-input,
    .veg-embase-table .veg-embase-qty-input,
    .cable-tech-table .cable-length-input,
    .catalog-mobile-cards .quote-qty-input,
    .catalog-mobile-cards .cable-length-input {
        width: 4rem;
        min-height: 44px;
        font-size: 1rem;
        border: 1px solid #ccc;
        border-radius: 6px;
        padding: 0 8px;
        box-sizing: border-box;
    }

    /* Action / longueur câbles */
    .fil-catalog-table .quote-action-cell,
    .tendeur-catalog-table .quote-action-cell,
    .veg-embase-table .veg-embase-cell-action,
    .cable-tech-table .col-action,
    .inner-specs-table td:has(.add-quote-btn),
    .catalog-mobile-cards .quote-action-cell,
    .catalog-mobile-cards .veg-embase-cell-action,
    .catalog-mobile-cards .col-action {
        grid-column: 1 / -1;
        padding-top: 8px !important;
    }

    .cable-tech-table .col-action,
    .catalog-mobile-cards .col-action {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 10px !important;
        margin-top: 4px;
        border-top: 1px solid #eee !important;
    }

    .cable-tech-table .col-action::before,
    .catalog-mobile-cards .col-action::before {
        content: attr(data-qty-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #333;
    }

    .fil-catalog-table .quote-action-cell:has(.catalog-quote-action),
    .fil-catalog-table .quote-action-cell:has(.quote-qty-input),
    .tendeur-catalog-table .quote-action-cell:has(.catalog-quote-action),
    .tendeur-catalog-table .quote-action-cell:has(.quote-qty-input),
    .catalog-mobile-cards .quote-action-cell:has(.catalog-quote-action),
    .catalog-mobile-cards .quote-action-cell:has(.quote-qty-input) {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 10px !important;
        margin-top: 4px;
        border-top: 1px solid #eee !important;
    }

    .fil-catalog-table .quote-action-cell:has(.catalog-quote-action)::before,
    .tendeur-catalog-table .quote-action-cell:has(.catalog-quote-action)::before,
    .catalog-mobile-cards .quote-action-cell:has(.catalog-quote-action)::before {
        content: attr(data-qty-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #333;
    }

    .fil-catalog-table .quote-action-cell .catalog-quote-action,
    .tendeur-catalog-table .quote-action-cell .catalog-quote-action,
    .catalog-mobile-cards .quote-action-cell .catalog-quote-action {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: none;
    }

    .cable-tech-table .cable-quote-action,
    .catalog-mobile-cards .cable-quote-action {
        display: flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .cable-tech-table .cable-quote-action .cable-length-input,
    .catalog-mobile-cards .cable-quote-action .cable-length-input {
        flex: 0 0 4rem;
        width: 4rem;
    }

    .cable-tech-table .cable-quote-action .cable-length-suffix,
    .catalog-mobile-cards .cable-quote-action .cable-length-suffix {
        font-size: 0.82rem;
        color: #777;
    }

    .cable-tech-table .cable-quote-action .add-quote-btn,
    .catalog-mobile-cards .cable-quote-action .add-quote-btn {
        width: 100%;
        margin-top: 4px;
    }

    .fil-catalog-table .add-quote-btn,
    .tendeur-catalog-table .add-quote-btn,
    .cable-tech-table .add-quote-btn,
    .veg-embase-table .add-quote-btn,
    .inner-specs-table .add-quote-btn,
    .catalog-mobile-cards .add-quote-btn {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        box-sizing: border-box !important;
        min-height: 44px;
        margin-top: 0 !important;
        white-space: normal !important;
    }

    /* Désactiver colonnes sticky */
    .fil-catalog-table th,
    .fil-catalog-table td,
    .tendeur-catalog-table th,
    .tendeur-catalog-table td,
    .cable-tech-table th,
    .cable-tech-table td,
    .veg-catalog-table th,
    .veg-catalog-table td,
    .inner-specs-table th,
    .inner-specs-table td {
        position: static !important;
        box-shadow: none !important;
        background: transparent !important;
        right: auto !important;
        z-index: auto !important;
    }

    .fil-catalog-table thead th,
    .tendeur-catalog-table thead th {
        top: auto !important;
    }

    /* Accessoires — liste principale en cartes */
    .specs-table-wrapper > table:not(.inner-specs-table) tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) thead {
        display: none !important;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.clickable-row {
        display: block !important;
        padding: 14px;
        border: 1px solid #e4e4e4;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.clickable-row td {
        display: block !important;
        padding: 2px 0 !important;
        border: none !important;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.clickable-row td:first-child {
        font-weight: 600;
        font-size: 0.95rem;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.clickable-row td.row-icon {
        text-align: right;
        font-size: 1.1rem;
        color: #888;
        margin-top: 4px;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.details-row {
        display: none !important;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.details-row[style*="table-row"] {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-top: -6px;
        margin-bottom: 4px;
    }

    .specs-table-wrapper > table:not(.inner-specs-table) tbody tr.details-row > td {
        display: block !important;
        padding: 0 !important;
    }
}
