/* -------------------------------------------------------------------
 * Champ « Marque » commun (js/marque-champ.js) et fenêtre « Gérer les
 * marques » (#modal-marques). Vocabulaire et couleurs des fenêtres mm
 * (css/modal-machine.css), avec des valeurs de secours hors fenêtre.
 * ------------------------------------------------------------------- */

.marque-zone { position: relative; }

.marque-liste {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--mm-trait, rgba(19, 26, 46, 0.12));
    border-radius: var(--mm-rayon-champ, 8px);
    background: var(--mm-fond, #fff);
    box-shadow: 0 10px 28px rgba(19, 26, 46, 0.18);
    text-align: left;
}

.marque-liste .marque-item,
.marque-liste .marque-gerer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--mm-texte, #131a2e);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.marque-liste .marque-item small { color: var(--mm-texte-3, #5f6883); font-size: 11.5px; }
.marque-liste .marque-item:hover,
.marque-liste .marque-item.is-actif { background: var(--mm-verre-hi, rgba(37, 99, 235, 0.08)); }
.marque-liste .marque-creer { justify-content: flex-start; color: var(--mm-accent, #2563eb); font-weight: 600; }

.marque-liste .marque-alerte {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-bottom: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
    font-size: 12.5px;
}
.marque-liste .marque-alerte .marque-proche {
    display: inline-flex;
    width: auto;
    padding: 2px 8px;
    border: 1px solid rgba(217, 119, 6, 0.4);
    border-radius: 999px;
    color: inherit;
    font-weight: 600;
}

.marque-liste .marque-gerer {
    justify-content: flex-start;
    margin-top: 4px;
    border-top: 1px solid var(--mm-trait, rgba(19, 26, 46, 0.08));
    border-radius: 0;
    color: var(--mm-texte-3, #5f6883);
    font-size: 12px;
}
.marque-liste .marque-gerer:hover { color: var(--mm-accent, #2563eb); }

.marque-vide { margin: 4px 10px; color: var(--mm-texte-3, #5f6883); font-size: 12.5px; }

body.v2-dark .marque-liste .marque-alerte { color: #fbbf24; background: rgba(217, 119, 6, 0.18); }

/* ── Fenêtre « Gérer les marques » : au-dessus de la fiche catalogue et du sélecteur ── */
#modal-marques { z-index: 10070; }
.modal-backdrop.mk-voile { z-index: 10065; }
#modal-marques.mm-modal .modal-dialog { max-width: 620px; }

#modal-marques .mk-sous-titre { margin: 2px 0 0; font-size: 12.5px; color: var(--mm-texte-3); }
#modal-marques .mk-recherche { position: relative; margin-bottom: 10px; }
#modal-marques .mk-recherche > .ti-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mm-texte-3);
    pointer-events: none;
}
#modal-marques .mk-recherche .form-control { padding-left: 36px; }
#modal-marques .mk-liste { max-height: 52vh; overflow-y: auto; }
#modal-marques .mk-ligne {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 2px;
    border-bottom: 1px solid var(--mm-trait);
}
#modal-marques .mk-nb { font-size: 12px; color: var(--mm-texte-3); white-space: nowrap; }
#modal-marques .mk-compte { font-size: 12.5px; color: var(--mm-texte-3); }

@media (max-width: 560px) {
    #modal-marques .mk-ligne { grid-template-columns: minmax(0, 1fr) auto; }
    #modal-marques .mk-nb { grid-column: 1; }
}
