/**
    * FORM ELEMENTS - À intégrer en fine tuning
    * Date création : 28 octobre 2025
    * TODO : Intégrer dans theme.yml après Header/Footer/Home/Checkout terminés 
    * Estimation : 2-4h de debugging/intégration
    */
    
    
    /* ==========================================
   FORM ELEMENTS - Composants génériques
   ========================================== */
/* Reset focus natif */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none !important;
}

/* Notre propre focus visible (accessibilité) - uniquement sur devices avec hover (desktop) */
@media (hover: hover) {
  button:focus-visible,
  select:focus-visible {
    outline: 2px solid var(--mx-blue-500) !important;
  }

  /* Inputs texte : outline uniquement au Tab (pas au clic) */
  /* Ces inputs ont déjà un style :focus (border + shadow) */
  input[type="text"]:focus-visible,
  input[type="email"]:focus-visible,
  input[type="password"]:focus-visible,
  input[type="number"]:focus-visible,
  input[type="tel"]:focus-visible,
  input[type="url"]:focus-visible,
  input[type="search"]:focus-visible,
  textarea:focus-visible {
    outline: none !important;
  }

  /* Inputs sans style de focus natif : outline bleu au Tab */
  input[type="checkbox"]:focus-visible,
  input[type="radio"]:focus-visible {
    outline: 2px solid var(--mx-blue-500) !important;
    outline-offset: 2px !important;
  }
}
/* ------------------------------------------
   INPUTS TEXT, EMAIL, PASSWORD, NUMBER, TEL, URL
   ------------------------------------------ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  font-family: inherit;
  line-height: var(--lh-normal);
  color: var(--mx-gray-900);
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Focus */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--mx-primary);
  box-shadow: 0 0 0 3px rgba(70, 188, 235, 0.1);
}

/* Disabled */
input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled,
textarea:disabled,
.form-control:disabled {
  background-color: var(--mx-gray-100);
  color: var(--mx-gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Error state */
input[type="text"].is-invalid,
input[type="email"].is-invalid,
input[type="password"].is-invalid,
input[type="number"].is-invalid,
input[type="tel"].is-invalid,
input[type="url"].is-invalid,
textarea.is-invalid,
.form-control.is-invalid {
  border-color: #dc3545;
}

input[type="text"].is-invalid:focus,
input[type="email"].is-invalid:focus,
input[type="password"].is-invalid:focus,
input[type="number"].is-invalid:focus,
input[type="tel"].is-invalid:focus,
input[type="url"].is-invalid:focus,
textarea.is-invalid:focus,
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Textarea specific */
textarea,
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ------------------------------------------
   SELECT / DROPDOWN
   ------------------------------------------ */

select,
.form-control-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-right: calc(var(--space-4) * 2.5); /* Espace pour flèche */
  font-size: var(--fs-sm);
  font-family: inherit;
  line-height: var(--lh-normal);
  color: var(--mx-gray-900);
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Focus */
select:focus,
.form-control-select:focus {
  outline: none;
  border-color: var(--mx-primary);
  box-shadow: 0 0 0 3px rgba(70, 188, 235, 0.1);
}

/* Hover */
select:hover:not(:disabled),
.form-control-select:hover:not(:disabled) {
  border-color: var(--mx-gray-700);
}

/* Disabled */
select:disabled,
.form-control-select:disabled {
  background-color: var(--mx-gray-100);
  color: var(--mx-gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ------------------------------------------
   CHECKBOXES - Container + Input
   ------------------------------------------ */

/* Container checkbox (PrestaShop natif) */
/* Exclure les formulaires avec labels dans le checkbox (register, etc.) */
.custom-checkbox:not(:has(.mx-checkbox-text)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: var(--space-2);
}

/* Input checkbox natif + Bootstrap custom */
input[type="checkbox"],
.custom-control-input[type="checkbox"] {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 2px solid var(--mx-gray-700);
  border-radius: 4px;
  background: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}

/* Focus - supprimé au clic */
input[type="checkbox"]:focus,
.custom-control-input[type="checkbox"]:focus {
  outline: none;
}

/* Focus visible - uniquement au clavier (Tab) */
input[type="checkbox"]:focus-visible,
.custom-control-input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--mx-blue-500);
  outline-offset: 2px;
}

/* Checked (offset blanc) */
input[type="checkbox"]:checked,
.custom-control-input[type="checkbox"]:checked {
  background: #000;
  border-color: #000;
  box-shadow: inset 0 0 0 2px white;
}

/* Disabled */
input[type="checkbox"]:disabled,
.custom-control-input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Masquer les icônes Material Icons PrestaShop */
.custom-checkbox .ps-shown-by-js,
.custom-checkbox .material-icons {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
}

/* ------------------------------------------
   RADIOS - Container + Input
   ------------------------------------------ */

/* Container radio (PrestaShop natif) - border: none pour override theme.css */
.custom-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: var(--space-2);
  background: transparent !important;
  border: none !important;
}

/* Input radio natif + Bootstrap custom */
input[type="radio"],
.custom-control-input[type="radio"] {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 2px solid #000;
  border-radius: 50%;
  background: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}

/* Override theme.css - uniquement pour .custom-radio (comme facettes) */
.custom-radio input[type="radio"] {
  position: relative !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  border: 2px solid #000 !important;
  border-radius: 50% !important;
  background: white !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 1 !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* Focus - supprimé au clic */
input[type="radio"]:focus,
.custom-control-input[type="radio"]:focus {
  outline: none;
}

/* Focus visible - uniquement au clavier (Tab) */
input[type="radio"]:focus-visible,
.custom-control-input[type="radio"]:focus-visible {
  outline: 2px solid var(--mx-blue-500);
  outline-offset: 2px;
}

/* Checked (cercle noir centré) */
input[type="radio"]:checked,
.custom-control-input[type="radio"]:checked {
  border-color: #000;
}

input[type="radio"]:checked::after,
.custom-control-input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #000;
  border-radius: 50%;
}

/* Override theme.css - .custom-radio :checked */
.custom-radio input[type="radio"]:checked {
  border-color: #000 !important;
}

.custom-radio input[type="radio"]:checked::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 10px !important;
  height: 10px !important;
  background: #000 !important;
  border-radius: 50% !important;
}

/* Masquer le span indicateur PrestaShop (on utilise ::after sur l'input) */
.custom-radio input[type="radio"] + span {
  display: none !important;
}

/* Disabled */
input[type="radio"]:disabled,
.custom-control-input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Masquer le span indicateur et icônes Material Icons PrestaShop */
.custom-radio > span,
.custom-radio .material-icons {
  display: none !important;
}

/* ------------------------------------------
   RADIO INLINE (M. / Mme, etc.)
   ------------------------------------------ */

.radio-inline {
  display: inline-flex !important;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--mx-gray-700);
}

.radio-inline input[type="radio"] {
  flex-shrink: 0;
}

.radio-inline .radio-label-text {
  line-height: 1;
}

/* ------------------------------------------
   SLIDER RANGE (jQuery UI)
   ------------------------------------------ */

/* Barre principale */
.ui-slider {
  position: relative;
  height: 4px;
  background: var(--mx-gray-200);
  border-radius: var(--radius-full);
  border: none;
  margin: var(--space-4) 0;
  cursor: pointer;
}

/* Range actif (zone sélectionnée) */
.ui-slider-range {
  position: absolute;
  height: 100%;
  background: var(--mx-blue-500);
  border-radius: var(--radius-full);
  transition: background 0.2s ease;
}

.ui-slider:hover .ui-slider-range {
  background: var(--mx-blue-600);
}

/* Poignées (handles) */
.ui-slider-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  background: white;
  border: 2px solid var(--mx-blue-500);
  border-radius: 50%;
  cursor: grab;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ui-slider-handle:hover {
  border-width: 3px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.ui-slider-handle:active {
  cursor: grabbing;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ui-slider-handle:focus {
  outline: none;
}

.ui-slider-handle:focus-visible {
  outline: 2px solid var(--mx-blue-500);
  outline-offset: 2px;
}

/* ------------------------------------------
   LABELS
   ------------------------------------------ */

label,
.label,
.custom-control-label {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--mx-gray-900);
  cursor: pointer;
}

label.required::after,
.label.required::after {
  content: ' *';
  color: #dc3545;
}

/* ------------------------------------------
   FORM GROUPS
   ------------------------------------------ */

.form-group {
  margin-bottom: var(--space-6);
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Messages d'erreur */
.form-group .invalid-feedback,
.form-group .error-message {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: #dc3545;
}

/* Messages d'aide */
.form-group .form-text,
.form-group .help-block {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--mx-gray-600);
}

/* ------------------------------------------
   RESPONSIVE
   ------------------------------------------ */

@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select,
  .form-control,
  .form-control-select {
    padding: var(--space-2) var(--space-3);
    font-size: 16px; /* Évite le zoom iOS */
  }
  
  select,
  .form-control-select {
    padding-right: calc(var(--space-3) * 2.5);
  }
  
  textarea,
  textarea.form-control {
    min-height: 100px;
  }
}

/* Override spécifique Quick View */
.product-variants > .product-variants-item select,
select.form-control {
  height: auto !important;
  width: auto !important;
  padding: var(--space-2) var(--space-3) !important;
  padding-right: calc(var(--space-4) * 2.5) !important;
  line-height: var(--lh-normal) !important;
  background-color: white !important;
  font-size: var(--fs-sm) !important;
}

/* ==========================================
   CLASSES UTILITAIRES NOVA IP
   ========================================== */

/* Input générique Nova IP */
.mx-input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-base);
  font-family: inherit;
  line-height: var(--lh-normal);
  color: var(--mx-gray-900);
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.mx-input:hover {
  border-color: var(--mx-gray-400);
}

.mx-input:focus {
  outline: none;
  border-color: var(--mx-primary);
  box-shadow: 0 0 0 3px rgba(70, 188, 235, 0.1);
}

.mx-input::placeholder {
  color: var(--mx-gray-400);
}

.mx-input:disabled {
  background-color: var(--mx-gray-100);
  color: var(--mx-gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Select générique Nova IP */
.mx-select {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  padding-right: calc(var(--space-4) * 2.5);
  font-size: var(--fs-base);
  font-family: inherit;
  line-height: var(--lh-normal);
  color: var(--mx-gray-900);
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.mx-select:hover {
  border-color: var(--mx-gray-400);
}

.mx-select:focus {
  outline: none;
  border-color: var(--mx-primary);
  box-shadow: 0 0 0 3px rgba(70, 188, 235, 0.1);
}

.mx-select:disabled {
  background-color: var(--mx-gray-100);
  color: var(--mx-gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Checkbox générique Nova IP */
.mx-checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 2px solid var(--mx-gray-700);
  border-radius: 4px;
  background: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}

.mx-checkbox:focus {
  outline: none;
}

.mx-checkbox:focus-visible {
  outline: 2px solid var(--mx-blue-500);
  outline-offset: 2px;
}

.mx-checkbox:checked {
  background: #000;
  border-color: #000;
  box-shadow: inset 0 0 0 2px white;
}

.mx-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Radio générique Nova IP */
.mx-radio {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 2px solid var(--mx-gray-700);
  border-radius: 50%;
  background: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}

.mx-radio:focus {
  outline: none;
}

.mx-radio:focus-visible {
  outline: 2px solid var(--mx-blue-500);
  outline-offset: 2px;
}

.mx-radio:checked {
  border-color: #000;
}

.mx-radio:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #000;
  border-radius: 50%;
}

.mx-radio:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ------------------------------------------
   TAILLES VARIANTES
   ------------------------------------------ */

/* Small */
.mx-input-sm,
.mx-select-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-sm);
}

/* Large */
.mx-input-lg,
.mx-select-lg {
  padding: var(--space-3) var(--space-5);
  font-size: var(--fs-lg);
}

/* ------------------------------------------
   ÉTATS VISUELS
   ------------------------------------------ */

/* Success */
.mx-input-success,
.mx-select-success {
  border-color: var(--mx-success);
}

.mx-input-success:focus,
.mx-select-success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Error */
.mx-input-error,
.mx-select-error {
  border-color: var(--mx-error);
}

.mx-input-error:focus,
.mx-select-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ------------------------------------------
   FORM ROW (layout horizontal)
   ------------------------------------------ */

.mx-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.mx-form-row > * {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 767px) {
  .mx-form-row {
    flex-direction: column;
  }

  .mx-form-row > * {
    min-width: 100%;
  }
}

/* ------------------------------------------
   CHECKBOX/RADIO AVEC LABEL (inline)
   ------------------------------------------ */

.mx-checkbox-label,
.mx-radio-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--mx-gray-700);
}

.mx-checkbox-label:hover,
.mx-radio-label:hover {
  color: var(--mx-gray-900);
}

/* ------------------------------------------
   INPUT GROUP (input + bouton ou icône)
   ------------------------------------------ */

.mx-input-group {
  display: flex;
  align-items: stretch;
}

.mx-input-group .mx-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.mx-input-group .mx-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Icône à gauche */
.mx-input-icon {
  position: relative;
}

.mx-input-icon .mx-input {
  padding-left: calc(var(--space-4) + 24px);
}

.mx-input-icon svg,
.mx-input-icon i {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--mx-gray-400);
  pointer-events: none;
}

/* ==========================================
   PASSWORD STRENGTH INDICATOR
   ========================================== */

.password-strength-feedback {
  margin-top: var(--space-3);
}

/* Barre de progression */
.password-strength-feedback .progress {
  height: 6px;
  background: var(--mx-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.password-strength-feedback .progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Couleurs par niveau de force */
.password-strength-feedback .progress-bar[style*="width: 0"],
.password-strength-feedback .progress-bar[style*="width: 20%"] {
  background: var(--mx-red, #dc2626);
}

.password-strength-feedback .progress-bar[style*="width: 40%"] {
  background: var(--mx-orange);
}

.password-strength-feedback .progress-bar[style*="width: 60%"] {
  background: #eab308; /* Yellow */
}

.password-strength-feedback .progress-bar[style*="width: 80%"] {
  background: var(--mx-blue-500);
}

.password-strength-feedback .progress-bar[style*="width: 100%"] {
  background: #22c55e; /* Green */
}

/* Texte de force */
.password-strength-text {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-2);
}

/* Exigences du mot de passe */
.password-requirements {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--mx-blue-50);
  border-radius: var(--radius-md);
}

.password-requirements p {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-1) 0;
  font-size: var(--fs-xs);
  color: var(--mx-gray-600);
}

.password-requirements p:last-child {
  padding-bottom: 0;
}

/* Icônes Material Icons → remplacer visuellement */
.password-requirements .material-icons {
  font-size: 16px !important;
  width: 16px;
  height: 16px;
  color: var(--mx-gray-400);
}

/* État validé */
.password-requirements p.password-requirements--is-valid {
  color: #22c55e;
}

.password-requirements p.password-requirements--is-valid .material-icons {
  color: #22c55e;
}

/* État invalide */
.password-requirements p.password-requirements--is-invalid {
  color: var(--mx-red, #dc2626);
}

.password-requirements p.password-requirements--is-invalid .material-icons {
  color: var(--mx-red, #dc2626);
}

/* ==========================================
   QUANTITY INPUT (.mx-qty)
   Style pilule avec boutons +/-
   ========================================== */

/* Container principal */
.mx-qty .bootstrap-touchspin,
.mx-qty .input-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  background: white !important;
  border: 1px solid var(--border-color);
  border-radius: 50px !important;
  padding: 2px !important;
  width: auto !important;
  float: none !important;
}

/* Container des boutons - display:contents pour flex direct */
.mx-qty .input-group-btn-vertical {
  display: contents !important;
}

/* Ordre visuel : - input + */
.mx-qty .bootstrap-touchspin-down {
  order: 1 !important;
}

.mx-qty input[type="number"],
.mx-qty #quantity_wanted,
.mx-qty .js-cart-line-product-quantity {
  order: 2 !important;
}

.mx-qty .bootstrap-touchspin-up {
  order: 3 !important;
}

/* Input central */
.mx-qty input[type="number"],
.mx-qty #quantity_wanted,
.mx-qty .js-cart-line-product-quantity {
  width: 2.5rem !important;
  height: 2.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  text-align: center !important;
  font-weight: var(--fw-semibold) !important;
  font-size: var(--fs-base) !important;
  color: var(--mx-gray-900) !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* Masquer spinners natifs */
.mx-qty input[type="number"]::-webkit-outer-spin-button,
.mx-qty input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Boutons - et + */
.mx-qty .btn-touchspin {
  width: 2.5rem !important;
  height: 2.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background var(--transition-fast) !important;
  margin: 0 !important;
  float: none !important;
  color: var(--mx-gray-700) !important;
}

.mx-qty .btn-touchspin:hover {
  background: var(--mx-orange-50) !important;
  color: var(--mx-orange) !important;
}

.mx-qty .btn-touchspin:active {
  background: var(--mx-orange-100) !important;
}

/* Icônes SVG Lucide */
.mx-qty .btn-touchspin svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2 !important;
}

/* Masquer les icônes Material Icons si présentes */
.mx-qty .btn-touchspin i.material-icons {
  display: none !important;
}

/* Icônes SVG en fallback (évite le flash pendant chargement Lucide) */
.mx-qty .bootstrap-touchspin-down::before {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

.mx-qty .bootstrap-touchspin-up::before {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Masquer le fallback quand Lucide est chargé */
.mx-qty .btn-touchspin:has(svg)::before {
  display: none;
}

/* Masquer les addons Bootstrap inutiles */
.mx-qty .input-group-addon,
.mx-qty .bootstrap-touchspin-prefix,
.mx-qty .bootstrap-touchspin-postfix {
  display: none !important;
}

/* ------------------------------------------
   VARIANTE COMPACT (panier, quickview)
   ------------------------------------------ */

.mx-qty--sm .bootstrap-touchspin,
.mx-qty--sm .input-group {
  padding: 1px !important;
}

.mx-qty--sm input[type="number"],
.mx-qty--sm .js-cart-line-product-quantity {
  width: 2rem !important;
  height: 2rem !important;
  font-size: var(--fs-sm) !important;
}

.mx-qty--sm .btn-touchspin {
  width: 2rem !important;
  height: 2rem !important;
}

.mx-qty--sm .btn-touchspin svg {
  width: 14px !important;
  height: 14px !important;
}

/* Note: Section .mx-quantity-selector supprimée - on utilise .mx-qty partout (Touchspin natif) */

/* ------------------------------------------
   RESPONSIVE TABLETTE - Qty plus compact
   ------------------------------------------ */

@media (min-width: 768px) and (max-width: 1023px) {

  .mx-qty input[type="number"],
  .mx-qty #quantity_wanted,
  .mx-qty .js-cart-line-product-quantity {
    width: 2rem !important;
    height: 2rem !important;
  }

  .mx-qty .btn-touchspin {
    width: 2rem !important;
    height: 2rem !important;
  }

  .mx-qty .btn-touchspin svg {
    width: 14px !important;
    height: 14px !important;
  }

}

/* ------------------------------------------
   RESPONSIVE MOBILE - Qty compact
   ------------------------------------------ */

@media (max-width: 767px) {

  .mx-qty input[type="number"],
  .mx-qty #quantity_wanted,
  .mx-qty .js-cart-line-product-quantity {
    width: 2rem !important;
    height: 2rem !important;
    font-size: var(--fs-sm) !important;
  }

  .mx-qty .btn-touchspin {
    width: 2rem !important;
    height: 2rem !important;
  }

  .mx-qty .btn-touchspin svg {
    width: 14px !important;
    height: 14px !important;
  }

}