/* ============================================================
   e-Catalogue ECMU — Feuille de styles principale
   Thème : sombre (gris anthracite) + accent rouge ECMU
   ============================================================ */

/* --- Réinitialisation & base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    font-size: 0.9em;
    color: #ddd;
    background-color: #444;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================================
   EN-TÊTE
   ============================================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background-color: #333;
    border-bottom: 3px solid #d00000;
}

.header h1 {
    flex: 1;
    text-align: center;
    font-size: 2em;
    color: #eee;
    letter-spacing: 0.02em;
}

.header img {
    height: 52px;
}

/* ============================================================
   BANDEAU D'INFORMATIONS
   ============================================================ */

.info-banner {
    background-color: #3d3d3d;
    border-left: 4px solid #d00000;
    padding: 10px 20px;
    margin: 10px 10px 0;
    border-radius: 2px;
}

.info-banner p {
    margin: 3px 0;
    line-height: 1.5;
    color: #bbb;
}

.info-banner .info-warning {
    color: #ff5555;
    font-weight: bold;
}

/* ============================================================
   MISE EN PAGE PRINCIPALE (3 colonnes)
   ============================================================ */

.main-layout {
    display: flex;
    gap: 10px;
    padding: 12px;
    align-items: flex-start;
}

/* ============================================================
   PANNEAU FILTRES
   ============================================================ */

.filter-panel {
    flex: 0 0 15%;
    min-width: 140px;
}

.filter-panel label {
    cursor: pointer;
    font-size: 0.95em;
    margin-left: 3px;
    color: #ccc;
}

.filter-panel label + label {
    margin-left: 10px;
}

/* ============================================================
   GRILLE PRODUITS
   ============================================================ */

.product-grid-panel {
    flex: 0 0 46%;
}

/* ============================================================
   PANIER
   ============================================================ */

.cart-panel {
    flex: 1;
}

/* ============================================================
   TITRES DE SECTION
   ============================================================ */

.txt-heading {
    font-size: 1.4em;
    color: #ddd;
    text-align: center;
    padding-bottom: 6px;
    margin-bottom: 14px;
    border-bottom: 2px solid #d00000;
    position: relative;
}

.txt-sous-heading {
    font-size: 0.95em;
    font-weight: bold;
    color: #7eb8f7; /* bleu clair, cohérent avec les champs */
    margin: 10px 0 3px;
}

/* ============================================================
   TOGGLE LISTE / GRILLE
   ============================================================ */

.view-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-60%);
    display: flex;
    gap: 4px;
}

.view-btn {
    background: transparent;
    border: 1px solid #666;
    border-radius: 5px;
    color: #999;
    cursor: pointer;
    padding: 4px 7px;
    line-height: 1;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-btn svg {
    width: 15px;
    height: 15px;
}

.view-btn.active {
    background-color: #d00000;
    border-color: #d00000;
    color: #fff;
}

.view-btn:hover:not(.active) {
    border-color: #999;
    color: #ddd;
}

/* ============================================================
   VUE GRILLE — surcharges
   ============================================================ */

.product-list.grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* La carte passe en colonne */
.product-list.grid-view .product-item {
    margin-bottom: 0;
}

.product-list.grid-view .product-item > form {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

/* Image centrée en haut */
.product-list.grid-view .product-image {
    float: none;
    height: auto;
    text-align: center;
    padding: 8px 0 4px;
}

.product-list.grid-view .product-image img {
    height: 85px;
    margin: 0 auto;
}

/* Pied de carte : textes centrés */
.product-list.grid-view .product-tile-footer {
    padding: 0 4px 4px;
    text-align: center;
    flex: 1;
}

.product-list.grid-view .product-ref,
.product-list.grid-view .product-dims,
.product-list.grid-view .product-family,
.product-list.grid-view .product-price {
    text-align: center;
}

/* Cart actions : inline-flex pour être centrés par text-align */
.product-list.grid-view .cart-action {
    float: none;
    display: inline-flex;
    margin: 2px 3px;
}

/* ============================================================
   CHAMPS DE FORMULAIRE
   ============================================================ */

.filtre-input {
    width: 100%;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #3a7fd4;
    background-color: #fff;
    color: #222;
    margin-bottom: 4px;
}

.filtre-input:focus {
    outline: none;
    border-color: #2563b0;
    box-shadow: 0 0 0 2px rgba(58, 127, 212, 0.25);
}

/* ============================================================
   BOUTONS PRINCIPAUX
   ============================================================ */

#btnEmpty,
#btnValid,
#btnOKFiltre,
#submit1 {
    display: inline-block;
    padding: 7px 18px;
    border: 2px solid #d00000;
    border-radius: 999px;
    background-color: transparent;
    color: #d00000;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    margin: 8px 0;
}

#btnEmpty  { float: left;  background-color: #d00000; border-color: #d00000; color: #fff; }
#btnValid  { float: right; }

#btnEmpty:hover {
    background-color: #aa0000;
    border-color: #aa0000;
}

#submit1:hover {
    background-color: #d00000;
    color: #fff;
}

/* Bouton "Filtrer" : bleu, aligné à droite */
#btnOKFiltre {
    float: right;
    border-color: #3a7fd4;
    background-color: #3a7fd4;
    color: #fff;
}

#btnOKFiltre:hover {
    background-color: #2563b0;
    border-color: #2563b0;
}

/* Bouton "Valider le panier" : fond vert */
#btnValid {
    border-color: #2a9d2a;
    background-color: #2a9d2a;
    color: #fff;
}

#btnValid:hover {
    background-color: #237a23;
    border-color: #237a23;
}

/* ============================================================
   CARTE PRODUIT
   ============================================================ */

.product-item {
    background-color: #585858;
    border: 1px solid #777;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    overflow: auto;
    transition: border-color 0.2s;
}

.product-item:hover {
    border-color: #d00000;
}

.product-image {
    float: left;
}

.product-image img {
    height: 80px;
    border-radius: 4px;
    display: block;
}

.product-tile-footer {
    padding: 0 12px;
    overflow: auto;
}

/* Titre / référence */
.product-ref {
    font-size: 1.1em;
    font-weight: bold;
    color: #eee;
    margin-bottom: 4px;
}

/* Dimensions */
.product-dims {
    font-size: 0.85em;
    color: #bbb;
    margin-bottom: 3px;
}

/* Famille */
.product-family {
    font-size: 0.8em;
    color: #aaa;
    margin-bottom: 5px;
}

/* Prix & délai */
.product-price {
    font-size: 0.9em;
    color: #ddd;
    margin-bottom: 6px;
}

/* ============================================================
   ACTIONS PANIER (quantité + bouton Ajouter)
   ============================================================ */

.cart-action {
    float: left;
    margin: 3px 8px 3px 0;
}

/* Stepper quantité : boutons − et + autour du champ */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.qty-stepper button {
    width: 26px;
    height: 26px;
    border: 1px solid #777;
    border-radius: 50%;
    background-color: #4e4e4e;
    color: #eee;
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.qty-stepper button:hover {
    background-color: #666;
}

.product-quantity {
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #777;
    background-color: #555;
    color: #eee;
    width: 46px;
    text-align: center;
}

.btnAddAction {
    padding: 6px 14px;
    border: 2px solid #888;
    border-radius: 999px;
    background-color: #4e4e4e;
    color: #eee;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.btnAddAction:hover {
    background-color: #666;
    border-color: #aaa;
}

/* ============================================================
   TABLEAU DU PANIER
   ============================================================ */

.tbl-cart {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    font-size: 0.9em;
    margin-top: 10px;
}

.tbl-cart thead th {
    background-color: #d0d0d0;
    color: #222;
    font-weight: bold;
    padding: 7px 8px;
    text-align: left;
}

.tbl-cart thead th:not(:first-child) {
    text-align: right;
}

.tbl-cart thead th:last-child {
    text-align: center;
}

.tbl-cart tbody td {
    background-color: #fff;
    color: #222;
    padding: 6px 8px;
    vertical-align: middle;
}

.tbl-cart tfoot td {
    background-color: #e8e8e8;
    color: #222;
    padding: 6px 8px;
    font-weight: bold;
}

.cart-item-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ccc;
    padding: 3px;
    vertical-align: middle;
    margin-right: 10px;
    background-color: #fff; /* fond blanc si l'image est manquante */
    object-fit: contain;
}

.cart-item-ref {
    font-weight: bold;
}

.cart-item-dims {
    font-size: 0.78em;
    color: #888;
    margin-left: 42px; /* aligne avec le texte après l'image */
    display: inline-block;
}

.btnRemoveAction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cc3333;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}

.btnRemoveAction:hover {
    opacity: 1;
    color: #ff4444;
}

.btnRemoveAction svg {
    width: 17px;
    height: 17px;
}

/* ============================================================
   PAGE SEND — RÉCAPITULATIF DE COMMANDE
   ============================================================ */

.send-summary {
    max-width: 760px;
    margin: 24px auto;
    padding: 0 16px;
}

.send-summary .tbl-cart {
    margin-bottom: 0;
}

.cart-item-dims-cell {
    font-size: 0.82em;
    color: #666;
}

.send-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.btn-back {
    color: #aaa;
    font-size: 0.9em;
    transition: color 0.2s;
    text-decoration: none;
}

.btn-back:hover {
    color: #ddd;
}

.btn-integrate {
    display: inline-block;
    padding: 14px 48px;
    font-size: 1.15em;
    font-weight: bold;
    background-color: #2a9d2a;
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    letter-spacing: 0.03em;
}

.btn-integrate:hover {
    background-color: #237a23;
    transform: translateY(-1px);
}

.btn-integrate:active {
    transform: translateY(0);
}

/* ============================================================
   PANIER VIDE
   ============================================================ */

.no-records {
    text-align: center;
    margin: 40px 0;
    color: #aaa;
    font-style: italic;
}
