/* Styles du calculateur de volume de déménagement.
   Reprend les variables de demo-style.css pour rester dans l'identité du site.
   Tout est préfixé par .outil pour ne pas toucher aux pages existantes. */

.outil {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 64px;
}

.outil-entete {
    padding: 36px 0 18px;
    max-width: 720px;
}

.outil-entete h1 {
    font-size: clamp(24px, 3.6vw, 34px);
    line-height: 1.2;
    margin: 0 0 10px;
    color: #1b2a38;
}

.outil-entete p {
    margin: 0;
    color: #5b6b7c;
    font-size: 16px;
    line-height: 1.55;
}

/* Écran de départ : choix du logement */
.choix-logement {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 22px 0 14px;
}

.choix-logement button {
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 12px;
    padding: 18px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #34495e;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.choix-logement button:hover {
    border-color: #3498db;
    box-shadow: 0 4px 14px rgba(52, 152, 219, .12);
    transform: translateY(-1px);
}

.choix-logement button .surface {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #95a5a6;
    margin-top: 4px;
}

.aide {
    font-size: 14px;
    color: #7a8a99;
    margin: 0 0 8px;
}

/* Bandeau de résultat toujours visible. Il se cale sous l'en-tête du site,
   dont la hauteur est mesurée en JS dans --h-header. */
.bandeau {
    position: sticky;
    top: var(--h-header, 76px);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 14px;
    padding: 14px 18px;
    margin-top: 18px;
    box-shadow: 0 6px 20px rgba(52, 73, 94, .07);
}

.bandeau .volume {
    min-width: 130px;
}

.bandeau .volume .nombre {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #1b2a38;
    font-variant-numeric: tabular-nums;
}

.bandeau .volume .unite {
    font-size: 15px;
    color: #7a8a99;
    margin-left: 2px;
}

.bandeau .volume .fourchette {
    display: block;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 5px;
}

.bandeau .camion {
    flex: 0 0 auto;
    width: 190px;
    max-width: 42vw;
}

.bandeau .camion svg {
    display: block;
    width: 100%;
    height: auto;
}

.bandeau .vehicule {
    flex: 1 1 180px;
    min-width: 160px;
}

.bandeau .vehicule .nom {
    font-weight: 600;
    font-size: 15px;
    color: #1b2a38;
}

.bandeau .vehicule .detail {
    font-size: 12px;
    color: #7a8a99;
    margin-top: 3px;
    line-height: 1.45;
}

/* Deux colonnes : pièces à gauche, éléments à droite */
.colonnes {
    display: grid;
    grid-template-columns: 262px 1fr;
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

/* Sans min-width: 0, la liste des pièces en flex impose sa largeur au grid et
   fait déborder toute la page horizontalement sur mobile. */
.colonnes > * {
    min-width: 0;
}

/* Le bouton de retour en haut du site masque la liste des meubles : l'outil a
   déjà son bandeau collant, on le retire sur cette page uniquement. */
.page-outil .floating-action {
    display: none;
}

.pieces {
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 14px;
    padding: 14px;
    position: sticky;
    top: calc(var(--h-header, 76px) + 104px);
}

.pieces h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #95a5a6;
    margin: 0 0 10px;
}

.pieces ul {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.piece-ligne {
    display: flex;
    align-items: stretch;
    gap: 2px;
    border-radius: 9px;
}

.piece-ligne:hover {
    background: #f2f7fb;
}

.piece-ligne.actif {
    background: #e8f3fb;
}

/* La croix ne prend la place que d'une icone, et ne se montre qu'au survol
   sur les appareils qui en ont un : sur mobile elle reste visible. */
.piece-suppr {
    flex: 0 0 auto;
    width: 26px;
    border: 0;
    background: none;
    color: #b3c1cf;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.piece-suppr:hover {
    color: #c0392b;
    background: #fdecea;
}

.piece-nom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.piece-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 14px;
    color: #34495e;
    text-align: left;
    cursor: pointer;
}

.piece-item:hover,
.piece-item.actif {
    background: transparent;
}

.piece-ligne.actif .piece-item {
    color: #2980b9;
    font-weight: 600;
}

.piece-item .volume-piece {
    font-size: 12px;
    color: #95a5a6;
    font-variant-numeric: tabular-nums;
}

.bouton {
    display: inline-block;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    background: #fff;
    color: #34495e;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 14px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.bouton:hover {
    border-color: #3498db;
    color: #2980b9;
}

.bouton.plein {
    background: #2980b9;
    border-color: #2980b9;
    color: #fff;
}

.bouton.plein:hover {
    background: #2472a4;
    color: #fff;
}

.bouton.large {
    display: block;
    width: 100%;
    text-align: center;
}

/* La checklist est le seul bouton qui produit un fichier : il se distingue
   sans crier, et reste inactif tant qu'aucune piece n'est saisie. */
.bouton-checklist {
    margin-top: 10px;
    border-color: #2980b9;
    color: #2980b9;
}

.bouton-checklist:disabled {
    border-color: #dbe3ea;
    color: #a9b6c2;
    cursor: not-allowed;
}

/* Zone de saisie des éléments */
.atelier-piece {
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 14px;
    padding: 18px;
    min-height: 320px;
}

/* Titre, surface et recherche sur une seule ligne : chaque bandeau economise
   se paie en lignes de meubles visibles sans defiler. */
.atelier-piece .entete-piece {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    margin-bottom: 10px;
}

.entete-nom {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.atelier-piece h2 {
    font-size: 19px;
    margin: 0;
    color: #1b2a38;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atelier-piece .sous-titre {
    font-size: 12.5px;
    color: #95a5a6;
    white-space: nowrap;
}

.renommer {
    align-self: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    color: #7f8c8d;
    line-height: 0;
    cursor: pointer;
}

.renommer svg {
    display: block;
}

.renommer:hover {
    background: #eef4f9;
    color: #2980b9;
}

.atelier-piece .champ-nom {
    width: 220px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #dde5ee;
    border-radius: 9px;
    font: inherit;
    font-size: 16px;
    color: #34495e;
}

.champ-recherche {
    flex: 1 1 240px;
    min-width: 160px;
    width: auto;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #dde5ee;
    border-radius: 9px;
    font-size: 14px;
    margin-bottom: 0;
    color: #34495e;
}

.champ-recherche:focus {
    outline: 2px solid rgba(52, 152, 219, .35);
    border-color: #3498db;
}

/* Ajout d'une pièce : une surface, un nom facultatif, un bouton. */
.ajout-piece {
    margin-top: 10px;
}

.ajout-champs {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.ajout-piece input {
    box-sizing: border-box;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #dde5ee;
    border-radius: 9px;
    font: inherit;
    font-size: 13.5px;
    color: #34495e;
}

.ajout-piece input:focus {
    outline: 2px solid rgba(52, 152, 219, .35);
    border-color: #3498db;
}

.ajout-piece .champ-nom {
    flex: 1 1 auto;
    width: auto;
}

.ajout-piece .champ-m2 {
    flex: 0 0 60px;
    text-align: center;
}

.famille-nb {
    margin-left: 8px;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
    color: #95a5a6;
}

.famille h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #95a5a6;
    margin: 0 0 4px;
    padding-left: 10px;
}

/* Puces de familles : une rangee qui defile, au lieu d'un catalogue deplie.
   Le degrade et le chevron a droite disent qu'il reste des familles a voir ;
   ils disparaissent une fois la rangee parcourue jusqu'au bout. */
.puces-bloc {
    position: relative;
}

.puces-bloc::before,
.puces-bloc::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 10px;
    width: 46px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.puces-bloc::before {
    left: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0), #fff 72%);
}

.puces-bloc::after {
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 2px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff 62%);
    color: #8d9aa6;
    font-size: 20px;
    line-height: 1;
}

.puces-bloc.debut::before,
.puces-bloc.fin::after {
    opacity: 1;
}

.puces-bloc.fin::after {
    content: '›';
}

.puces {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 10px;
    margin-bottom: 6px;
    scrollbar-width: none;
}

.puces::-webkit-scrollbar {
    display: none;
}

.puce {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border: 1px solid #e1e8f0;
    border-radius: 999px;
    background: #fff;
    color: #46586a;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.puce:hover {
    border-color: #b9d5ea;
    color: #2980b9;
}

.puce.active {
    background: #3498db;
    border-color: #3498db;
    color: #fff;
}

.puce-nb {
    min-width: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #eaf4fc;
    color: #2980b9;
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.puce.active .puce-nb {
    background: rgba(255, 255, 255, .28);
    color: #fff;
}

/* Une ligne par meuble. Deux colonnes des que la place le permet : la hauteur
   de la liste est divisee par deux sans reduire la taille de la ligne.
   Les familles sont en display: contents pour que les lignes se remplissent
   en continu d'une famille a l'autre : sinon chacune laissait un trou a droite
   quand elle comptait un nombre impair de meubles. */
.lignes-liste {
    display: grid;
    grid-template-columns: 1fr;
}

.lignes-liste .famille,
.lignes-liste .lignes {
    display: contents;
}

.lignes-liste .famille h3 {
    grid-column: 1 / -1;
    margin-top: 6px;
}

@media (min-width: 900px) {
    .lignes-liste {
        grid-template-columns: 1fr 1fr;
        column-gap: 14px;
    }
}

.ligne {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 0 10px;
    border-bottom: 1px solid #f1f5f9;
}

.ligne:hover {
    background: #f7fbfe;
}

.ligne.on {
    background: #ecf6fd;
    box-shadow: inset 3px 0 #3498db;
}

.ligne .picto {
    display: flex;
    color: #8d9aa6;
}

.ligne.on .picto {
    color: #2980b9;
}

.ligne-txt {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.ligne .nom {
    font-size: 14px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ligne.on .nom {
    font-weight: 600;
    color: #1b2a38;
}

.ligne .vol {
    font-size: 12px;
    color: #95a5a6;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 2px;
}

.stepper button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d6dfe8;
    background: #fff;
    color: #34495e;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.stepper button:hover {
    border-color: #3498db;
    color: #2980b9;
}

.stepper .qte {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1b2a38;
    font-variant-numeric: tabular-nums;
}

/* A zero, seul le + est la. visibility et non display : la ligne garde sa
   largeur quand la quantite passe de 0 a 1, rien ne saute. */
.ligne:not(.on) .moins,
.ligne:not(.on) .qte {
    visibility: hidden;
}

.ligne.arrivee {
    animation: arrivee 700ms ease;
}

@keyframes arrivee {
    0% {
        background: #cfe8fa;
    }
    100% {
        background: #ecf6fd;
    }
}

/* Résultat détaillé */
.resultat {
    margin-top: 26px;
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 14px;
    padding: 22px;
}

.resultat h2 {
    font-size: 20px;
    margin: 0 0 14px;
    color: #1b2a38;
}

.grille-resultat {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
}

.bloc-resultat .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #95a5a6;
    margin-bottom: 4px;
}

.bloc-resultat .valeur {
    font-size: 21px;
    font-weight: 700;
    color: #1b2a38;
    line-height: 1.2;
}

.bloc-resultat .precision {
    font-size: 12px;
    color: #7a8a99;
    margin-top: 4px;
    line-height: 1.45;
}

.message-alerte {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    background: #fff6e6;
    border: 1px solid #f6d9a0;
    color: #7a5a14;
}

.message-alerte.neutre {
    background: #f3f7fb;
    border-color: #dde5ee;
    color: #4a5a6a;
}

.methode {
    margin-top: 44px;
    max-width: 760px;
}

.methode h2 {
    font-size: 22px;
    color: #1b2a38;
    margin: 0 0 12px;
}

.methode h3 {
    font-size: 17px;
    color: #1b2a38;
    margin: 26px 0 8px;
}

.methode p,
.methode li {
    font-size: 15px;
    line-height: 1.65;
    color: #46586a;
}

.methode ul {
    padding-left: 20px;
}

.methode table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 14px;
}

.methode th,
.methode td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e4ebf3;
    color: #34495e;
}

.methode th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #95a5a6;
}

.methode .tableau {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0;
}

@media (max-width: 860px) {
    .outil {
        padding: 0 14px 48px;
    }
    .colonnes {
        grid-template-columns: 1fr;
    }
    .pieces {
        position: static;
    }
    .pieces ul {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }
    .pieces ul::-webkit-scrollbar {
        display: none;
    }
    .pieces li {
        flex: 0 0 auto;
    }
    .piece-item {
        white-space: nowrap;
        border: 1px solid #dde5ee;
    }
    .bandeau {
        gap: 10px;
        flex-wrap: nowrap;
        padding: 10px 14px;
    }
    .bandeau .volume {
        flex: 1 1 auto;
        min-width: 0;
    }
    .bandeau .vehicule {
        flex: 0 1 auto;
        min-width: 0;
    }
    .bandeau .volume .nombre {
        font-size: 22px;
    }
    .bandeau .camion {
        width: 64px;
        flex: 0 0 auto;
    }
    /* Deux barres collantes sur un écran de 390 px mangent le tiers de la
       hauteur : on ne garde que le volume, le camion et le véhicule. */
    .bandeau .volume .fourchette,
    .bandeau .vehicule .detail {
        display: none;
    }
    .bandeau .vehicule .nom {
        font-size: 13px;
        line-height: 1.3;
    }
    .methode table {
        min-width: 560px;
        font-size: 13px;
    }
    .atelier-piece .entete-piece {
        gap: 8px;
    }
    .atelier-piece .champ-recherche {
        flex: 1 1 100%;
    }
    .atelier-piece h2 {
        font-size: 17px;
    }
    .ligne {
        min-height: 52px;
        padding: 0 6px;
    }
    .ligne .vol {
        display: none;
    }
}

/* Cartes de la page de présentation des outils */
.outils-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.outil-carte {
    display: block;
    background: #fff;
    border: 1px solid #dde5ee;
    border-radius: 14px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a.outil-carte:hover {
    border-color: #3498db;
    box-shadow: 0 8px 22px rgba(52, 73, 94, .09);
    transform: translateY(-2px);
}

.outil-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eaf4fb;
    color: #2980b9;
    font-size: 19px;
}

.outil-titre {
    font-size: 18px;
    margin: 14px 0 8px;
    color: #1b2a38;
}

.outil-texte {
    font-size: 14px;
    line-height: 1.55;
    color: #5b6b7c;
    margin: 0 0 16px;
}

.outil-lien {
    font-size: 14px;
    font-weight: 600;
    color: #2980b9;
}

.outil-carte.a-venir {
    opacity: .7;
}

.outil-carte.a-venir .outil-lien {
    color: #95a5a6;
}
