/**
 * Fichier  : assets/css/barcodes-mobile.css
 * Auteur   : KREMER Régis
 * Version  : 2.6.83
 * Date     : 2026-07-20
 * Description : Assistant mobile/tablette de génération d'étiquettes et codes-barres.
 *
 * Changelog :
 *   v2.6.83 — BARCODES WIZARD7 : sélection, style, format/options, revue et sortie tactile.
 */

.bc-mobile-wizard { display: none; }

@media (max-width: 1199px) {
    .bc-page { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    .bc-desktop-experience { display: none !important; }
    .bc-mobile-wizard {
        display: block;
        width: 100%;
        min-width: 0;
        color: var(--text-primary);
    }

    .bc-mobile-wizard__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 14px;
    }
    .bc-mobile-wizard__eyebrow,
    .bc-mobile-step__count,
    .bc-mobile-preview-heading span,
    .bc-mobile-sheet-preview > header span {
        display: block;
        margin-bottom: 4px;
        color: var(--blue, #2563eb);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .07em;
        text-transform: uppercase;
    }
    .bc-mobile-wizard__header h2,
    .bc-mobile-step__intro h3 {
        margin: 0;
        color: var(--text-primary);
        line-height: 1.15;
    }
    .bc-mobile-wizard__header h2 { font-size: clamp(22px, 5.8vw, 30px); }
    .bc-mobile-step__intro h3 { font-size: clamp(20px, 5vw, 26px); }
    .bc-mobile-wizard__header p,
    .bc-mobile-step__intro p {
        margin: 6px 0 0;
        color: var(--text-muted);
        font-size: 14px;
        line-height: 1.5;
    }
    .bc-mobile-wizard__clear { min-width: 64px; min-height: 44px; }

    .bc-mobile-progress {
        position: relative;
        height: 5px;
        margin-bottom: 10px;
        overflow: hidden;
        background: var(--border);
    }
    .bc-mobile-progress::after {
        position: absolute;
        inset: 0 auto 0 0;
        width: var(--ms-flow-progress, 25%);
        content: "";
        background: var(--blue, #2563eb);
        transition: width .2s ease;
    }

    .bc-mobile-steps {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 18px;
    }
    .bc-mobile-steps button {
        min-width: 0;
        min-height: 48px;
        padding: 7px 4px;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text-muted);
        cursor: pointer;
    }
    .bc-mobile-steps button span {
        display: grid;
        place-items: center;
        width: 22px;
        height: 22px;
        margin: 0 auto 4px;
        border: 1px solid currentColor;
        font-size: 11px;
        font-weight: 800;
    }
    .bc-mobile-steps button strong {
        display: block;
        overflow: hidden;
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bc-mobile-steps button[data-ms-flow-state="current"] {
        border-color: var(--blue, #2563eb);
        background: var(--blue-pale, #eff6ff);
        color: var(--blue, #2563eb);
    }
    .bc-mobile-steps button[data-ms-flow-state="complete"] { color: var(--success, #16a34a); }
    .bc-mobile-steps button:disabled { cursor: default; opacity: .58; }

    .bc-mobile-step {
        min-width: 0;
        padding-bottom: 18px;
    }
    .bc-mobile-step__intro {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 16px;
    }
    .bc-mobile-selection-count {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 8px 10px;
        border: 1px solid rgba(37, 99, 235, .28);
        background: var(--blue-pale, #eff6ff);
        color: var(--blue, #2563eb);
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
    }

    .bc-mobile-searchbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin-bottom: 8px;
    }
    .bc-mobile-searchbar .inp { min-width: 0; min-height: 48px; font-size: 16px; }
    .bc-mobile-filter-button { min-height: 48px; white-space: nowrap; }
    .bc-mobile-filter-count {
        display: inline-grid;
        place-items: center;
        min-width: 20px;
        height: 20px;
        margin-left: 5px;
        padding: 0 5px;
        background: var(--blue, #2563eb);
        color: #fff;
        font-size: 11px;
        font-weight: 800;
    }
    .bc-mobile-active-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        min-height: 0;
        margin-bottom: 8px;
    }
    .bc-mobile-active-filters:empty { display: none; }
    .bc-mobile-filter-chip {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 5px 9px;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
    }
    .bc-mobile-list-tools {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 10px 0;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 700;
    }
    .bc-mobile-list-tools > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

    .bc-mobile-product-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }
    .bc-mobile-product-card {
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) auto;
        grid-template-areas:
            "media main select"
            "media quantity quantity";
        gap: 8px 12px;
        align-items: center;
        min-width: 0;
        padding: 12px;
        border: 1px solid var(--border);
        background: var(--bg-card);
        box-shadow: 0 2px 7px rgba(15, 23, 42, .04);
    }
    .bc-mobile-product-card.is-selected {
        border-color: var(--blue, #2563eb);
        box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
    }
    .bc-mobile-product-card__media {
        grid-area: media;
        display: grid;
        place-items: center;
        width: 58px;
        height: 58px;
        overflow: hidden;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        font-size: 24px;
    }
    .bc-mobile-product-card__media img { width: 100%; height: 100%; object-fit: contain; }
    .bc-mobile-product-card__main { grid-area: main; min-width: 0; }
    .bc-mobile-product-card__main h4 {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        color: var(--text-primary);
        font-size: 14px;
        font-weight: 800;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
    .bc-mobile-product-card__main p {
        margin: 3px 0 0;
        overflow: hidden;
        color: var(--text-muted);
        font-family: var(--font-mono, monospace);
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bc-mobile-product-card__stock {
        display: block;
        margin-top: 4px;
        color: var(--blue, #2563eb);
        font-size: 11px;
        font-weight: 700;
    }
    .bc-mobile-product-card__select {
        grid-area: select;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        color: var(--text-muted);
        cursor: pointer;
        font-size: 18px;
        font-weight: 900;
    }
    .bc-mobile-product-card.is-selected .bc-mobile-product-card__select {
        border-color: var(--blue, #2563eb);
        background: var(--blue, #2563eb);
        color: #fff;
    }
    .bc-mobile-product-card__quantity {
        grid-area: quantity;
        display: grid;
        grid-template-columns: 44px 68px 44px minmax(0, 1fr);
        gap: 5px;
        align-items: center;
        padding-top: 7px;
        border-top: 1px solid var(--border);
    }
    .bc-mobile-product-card__quantity button {
        min-width: 44px;
        min-height: 44px;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        color: var(--text-primary);
        cursor: pointer;
        font-size: 20px;
        font-weight: 800;
    }
    .bc-mobile-product-card__quantity input {
        width: 68px;
        min-height: 44px;
        padding: 6px;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text-primary);
        font-size: 16px;
        font-weight: 800;
        text-align: center;
    }
    .bc-mobile-product-card__quantity span {
        justify-self: end;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 700;
    }
    .bc-mobile-empty {
        padding: 30px 18px;
        border: 1px dashed var(--border);
        color: var(--text-muted);
        text-align: center;
    }
    .bc-mobile-load-more { display: flex; justify-content: center; padding: 14px 0 2px; }
    .bc-mobile-load-more .btn { min-height: 44px; }

    .bc-mobile-config-layout { display: grid; gap: 14px; }
    .bc-mobile-choice-grid,
    .bc-mobile-format-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .bc-mobile-choice,
    .bc-mobile-format {
        position: relative;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "mark title"
            "mark sub";
        column-gap: 12px;
        align-items: center;
        min-height: 72px;
        padding: 12px;
        border: 1px solid var(--border);
        background: var(--bg-card);
        cursor: pointer;
    }
    .bc-mobile-choice input,
    .bc-mobile-format input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }
    .bc-mobile-choice > span {
        grid-area: mark;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        font-size: 20px;
    }
    .bc-mobile-choice strong,
    .bc-mobile-format strong { grid-area: title; color: var(--text-primary); font-size: 14px; }
    .bc-mobile-choice small,
    .bc-mobile-format small { grid-area: sub; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
    .bc-mobile-choice:has(input:checked),
    .bc-mobile-format:has(input:checked) {
        border-color: var(--blue, #2563eb);
        background: var(--blue-pale, #eff6ff);
        box-shadow: 0 0 0 2px rgba(37, 99, 235, .1);
    }
    .bc-mobile-choice:has(input:checked) > span {
        border-color: var(--blue, #2563eb);
        background: var(--blue, #2563eb);
        color: #fff;
    }
    .bc-mobile-choice:focus-within,
    .bc-mobile-format:focus-within,
    .bc-mobile-product-card__select:focus-visible,
    .bc-mobile-product-card__quantity button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, .35);
        outline-offset: 2px;
    }

    .bc-mobile-form-card,
    .bc-mobile-custom-format,
    .bc-mobile-options,
    .bc-mobile-format-summary,
    .bc-mobile-review-card,
    .bc-mobile-sheet-preview,
    .bc-mobile-live-preview {
        border: 1px solid var(--border);
        background: var(--bg-card);
    }
    .bc-mobile-form-card { display: grid; gap: 7px; padding: 14px; }
    .bc-mobile-form-card label,
    .bc-mobile-custom-format label {
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 800;
    }
    .bc-mobile-form-card label span { color: var(--text-muted); font-weight: 500; }
    .bc-mobile-form-card .inp,
    .bc-mobile-form-card .sel,
    .bc-mobile-custom-format .inp { min-height: 46px; font-size: 16px; }
    #bcMobBarcodeFields,
    #bcMobQrFields { display: grid; gap: 7px; margin-top: 6px; }
    #bcMobQrFields[hidden], #bcMobBarcodeFields[hidden] { display: none; }

    .bc-mobile-live-preview { padding: 12px; }
    .bc-mobile-preview-heading,
    .bc-mobile-sheet-preview > header,
    .bc-mobile-review-card > header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    .bc-mobile-preview-heading { margin-bottom: 10px; }
    .bc-mobile-preview-heading h4,
    .bc-mobile-sheet-preview h4,
    .bc-mobile-review-card h4 { margin: 0; color: var(--text-primary); font-size: 15px; }
    .bc-mobile-preview-heading small { color: var(--text-muted); font-size: 11px; }
    .bc-mobile-preview-surface {
        display: grid;
        place-items: center;
        min-height: 150px;
        padding: 14px;
        overflow: auto;
        border: 1px dashed var(--border);
        background: var(--bg-elevated);
    }
    .bc-mobile-preview-surface .lg-preview-label {
        width: min(100%, 310px);
        min-width: 240px;
        height: 150px;
    }
    .bc-mobile-preview-surface .lg-bc-wrap canvas { max-height: 52px; }
    .bc-mobile-preview-surface .lg-label-name { font-size: 13px; }
    .bc-mobile-preview-surface .lg-label-sku,
    .bc-mobile-preview-surface .lg-label-code,
    .bc-mobile-preview-surface .lg-label-size { font-size: 11px; }
    .bc-mobile-preview-surface .lg-label-img { width: 62px; height: 62px; flex-basis: 62px; }
    .bc-mobile-preview-surface .lg-label-img-full { max-height: 48px; }

    .bc-mobile-format-grid { margin-bottom: 12px; }
    .bc-mobile-format {
        grid-template-columns: 1fr;
        grid-template-areas: "title" "sub";
        min-height: 62px;
    }
    .bc-mobile-custom-format {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 14px;
        margin-bottom: 12px;
    }
    .bc-mobile-custom-format[hidden] { display: none; }
    .bc-mobile-custom-format > div { display: grid; gap: 6px; }
    .bc-mobile-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 12px;
        padding: 14px;
    }
    .bc-mobile-options legend {
        padding: 0 5px;
        color: var(--text-primary);
        font-size: 13px;
        font-weight: 800;
    }
    .bc-mobile-options label {
        display: flex;
        align-items: center;
        gap: 9px;
        min-height: 46px;
        padding: 9px;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        color: var(--text-secondary);
        cursor: pointer;
        font-size: 12px;
        font-weight: 700;
    }
    .bc-mobile-options input { width: 20px; height: 20px; flex: 0 0 auto; }
    .bc-mobile-format-summary { padding: 13px 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
    .bc-mobile-format-summary strong { color: var(--text-primary); }

    .bc-mobile-review-grid { display: grid; gap: 10px; margin-bottom: 12px; }
    .bc-mobile-review-card { padding: 13px; }
    .bc-mobile-review-card > header { margin-bottom: 9px; }
    .bc-mobile-review-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
    .bc-mobile-review-card dl { display: grid; gap: 7px; margin: 0; }
    .bc-mobile-review-card dl > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: baseline;
        padding-bottom: 7px;
        border-bottom: 1px solid var(--border);
    }
    .bc-mobile-review-card dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
    .bc-mobile-review-card dt { color: var(--text-muted); font-size: 12px; }
    .bc-mobile-review-card dd { margin: 0; color: var(--text-primary); font-size: 12px; font-weight: 800; text-align: right; }

    .bc-mobile-sheet-preview { padding: 13px; }
    .bc-mobile-sheet-preview > header { align-items: flex-start; margin-bottom: 10px; }
    .bc-mobile-preview-pagination { display: grid; grid-template-columns: auto; gap: 5px; justify-items: center; }
    .bc-mobile-preview-pagination output { color: var(--text-secondary); font-size: 11px; font-weight: 800; }
    .bc-mobile-preview-surface--sheet {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        place-items: stretch;
        min-height: 230px;
    }
    .bc-mobile-preview-surface--sheet .lg-preview-label { width: 100%; min-width: 0; height: 132px; }
    .bc-mobile-preview-note { margin: 9px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.45; }

    .bc-mobile-validation {
        margin: 10px 0 0;
        padding: 10px 12px;
        border: 1px solid rgba(220, 38, 38, .35);
        background: rgba(220, 38, 38, .08);
        color: var(--danger, #dc2626);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.45;
    }
    .bc-mobile-validation[hidden] { display: none; }

    .bc-mobile-actions {
        display: grid;
        grid-template-columns: auto minmax(110px, auto);
        gap: 8px;
        align-items: center;
        margin: 18px -12px -18px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--border);
        background: color-mix(in srgb, var(--bg-card) 94%, transparent);
        box-shadow: 0 -7px 20px rgba(15, 23, 42, .08);
        backdrop-filter: blur(12px);
    }
    .bc-mobile-actions .btn { min-height: 48px; }
    .bc-mobile-actions__summary {
        overflow: hidden;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 700;
        line-height: 1.35;
        text-overflow: ellipsis;
    }
    .bc-mobile-actions--output { grid-template-columns: auto 1fr 1fr; }

    .bc-mobile-filter-form { display: grid; gap: 13px; }
    .bc-mobile-filter-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 800; }
    .bc-mobile-filter-form .sel { min-height: 48px; font-size: 16px; }
    .bc-mobile-filter-form__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 3px; }

    html[data-ms-keyboard="open"] .bc-mobile-step { padding-bottom: 20px; }
}

@media (min-width: 600px) and (max-width: 1199px) {
    .bc-mobile-product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bc-mobile-choice-grid,
    .bc-mobile-format-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bc-mobile-format--wide { grid-column: 1 / -1; }
    .bc-mobile-config-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); align-items: start; }
    .bc-mobile-config-layout .bc-mobile-choice-grid { grid-column: 1; }
    .bc-mobile-config-layout .bc-mobile-form-card { grid-column: 1; }
    .bc-mobile-config-layout .bc-mobile-live-preview { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--ms-visual-offset-top, 0px) + 12px); }
    .bc-mobile-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bc-mobile-preview-surface--sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bc-mobile-actions { margin-left: 0; margin-right: 0; padding-left: 16px; padding-right: 16px; }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .bc-mobile-product-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bc-mobile-preview-surface--sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .bc-mobile-wizard { display: none !important; }
    .bc-desktop-experience { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    .bc-mobile-progress::after { transition: none; }
}
