/* ===== WIZARD — styles partagés (app + catalogue) ===== */

.modal-content.wizard-modal {
    background: white;
    border-radius: 14px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Indicateur d'étapes */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px 8px;
}

.wizard-step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e4ea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
}

.wizard-step-dot.active {
    background: #00a8ff;
    color: white;
}

.wizard-step-dot.done {
    background: #27ae60;
    color: white;
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: #e0e4ea;
    max-width: 60px;
}

.wizard-subtitle {
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 4px 0 14px;
    border-bottom: 1px solid #f0f0f0;
}

/* Corps scrollable */
.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Pied avec boutons */
.wizard-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}

.wizard-footer .btn {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
}

/* Badge GTIN */
.wizard-gtin {
    background: #f7f9fc;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    font-family: monospace;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wizard-gtin small {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    font-family: sans-serif;
}

/* Labels */
.wizard-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.wizard-optional {
    font-weight: 400;
    color: #aaa;
    font-size: 12px;
}

/* Inputs */
.wizard-input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wizard-input:focus {
    border-color: #00a8ff;
    box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.12);
}

/* Recherche */
.wizard-search {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}

.wizard-search:focus {
    border-color: #00a8ff;
}

/* Toggle Oui / Non */
.toggle-group {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    flex: 1;
    padding: 16px;
    border: 2px solid #e0e4ea;
    border-radius: 10px;
    background: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #555;
    transition: 0.15s;
}

.toggle-btn.active {
    border-color: #00a8ff;
    background: #eef6ff;
    color: #00a8ff;
}

/* Liste d'items sélectionnables */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

/* Résultats BDPM */
.bdpm-item {
    border: 1.5px solid #dde4ee;
    border-radius: 10px;
    background: #fff;
    padding: 11px 15px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.bdpm-item:hover {
    background: #eef6ff;
    border-color: #b8d9f8;
}
.bdpm-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.bdpm-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.35;
}
.bdpm-meta {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}
.bdpm-amm {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}
.bdpm-amm-ok   { background: #27ae60; }
.bdpm-amm-warn { background: #e67e22; }

.item-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1.5px solid #dde4ee;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    width: 100%;
    min-height: 64px;
    transition: 0.15s;
    color: #333;
}

.item-btn:hover {
    background: #eef6ff;
    border-color: #c5e8ff;
}

.item-btn.selected {
    background: #eef6ff;
    border-color: #00a8ff;
    color: #0088cc;
}

.item-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    color: white;
    flex-shrink: 0;
    margin-left: 8px;
}

.empty-list {
    text-align: center;
    color: #aaa;
    padding: 20px;
    font-size: 14px;
    margin: 0;
}

/* Bouton créer nouveau */
.btn-create-new {
    padding: 12px 16px;
    border: 1px dashed #bbb;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    text-align: left;
    width: 100%;
    transition: 0.15s;
}

.btn-create-new:hover {
    background: #f9fafc;
    border-color: #00a8ff;
    color: #00a8ff;
}

/* Cartes catégories */
.category-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.category-card {
    padding: 16px;
    border-radius: 10px;
    border: 3px solid transparent;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
    color: white;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    opacity: 0.85;
    transition: 0.15s;
}

.category-card:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.category-card.selected {
    border-color: #333;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Quantité packaging */
.wizard-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 8px 0;
}

.wizard-qty button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #00a8ff;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.wizard-qty button:hover {
    background: #0090dd;
}

.wizard-qty-val {
    font-size: 40px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    color: #333;
}

/* Récapitulatif */
.summary-list {
    background: #f7f9fc;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    gap: 8px;
}

.summary-label {
    color: #888;
    min-width: 90px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

/* btn-light */
.btn-light {
    background: #f1f2f6;
    color: #555;
}

/* Bannière d'erreur dans le wizard */
.wizard-error {
    width: 100%;
    background: #ffe6e6;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

/* ===== WIZARD STEP 0 — choix du mode ===== */

.wizard-mode-hint {
    color: #666;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
    margin: 0 0 20px;
}

.wizard-mode-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
}

.mode-card {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 16px;
    border: 2px solid #e0e6f0;
    border-radius: 14px;
    background: #f7f9fc;
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
}

.mode-card:hover {
    background: #eef6ff;
    border-color: #00a8ff;
}

.mode-card-icon {
    font-size: 32px;
    line-height: 1;
}

.mode-card-label {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.mode-card-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* ===== WIZARD GTIN header ===== */

.wizard-gtin-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4ff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    word-break: break-all;
}

/* ===== WIZARD — chips de filtrage catégorie ===== */

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid transparent;
    background: #f0f2f5;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
}

.category-chip.active {
    background: var(--chip-color, #00a8ff);
    color: white;
    border-color: transparent;
}

.category-chip:not(.active):hover {
    background: #e4e8ef;
}

/* ===== WIZARD — badge référence sélectionnée ===== */

.wizard-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    align-self: flex-start;
}

/* ===== Item list — main + sub text ===== */

.item-btn:has(.item-main) {
    flex-direction: column;
    align-items: flex-start;
}

.item-main {
    font-size: 15px;
    font-weight: 500;
    color: #222;
    display: block;
}

.item-sub {
    font-size: 12px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    align-items: center;
}

.item-type {
    color: #888;
}

.item-mfg {
    color: #555;
    font-weight: 500;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 1px 5px;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.item-badge-existing {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: #e8f4fd;
    color: #1a6ea8;
    border: 1px solid #b8d9f0;
    flex-shrink: 0;
    white-space: nowrap;
}

.existing-barcodes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px solid #dde4ee;
    border-radius: 8px;
    padding: 10px 14px;
}

.existing-barcode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.existing-barcode-code {
    font-family: monospace;
    font-size: 13px;
    color: #333;
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 4px;
}

.existing-barcode-qty {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}
