﻿/* ========================================
   PAGE PNEUS - VERSION ULTRA-COMPACTE
   Hauteur maximale pour le tableau
   ======================================== */

/* ===== RECHERCHE COMPACTE ===== */
.pneus-search-compact {
    background: white;
    padding: 0 0 5px 0;
    border-bottom: 2px solid #64b22a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.search-mode-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0px;
    margin-top: 0px;
}

.search-form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 0px;
}

.filter-mini {
    min-width: 140px;
}

.search-quick-full {
    min-width: 500px;
}

/* ===== TOOLBAR MINIMALISTE ===== */
.toolbar-minimal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 0 0 5px 0;
}

.toolbar-left-compact,
.toolbar-right-compact {
    display: flex;
    gap: 10px;
    align-items: center;
    height: 35px
}

.results-text {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 13px;
}

.sort-mini {
    min-width: 130px;
    height: 50%;
}

/* ===== FILTRES COMPACTS ===== */
.filters-compact {
    padding: 15px;
    position: sticky;
    top: 10px;
}

.filters-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-label {
    font-weight: 700;
    color: #333;
    margin: 10px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TABLEAU HAUTEUR MAXIMALE ===== */
.datagrid-max {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

    .datagrid-max .mud-table-head .mud-table-cell {
        font-weight: 700;
        color: #1F2937;
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
        padding: 10px 8px;
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        border-bottom: 2px solid #64b22a;
    }

    .datagrid-max .mud-table-cell {
        padding: 8px;
        font-size: 13px;
        vertical-align: middle;
    }

    .datagrid-max .mud-table-row:hover {
        background: #f8f9fa;
    }

.ref-green {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #64b22a;
}

/* ===== VUE GRILLE COMPACTE ===== */
.pneus-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.pneu-card-mini {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .pneu-card-mini:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(100, 178, 42, 0.2);
        border-color: #64b22a;
    }

.card-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .card-header-mini img {
        max-height: 30px;
        object-fit: contain;
    }

.card-body-mini {
    flex: 1;
}

.ref-mini {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.libelle-mini {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.3;
    min-height: 36px;
}

.price-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-pro-mini {
    font-size: 16px;
    font-weight: 700;
    color: #64b22a;
}

.remise-mini {
    font-size: 11px;
    color: #64b22a;
    background: rgba(100, 178, 42, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== SCROLLBAR PERSONNALISÉE ===== */
.datagrid-max .mud-table-container::-webkit-scrollbar,
.pneus-grid-compact::-webkit-scrollbar {
    width: 10px;
}

.datagrid-max .mud-table-container::-webkit-scrollbar-track,
.pneus-grid-compact::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.datagrid-max .mud-table-container::-webkit-scrollbar-thumb,
.pneus-grid-compact::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #64b22a, #4a8a1f);
    border-radius: 10px;
}

    .datagrid-max .mud-table-container::-webkit-scrollbar-thumb:hover,
    .pneus-grid-compact::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #4a8a1f, #64b22a);
    }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .search-form-inline {
        flex-wrap: wrap;
    }

    .search-quick-full {
        min-width: 100%;
    }

    .toolbar-minimal {
        flex-direction: column;
        gap: 10px;
    }

    .toolbar-left-compact,
    .toolbar-right-compact {
        width: 100%;
        justify-content: space-between;
    }

    .datagrid-max {
        height: calc(100vh - 250px) !important;
    }

    .pneus-grid-compact {
        max-height: calc(100vh - 250px);
    }
}

@media (max-width: 600px) {
    .search-mode-tabs {
        flex-direction: column;
    }

    .filter-mini {
        min-width: 100%;
    }

    .datagrid-max {
        height: calc(100vh - 300px) !important;
    }

    .pneus-grid-compact {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 300px);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form-inline,
.datagrid-max,
.pneus-grid-compact {
    animation: fadeIn 0.3s ease-out;
}

    /* ===== PAGINATION STYLE ===== */
    .datagrid-max .mud-table-pagination {
        background: #f8f9fa;
        border-top: 2px solid #64b22a;
        padding: 10px 15px;
    }

    .datagrid-max .mud-table-pagination-caption {
        font-weight: 600;
        color: #333;
        font-size: 12px;
    }

    /* ========================================
   TABLEAU ULTRA-DENSE - MODE PRO B2B
   ======================================== */

    /* Réduire padding des cellules */
    .datagrid-max .mud-table-cell {
        padding: 4px 6px !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        vertical-align: middle !important;
    }

    /* Headers encore plus compacts */
    .datagrid-max .mud-table-head .mud-table-cell {
        padding: 6px 6px !important;
        font-size: 10px !important;
        font-weight: 700;
        text-transform: uppercase;
        font-style: solid;
        letter-spacing: 0.3px;
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        border-bottom: 2px solid #64b22a;
    }

    /* Réduire hauteur des lignes */
    .datagrid-max tbody tr {
        height: 32px !important;
        min-height: 32px !important;
    }

    /* Checkbox sélection plus petite */
    .datagrid-max .mud-table-cell .mud-checkbox {
        padding: 2px !important;
    }

        .datagrid-max .mud-table-cell .mud-checkbox svg {
            width: 16px !important;
            height: 16px !important;
        }

/* Référence verte plus compacte */
.ref-green {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #64b22a;
    font-size: 11px !important;
}

/* Logos marques plus petits */
.datagrid-max img {
    max-width: 60px !important;
    max-height: 20px !important;
    object-fit: contain;
}

/* Chips dimensions compactes */
.datagrid-max .mud-chip {
    height: 18px !important;
    font-size: 10px !important;
    padding: 0 6px !important;
}

/* Prix et remises plus compacts */
.datagrid-max strong {
    font-size: 13px !important;
}

.datagrid-max small {
    font-size: 10px !important;
}

/* Boutons actions plus petits */
.datagrid-max .mud-icon-button {
    padding: 4px !important;
    width: 28px !important;
    height: 28px !important;
}

    .datagrid-max .mud-icon-button svg {
        width: 18px !important;
        height: 18px !important;
    }

/* Pagination compacte */
.datagrid-max .mud-table-pagination {
    background: #f8f9fa;
    border-top: 2px solid #64b22a;
    padding: 8px 12px !important;
    min-height: 40px !important;
}

.datagrid-max .mud-table-pagination-caption {
    font-weight: 600;
    color: #333;
    font-size: 11px !important;
}

/* Hover plus subtil */
.datagrid-max .mud-table-row:hover {
    background: #f8f9fa !important;
}

/* Lignes alternées plus lisibles */
.datagrid-max .mud-table-row.mud-table-row-striped {
    background-color: #fafbfc !important;
}

/* ===== ÉTIQUETTES ÉNERGÉTIQUES ===== */
.etiquette-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.etiquette-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.etiquette-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
    text-transform: uppercase;
}

/* Couleurs selon les classes européennes */
.etiquette-a {
    background: linear-gradient(135deg, #00A650, #00C853);
}

.etiquette-b {
    background: linear-gradient(135deg, #6FBF44, #8BC34A);
}

.etiquette-c {
    background: linear-gradient(135deg, #FFD600, #FFEA00);
    color: #333 !important;
}

.etiquette-d {
    background: linear-gradient(135deg, #FFA726, #FFB74D);
}

.etiquette-e {
    background: linear-gradient(135deg, #FF7043, #FF8A65);
}

.etiquette-f {
    background: linear-gradient(135deg, #E53935, #EF5350);
}

.etiquette-g {
    background: linear-gradient(135deg, #C62828, #D32F2F);
}

.etiquette-bruit {
    background: linear-gradient(135deg, #5C6BC0, #7986CB);
}

/* Icônes des étiquettes */
.etiquette-item .mud-icon-root {
    color: #666;
    font-size: 16px !important;
}

/* ========================================
   FILTRES MARQUES AVEC LOGOS
   ======================================== */

.brand-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin: 2px 0;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

    .brand-filter-item:hover {
        background: rgba(100, 178, 42, 0.08);
    }

.brand-filter-logo {
    max-width: 60px;
    max-height: 22px;
    object-fit: contain;
}

.brand-filter-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.brand-filter-item .mud-checkbox {
    margin: 0 !important;
    padding: 0 !important;
}

.brand-filter-item .mud-checkbox-root {
    padding: 0 !important;
}

/* ========================================
   TABLEAU AVEC CONTRASTE AMÉLIORÉ
   ======================================== */

/* ====================================================================
   ✅ FONT SIZE GLOBAL DU TABLEAU
   Modifiez font-size ici pour changer la taille de TOUT le texte du tableau
   ==================================================================== */
.datagrid-contrasted .mud-table-cell {
    padding: 6px 8px !important;
    font-size: 17px !important;
    /* <—— CHANGEZ ICI POUR TOUT LE TABLEAU */
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

/* ✅ EN-TÊTE VERT */
.datagrid-contrasted .mud-table-head .mud-table-cell {
    padding: 5px 8px !important;
    font-size: 12px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #64b22a 0%, #5ba526 100%) !important;
    color: white !important;
    border-bottom: 3px solid #4a8a1f;
    text-align: center;
}

    /* ✅ Centrage des titres dans le conteneur flex interne de MudDataGrid */
    .datagrid-contrasted .mud-table-head .mud-table-cell .mud-table-sort-label,
    .datagrid-contrasted .mud-table-head .mud-table-cell > span,
    .datagrid-contrasted .mud-table-head .mud-table-cell > div {
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
    }

/* ✅ HAUTEUR LIGNES (Modifier min-height ici pour la hauteur des lignes) */
.datagrid-contrasted tbody tr {
    height: 5px !important;
    min-height: 10px !important;
    /* <--- HAUTEUR DES LIGNES */
}

    /* ✅ LIGNES IMPAIRES - VERT LÉGER */
    .datagrid-contrasted tbody tr:nth-child(odd) td {
        background-color: #e8f7e2 !important;
    }

    /* ✅ LIGNES PAIRES - BLANC PUR */
    .datagrid-contrasted tbody tr:nth-child(even) td {
        background-color: #ffffff !important;
    }

/* ✅ HOVER - VERT CLAIR */
.datagrid-contrasted tbody .mud-table-row:hover {
    background: #edfff1 !important;
    box-shadow: 0 2px 8px rgba(100, 178, 42, 0.2);
    cursor: pointer;
}

/* ✅ Prix */
.datagrid-contrasted strong {
    font-size: 14px !important;
}

/* ✅ Chips */
.datagrid-contrasted .mud-chip {
    height: 20px !important;
    font-size: 11px !important;
    padding: 0 7px !important;
}

/* ✅ Boutons */
.datagrid-contrasted .mud-icon-button {
    padding: 5px !important;
    width: 30px !important;
    height: 30px !important;
}

    .datagrid-contrasted .mud-icon-button svg {
        width: 19px !important;
        height: 19px !important;
    }

/* ✅ Logos */
.datagrid-contrasted img {
    max-width: 70px !important;
    max-height: 25px !important;
    object-fit: contain;
}

/* ✅ Pagination */
.datagrid-contrasted .mud-table-pagination {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%);
    border-top: 3px solid #64b22a;
    padding: 10px 15px !important;
}

/* ✅ Référence verte */
.datagrid-contrasted .ref-green {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #64b22a;
    font-size: 12px !important;
}




/* ====================================================================
   COLONNES INDIVIDUELLES — ajustement par colonne
   ==================================================================== */

/* Référence : ~10 caractères max, police mono */
.col-ref {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #64b22a;
    font-size: 15px !important;
    white-space: nowrap;
    display: inline-block;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Libellé : une seule ligne complète */
.col-libelle {
    white-space: nowrap;
    line-height: 1.3;
    font-size: 15px !important;
    font-weight: 500;
}

/* Dimensions : une seule ligne, pas de retour */
.col-dim {
    white-space: nowrap;
    font-weight: 400;
    width: 100px;
}

/* Charge : taille juste le mot */
.col-charge {
    white-space: nowrap;
    text-align: center;
    display: block;
    max-width: 40px;
}

/* Vitesse */
.col-vit {
    white-space: nowrap;
    text-align: center;
    display: block;
}

/* Votre Prix : prix sur 1 ligne, remise en dessous */
.col-prix-pro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

    .col-prix-pro strong {
        color: #64b22a;
        font-size: 13px !important;
        white-space: nowrap;
        line-height: 1.2;
    }

    .col-prix-pro small {
        color: #64b22a;
        font-size: 10px !important;
        background: rgba(100, 178, 42, 0.12);
        padding: 1px 5px;
        border-radius: 3px;
        line-height: 1.2;
    }
