/*
 * Panneau commun des sélecteurs (étiquettes, rubans) — module barcoda_imprimantes : un titre, des étapes numérotées
 * dont la première est l'imprimante, un décompte (views/templates/hook/_partials/finder.tpl). Ce qui est propre à
 * chaque famille reste dans etiquettes.css (le format) et rubans/rubans.css (la référence).
 */

.blf {
    --blf-ink: #061F29;
    --blf-muted: #5A6E75;
    --blf-rule: #DCE3E5;
    --blf-ground: #F3F6F7;
    --blf-liner: #E5ECEE;
    --blf-label-edge: #B6C5C9;
    --blf-amber: #FCA715;
    --blf-amber-soft: #FFF2D9;
    --blf-amber-ink: #8A5300;
    --blf-ok: #22804F;
    --blf-ok-soft: #E1F3E9;
    --blf-warn: #8F5400;
    --blf-warn-soft: #FFF0D2;
    --blf-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    margin-bottom: 1.5rem;
}

/* ---------- Panneau ---------- */

.blf-panel {
    background: #fff;
    border: 1px solid var(--blf-rule);
    border-radius: 1rem;
    color: var(--blf-ink);
    overflow: hidden;
}

.blf-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--blf-rule);
}

.blf-head-text {
    flex: 1 1 0;
    min-width: 0;
}

.blf-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.15;
}

/* Replier le sélecteur ne sert que sur mobile, où il occupe l'écran */
@media (min-width: 768px) {
    .blf-toggle {
        display: none;
    }
}

.blf-toggle {
    flex: none;
    border: 1px solid var(--blf-rule);
    background: #fff;
    border-radius: .5rem;
    padding: .3rem .75rem;
    font-size: .875rem;
    color: var(--blf-ink);
}

/* ---------- Étapes ---------- */

.blf-steps {
    display: grid;
    /* L'imprimante, puis ce que la famille demande ensuite : deux étapes de même forme, côte à côte */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.blf-steps[hidden] {
    display: none;
}

.blf-step {
    padding: 1.1rem 1.5rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    min-width: 0;
}

.blf-step + .blf-step {
    border-left: 1px solid var(--blf-rule);
}

.blf-step-title {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

.blf-step-title small {
    font-weight: 400;
    font-size: .8rem;
    color: var(--blf-muted);
}

.blf-num {
    display: inline-grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--blf-ink);
    color: #fff;
    font-size: .75rem;
    flex: none;
}

.blf-select {
    font-size: .95rem;
}

.blf-field label {
    display: block;
    margin: 0 0 .2rem;
    font-size: .8125rem;
    color: var(--blf-muted);
}

.blf-field select:disabled {
    background-color: var(--blf-ground);
    color: var(--blf-muted);
}

/* Un choix fait se voit dans la liste */
.blf-select.is-active {
    border-color: var(--blf-ink);
    font-weight: 600;
}

/* ---------- L'imprimante : marque et modèle, puis sa photo à côté de ce qu'elle accepte ---------- */

.blf-printer-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem;
}

.blf-printer-info {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.blf-printer-photo {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--blf-rule);
    border-radius: .5rem;
}

.blf-printer-photo[hidden] {
    display: none;
}

.blf-printer-photo:hover {
    border-color: var(--blf-label-edge);
}

.blf-printer-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.blf-printer-spec {
    margin: 0;
    font-size: .8125rem;
    color: var(--blf-muted);
    min-height: 1.2em;
}

.blf-printer-spec b {
    color: var(--blf-ink);
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Décompte ---------- */

.blf-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .85rem 1.5rem;
    background: var(--blf-ground);
    border-top: 1px solid var(--blf-rule);
}

.blf-summary {
    margin: 0;
    font-size: 1rem;
}

.blf-summary strong {
    font-weight: 700;
}

.blf-summary .blf-muted {
    color: var(--blf-muted);
}

/* Les liens d'action du panneau : effacer, format proche, devis, conseil */
.blf-summary button,
.blf-summary a,
.blf-reset {
    border: 0;
    background: none;
    padding: 0;
    color: var(--blf-amber-ink);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.blf-reset[hidden] {
    display: none;
}

.blf button:focus-visible,
.blf select:focus-visible,
.blf input:focus-visible {
    outline: 3px solid var(--blf-amber);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .blf-steps {
        grid-template-columns: 1fr;
    }
    .blf-step + .blf-step {
        border-left: 0;
        border-top: 1px solid var(--blf-rule);
    }
}

@media (max-width: 575.98px) {
    .blf-head,
    .blf-step,
    .blf-foot {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
