/* ═══════════════════════════════════════════════════════════════════════
   CAMALARM CRM — T175C : Mode expérimental — fusion design CRM + ergo Wix
   ═══════════════════════════════════════════════════════════════════════
   PHILOSOPHIE V3 :
     • On NE COPIE PAS Wix visuellement
     • On reprend les codes du Devis Classique CAMALARM existant :
         - palette --crm-bl, --crm-or, --crm-border, --crm-text-muted
         - typographie cohérente (Inter)
         - cartes blanches sobres avec border subtile (pas d'ombres lourdes)
         - boutons sobres dans le ton du CRM
     • On garde de Wix UNIQUEMENT :
         - la disposition (champ article large + ref discrète + desc en dessous)
         - le stepper qty
         - le dropdown ancré sous le champ
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   Wrap global — exactement le style d'une .dv-card du CRM
   ───────────────────────────────────────────────────────────────────── */
/* Wrap global — exactement la largeur d'une .dv-card du CRM
   (#tab-dvc-scope est déjà limité à 1220px par devis-classique-t131.css,
   donc width:100% s'aligne automatiquement avec la carte "Projet"
   au-dessus, sans décalage) */
#tab-dvc-scope #wixLinesWrap {
  width: 100%;
  max-width: none;
  margin: 0 0 20px;
  background: var(--crm-surface, #FFFFFF);
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ─────────────────────────────────────────────────────────────────────
   Toolbar haut — cohérent avec dv-card-header
   ───────────────────────────────────────────────────────────────────── */
#tab-dvc-scope .wix-lines-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
  background: var(--crm-surface, #FFFFFF);
  gap: 12px;
}
#tab-dvc-scope .wix-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
#tab-dvc-scope .wix-toolbar-icon {
  width: 18px;
  height: 18px;
  color: var(--crm-bl, #1565c0);
  flex-shrink: 0;
}
#tab-dvc-scope .wix-toolbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--crm-text, #101828);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
#tab-dvc-scope .wix-exp-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--crm-or-lt, #FFF3E0);
  color: var(--crm-or, #E65100);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
#tab-dvc-scope .wix-toolbar-count {
  font-size: 0.78rem;
  color: var(--crm-text-subtle, #94a3b8);
  font-weight: 500;
  white-space: nowrap;
}
#tab-dvc-scope .wix-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#tab-dvc-scope .wix-btn-from-catalog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--crm-bl, #1565c0);
  border: 1px solid var(--crm-bl, #1565c0);
  color: #FFFFFF;
  padding: 7px 13px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
#tab-dvc-scope .wix-btn-from-catalog:hover {
  background: #0d4c9c;
  border-color: #0d4c9c;
}
#tab-dvc-scope .wix-toggle-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--crm-surface, #FFFFFF);
  border: 1px solid var(--crm-border, #E6E9EF);
  color: var(--crm-text-muted, #475467);
  padding: 7px 13px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
#tab-dvc-scope .wix-toggle-back:hover {
  background: var(--crm-bg, #F5F7FA);
  border-color: var(--crm-border-hover, #D0D5DD);
  color: var(--crm-text, #101828);
}

/* ─────────────────────────────────────────────────────────────────────
   Header colonnes — esprit dv-extras thead
   ───────────────────────────────────────────────────────────────────── */
#tab-dvc-scope .wix-lines-header {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 120px 100px 90px 120px 40px;
  gap: 10px;
  padding: 10px 20px;
  background: var(--crm-bg, #F5F7FA);
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
}
#tab-dvc-scope .wix-h {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--crm-text-subtle, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#tab-dvc-scope .wix-h-num { text-align: right; }
#tab-dvc-scope .wix-h-main { text-align: left; padding-left: 2px; }

/* ─────────────────────────────────────────────────────────────────────
   Host des lignes — fond légèrement différencié comme dv-card-body
   ───────────────────────────────────────────────────────────────────── */
#tab-dvc-scope .wix-lines-host {
  padding: 4px 12px;
  background: var(--crm-surface, #FFFFFF);
}

/* Empty state */
#tab-dvc-scope .wix-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--crm-text-subtle, #94a3b8);
  font-size: 0.88rem;
  font-style: italic;
}

/* ═══════════ LIGNE WIX ═══════════
   Touche orange CAMALARM : bordure gauche subtile (signature visuelle
   de l'ancien Devis Classique). Reste discrète : 3px, fond très léger. */
#tab-dvc-scope .wix-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 120px 100px 90px 120px 40px;
  gap: 10px;
  align-items: start;
  padding: 14px 12px 14px 14px;
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
  border-left: 3px solid var(--crm-or, #E65100);
  background: rgba(230, 81, 0, 0.015);  /* fond orange très subtil */
  border-radius: 0 6px 6px 0;
  margin-bottom: 2px;
  transition: background 0.12s ease, border-left-color 0.12s ease;
}
#tab-dvc-scope .wix-line:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
#tab-dvc-scope .wix-line:hover {
  background: rgba(230, 81, 0, 0.035);
}
#tab-dvc-scope .wix-line:focus-within {
  background: var(--crm-bl-lt, #E3F2FD);
  border-left-color: var(--crm-bl, #1565c0);
}

#tab-dvc-scope .wix-col {
  min-width: 0;
}
#tab-dvc-scope .wix-col-action {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 8px;
}

/* ─── Colonne principale (article + ref + description) ─── */
#tab-dvc-scope .wix-col-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
#tab-dvc-scope .wix-search-wrapper {
  position: relative;
}
#tab-dvc-scope .wix-search-input {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--crm-text, #101828);
  background: var(--crm-surface, #FFFFFF);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#tab-dvc-scope .wix-search-input::placeholder {
  color: var(--crm-text-subtle, #94a3b8);
  font-weight: 400;
  font-style: italic;
}
#tab-dvc-scope .wix-search-input:focus {
  border-color: var(--crm-bl, #1565c0);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.10);
}
#tab-dvc-scope .wix-search-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--crm-text-subtle, #94a3b8);
  pointer-events: none;
}

/* Référence — petit badge léger en 2 zones (label + valeur) */
#tab-dvc-scope .wix-ref-pill {
  display: inline-flex;
  align-items: stretch;
  align-self: flex-start;
  border: 1px solid rgba(21, 101, 192, 0.18);
  border-radius: 5px;
  overflow: hidden;
  margin-left: 2px;
  font-size: 10.5px;
  line-height: 1;
  height: 18px;
}
#tab-dvc-scope .wix-ref-label {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  background: var(--crm-bl-lt, #E3F2FD);
  color: var(--crm-bl, #1565c0);
  font-family: inherit;
  font-weight: 700;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
#tab-dvc-scope .wix-ref-val {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  background: var(--crm-surface, #FFFFFF);
  color: var(--crm-text, #101828);
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.01em;
}
#tab-dvc-scope .wix-ref-pill-empty {
  display: none;
}

/* Description multi-lignes — auto-expand (compact court → s'agrandit long)
   T176 §1.3 : font-size légèrement réduit (13px) pour rendu plus élégant et
   moins massif, plus proche d'un devis professionnel.
   !important nécessaire : devis-classique-t131.css impose font-size:14px sur
   tous les textarea du scope #tab-dvc-scope. */
#tab-dvc-scope .wix-desc {
  width: 100%;
  padding: 8px 12px !important;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 8px;
  background: var(--crm-surface, #FFFFFF);
  font-family: inherit;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--crm-text-muted, #475467);
  resize: none;             /* l'auto-resize JS gère la hauteur */
  min-height: 38px;
  max-height: 200px;
  overflow-y: auto;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, height 0.1s ease;
}
#tab-dvc-scope .wix-desc::placeholder {
  color: var(--crm-text-subtle, #94a3b8);
  font-style: italic;
  font-size: 12.5px;
}
#tab-dvc-scope .wix-desc:focus {
  border-color: var(--crm-bl, #1565c0);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.06);
}

/* ─── Prix HT — propre, droit, monospace ─── */
/* ─── Prix HT — typographie premium + accent orange CAMALARM ─── */
#tab-dvc-scope .wix-col-price {
  padding-top: 0;
}
#tab-dvc-scope .wix-price {
  width: 100%;
  height: 38px;
  padding: 0 11px 0 14px;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-left: 3px solid var(--crm-or, #E65100);   /* signature orange CAMALARM */
  border-radius: 0 8px 8px 0;
  background: var(--crm-surface, #FFFFFF);
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--crm-text, #101828);
  outline: none;
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.005em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}
#tab-dvc-scope .wix-price::-webkit-outer-spin-button,
#tab-dvc-scope .wix-price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#tab-dvc-scope .wix-price::placeholder {
  color: var(--crm-text-subtle, #94a3b8);
  font-weight: 400;
}
#tab-dvc-scope .wix-price:focus {
  border-color: var(--crm-bl, #1565c0);
  border-left-color: var(--crm-or, #E65100);  /* on garde l'accent orange */
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.08);
}

/* ─── Stepper Qté (grid stable) ─── */
#tab-dvc-scope .wix-col-qty {
  padding-top: 0;
}
#tab-dvc-scope .wix-stepper {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: stretch;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 8px;
  background: var(--crm-surface, #FFFFFF);
  overflow: hidden;
  height: 38px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#tab-dvc-scope .wix-stepper:focus-within {
  border-color: var(--crm-bl, #1565c0);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.08);
}
#tab-dvc-scope .wix-stepper-btn {
  border: 0;
  background: var(--crm-bg, #F5F7FA);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--crm-text-muted, #475467);
  transition: background 0.12s ease, color 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  user-select: none;
}
#tab-dvc-scope .wix-stepper-btn:hover {
  background: var(--crm-bl-lt, #E3F2FD);
  color: var(--crm-bl, #1565c0);
}
#tab-dvc-scope .wix-stepper-btn:active {
  background: rgba(21, 101, 192, 0.15);
}
#tab-dvc-scope .wix-stepper-val {
  border: 0;
  background: transparent;
  text-align: center;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--crm-text, #101828);
  outline: none;
  padding: 0;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.005em;
}
#tab-dvc-scope .wix-stepper-val::-webkit-outer-spin-button,
#tab-dvc-scope .wix-stepper-val::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ─── TVA select ─── */
#tab-dvc-scope .wix-col-tva {
  padding-top: 0;
}
#tab-dvc-scope .wix-tva-select {
  width: 100%;
  height: 38px;
  padding: 0 4px;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 8px;
  background: var(--crm-surface, #FFFFFF);
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--crm-text, #101828);
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  outline: none;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.005em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#tab-dvc-scope .wix-tva-select:focus {
  border-color: var(--crm-bl, #1565c0);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.08);
}

/* ─── Total HT (badge orange clair, typographie premium) ─── */
#tab-dvc-scope .wix-col-total {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 0;
}
#tab-dvc-scope .wix-total-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  background: var(--crm-or-lt, #FFF3E0);
  border: 1px solid rgba(230, 81, 0, 0.18);
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--crm-or, #E65100);
  width: 100%;
  height: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

/* ─── Bouton suppression ─── */
#tab-dvc-scope .wix-btn-delete {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--crm-text-subtle, #94a3b8);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
#tab-dvc-scope .wix-btn-delete:hover {
  color: var(--crm-rd, #ef4444);
  background: var(--crm-rd-lt, #fee2e2);
}
#tab-dvc-scope .wix-btn-delete svg {
  width: 14px;
  height: 14px;
}

/* ─── Footer (Ajouter ligne + hint) ─── */
#tab-dvc-scope .wix-lines-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--crm-border, #E6E9EF);
  background: var(--crm-bg, #F5F7FA);
  flex-wrap: wrap;
}
#tab-dvc-scope .wix-btn-add-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--crm-surface, #FFFFFF);
  border: 1px dashed var(--crm-border-hover, #D0D5DD);
  color: var(--crm-bl, #1565c0);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, border-style 0.15s ease;
}
#tab-dvc-scope .wix-btn-add-line:hover {
  background: var(--crm-bl-lt, #E3F2FD);
  border-color: var(--crm-bl, #1565c0);
  border-style: solid;
}
#tab-dvc-scope .wix-btn-add-plus {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
#tab-dvc-scope .wix-footer-hint {
  font-size: 11px;
  color: var(--crm-text-subtle, #94a3b8);
  font-style: italic;
  flex: 1;
  min-width: 0;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════
   DROPDOWN OVERLAY — propre, ancré, esprit CRM
   ═══════════════════════════════════════════════════════════════════════ */
.wix-dropdown-overlay {
  position: fixed;
  display: none;
  background: var(--crm-surface, #FFFFFF);
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  max-height: 340px;
  overflow-y: auto;
  z-index: 10000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.wix-dropdown-overlay.open {
  display: block;
  animation: wix-dd-fadein 0.12s ease-out;
}
@keyframes wix-dd-fadein {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wix-dropdown-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--crm-bg, #F5F7FA);
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
  z-index: 1;
}
.wix-dropdown-header > span {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--crm-text-muted, #475467);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wix-dropdown-add {
  background: transparent;
  border: 0;
  color: var(--crm-bl, #1565c0);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 5px;
  transition: background 0.12s ease;
  white-space: nowrap;
}
.wix-dropdown-add:hover {
  background: var(--crm-bl-lt, #E3F2FD);
}

.wix-dropdown-list {
  padding: 2px 0;
}
.wix-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid #F8FAFC;
}
.wix-dropdown-item:last-child { border-bottom: 0; }
.wix-dropdown-item:hover,
.wix-dropdown-item.active {
  background: var(--crm-bl-lt, #E3F2FD);
}
.wix-item-left {
  flex: 1;
  min-width: 0;
}
.wix-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--crm-text, #101828);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.wix-item-sub {
  font-size: 11px;
  color: var(--crm-text-subtle, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.wix-item-price {
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--crm-or, #E65100);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding-top: 1px;
}
.wix-dropdown-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--crm-text-subtle, #94a3b8);
  font-size: 12px;
  font-style: italic;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  #tab-dvc-scope .wix-lines-header {
    display: none;
  }
  #tab-dvc-scope .wix-line {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #tab-dvc-scope .wix-col-main {
    grid-column: 1 / -1;
  }
  #tab-dvc-scope .wix-col-action {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
  #tab-dvc-scope .wix-lines-footer {
    flex-direction: column;
    align-items: stretch;
  }
  #tab-dvc-scope .wix-footer-hint {
    text-align: left;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   CATALOG PICKER — modal "Ajouter depuis le catalogue"
   ═══════════════════════════════════════════════════════════════════════ */
.wix-cat-picker {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.wix-cat-picker.open {
  display: flex;
  animation: wix-picker-fadein 0.15s ease-out;
}
@keyframes wix-picker-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.wix-cat-picker-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  cursor: pointer;
}
.wix-cat-picker-modal {
  position: relative;
  width: min(560px, 92vw);
  max-height: 80vh;
  background: var(--crm-surface, #FFFFFF);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: wix-picker-slide 0.18s ease-out;
}
@keyframes wix-picker-slide {
  from { transform: translateY(8px); }
  to   { transform: translateY(0); }
}

/* Header */
.wix-cat-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
}
.wix-cat-picker-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--crm-text, #101828);
  letter-spacing: -0.01em;
}
.wix-cat-picker-title svg {
  width: 18px;
  height: 18px;
  color: var(--crm-bl, #1565c0);
}
.wix-cat-picker-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--crm-text-subtle, #94a3b8);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.wix-cat-picker-close:hover {
  background: var(--crm-bg, #F5F7FA);
  color: var(--crm-text, #101828);
}
.wix-cat-picker-close svg { width: 16px; height: 16px; }

/* Search */
.wix-cat-picker-search {
  position: relative;
  padding: 12px 20px;
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
}
.wix-cat-picker-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 8px;
  background: var(--crm-surface, #FFFFFF);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--crm-text, #101828);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wix-cat-picker-input::placeholder {
  color: var(--crm-text-subtle, #94a3b8);
  font-style: italic;
}
.wix-cat-picker-input:focus {
  border-color: var(--crm-bl, #1565c0);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.10);
}
.wix-cat-picker-search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--crm-text-subtle, #94a3b8);
  pointer-events: none;
}

/* Info bar */
.wix-cat-picker-info {
  padding: 8px 20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--crm-text-subtle, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--crm-bg, #F5F7FA);
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
}

/* List */
.wix-cat-picker-list {
  flex: 1;
  overflow-y: auto;
  background: var(--crm-surface, #FFFFFF);
  padding: 4px 0;
}
.wix-cat-picker-item {
  display: grid;
  grid-template-columns: 1fr auto 32px;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid #F8FAFC;
}
.wix-cat-picker-item:last-child { border-bottom: 0; }
.wix-cat-picker-item:hover {
  background: var(--crm-bl-lt, #E3F2FD);
}
.wix-cat-picker-item-added {
  background: var(--crm-gn-lt, #d1fae5) !important;
  transition: background 0.4s ease;
}
.wix-cat-picker-item-main {
  min-width: 0;
}
.wix-cat-picker-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--crm-text, #101828);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wix-cat-picker-item-sub {
  font-size: 11.5px;
  color: var(--crm-text-subtle, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wix-cat-picker-item-price {
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--crm-or, #E65100);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.wix-cat-picker-item-add {
  width: 28px;
  height: 28px;
  border: 0;
  background: var(--crm-bl, #1565c0);
  color: #FFFFFF;
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wix-cat-picker-item-add:hover {
  background: #0d4c9c;
}
.wix-cat-picker-item-add:active {
  transform: scale(0.95);
}

.wix-cat-picker-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--crm-text-subtle, #94a3b8);
  font-size: 13px;
  font-style: italic;
}

/* Lock body scroll quand picker ouvert */
body.wix-cat-picker-lock {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════
   POPOVER SAISIE LIBRE
   ═══════════════════════════════════════════════════════════════════════ */
.wix-libre-popover {
  position: fixed;
  display: none;
  background: var(--crm-surface, #FFFFFF);
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  z-index: 10001;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  animation: wix-libre-fadein 0.14s ease-out;
}
@keyframes wix-libre-fadein {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wix-libre-header {
  padding: 9px 14px;
  background: var(--crm-bg, #F5F7FA);
  border-bottom: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 10px 10px 0 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--crm-text-muted, #475467);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wix-libre-body {
  padding: 14px;
}
.wix-libre-query {
  font-size: 13px;
  font-weight: 600;
  color: var(--crm-text, #101828);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wix-libre-query em {
  font-style: italic;
  color: var(--crm-text-subtle, #94a3b8);
  font-weight: 400;
}
.wix-libre-help {
  font-size: 11.5px;
  color: var(--crm-text-muted, #475467);
  line-height: 1.45;
  margin-bottom: 12px;
}
.wix-libre-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wix-libre-btn {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--crm-border, #E6E9EF);
  border-radius: 7px;
  background: var(--crm-surface, #FFFFFF);
  color: var(--crm-text, #101828);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.wix-libre-btn:hover:not(:disabled) {
  background: var(--crm-bg, #F5F7FA);
  border-color: var(--crm-border-hover, #D0D5DD);
}
.wix-libre-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wix-libre-btn-primary {
  background: var(--crm-bl-lt, #E3F2FD);
  border-color: var(--crm-bl-lt, #E3F2FD);
  color: var(--crm-bl, #1565c0);
}
.wix-libre-btn-primary:hover:not(:disabled) {
  background: var(--crm-bl, #1565c0);
  border-color: var(--crm-bl, #1565c0);
  color: #FFFFFF;
}

/* Responsive picker */
@media (max-width: 600px) {
  .wix-cat-picker-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
