/* Norme de style Axelia — 3. boutons.
   .ax-bouton + une variante : --velours (action principale), --filet (action secondaire), --discret (action de
   troisième rang), --danger (suppression). Tailles : --petit, --large, --bloc, --icone.
   Sur <button> ou <a>. Jamais sur <input type=submit> : le passepoil est un pseudo-élément.
   Les classes .ax-est-survol / .ax-est-focus / .ax-est-appui forcent un état (catalogue, navigation au clavier pilotée
   par le JavaScript). */

.ax-bouton {
  --ax-r: var(--ax-rayon-2);
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: var(--ax-pas-2);
  min-height: var(--ax-cible); min-width: var(--ax-cible); width: auto; margin: 0; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--ax-r);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: filter var(--ax-vif), background-color var(--ax-vif), border-color var(--ax-vif), box-shadow var(--ax-vif), transform var(--ax-vif);
}
.ax-bouton[hidden] { display: none; }
.ax-bouton:focus-visible, .ax-bouton.ax-est-focus { outline: 2px solid var(--ax-focus); outline-offset: 2px; }
.ax-bouton:active, .ax-bouton.ax-est-appui { transform: translateY(1px); }

/* --- velours : l'action principale de l'écran, une seule par bloc --- */
.ax-bouton--velours {
  --ax-fil: var(--ax-passepoil);
  border-color: transparent;
  box-shadow: inset 0 1px 0 var(--ax-voile), 0 6px 10px -8px var(--ax-v1, var(--bouton-b));
}
.ax-bouton--velours:hover, .ax-bouton--velours.ax-est-survol { --ax-fil: var(--relief-clair); border-color: transparent; filter: brightness(1.1); }
.ax-bouton--velours:active, .ax-bouton--velours.ax-est-appui { filter: brightness(.94); box-shadow: inset 0 2px 5px var(--ax-creux); }

/* --- filet : l'action secondaire. Un cadre et son filet intérieur, comme une carte gravée. --- */
.ax-bouton--filet {
  --ax-fil: var(--trait);
  background: var(--carte); color: var(--ax-v1, var(--accent));
  border-color: color-mix(in srgb, var(--ax-v1, var(--accent)) 50%, var(--trait));
}
.ax-bouton--filet:hover, .ax-bouton--filet.ax-est-survol {
  --ax-fil: var(--relief); background: var(--accent-clair); border-color: var(--ax-v1, var(--accent));
}
.ax-bouton--filet:active, .ax-bouton--filet.ax-est-appui { background: var(--piste); }

/* --- discret : pas de cadre au repos --- */
.ax-bouton--discret { padding: 0 12px; background: transparent; color: var(--ax-v1, var(--accent)); border-color: transparent; }
.ax-bouton--discret:hover, .ax-bouton--discret.ax-est-survol { background: var(--accent-clair); border-color: transparent; }
.ax-bouton--discret:active, .ax-bouton--discret.ax-est-appui { background: var(--piste); }

/* --- danger : supprimer, retirer. Jamais en velours : on ne met pas en avant une action qui détruit. --- */
.ax-bouton--danger {
  --ax-fil: var(--trait);
  background: var(--carte); color: var(--alerte);
  border-color: color-mix(in srgb, var(--alerte) 50%, var(--trait));
}
.ax-bouton--danger:hover, .ax-bouton--danger.ax-est-survol {
  --ax-fil: color-mix(in srgb, var(--alerte) 50%, transparent);
  background: color-mix(in srgb, var(--alerte) 7%, var(--carte)); border-color: var(--alerte);
}
.ax-bouton--danger:active, .ax-bouton--danger.ax-est-appui { background: color-mix(in srgb, var(--alerte) 13%, var(--carte)); }

/* --- désactivé et occupé : la matière s'éteint, plus rien ne répond --- */
.ax-bouton:disabled, .ax-bouton[aria-disabled="true"] {
  --ax-fil: transparent;
  opacity: .5; filter: saturate(.35); box-shadow: none; transform: none; cursor: not-allowed; pointer-events: none;
}
.ax-bouton[aria-busy="true"] { opacity: .75; cursor: progress; pointer-events: none; }

/* --- tailles --- */
.ax-bouton--petit { --ax-r: var(--ax-rayon-1); min-height: 32px; min-width: 32px; padding: 0 12px; font-size: 12.5px; }
.ax-bouton--large { min-height: var(--ax-cible-large); padding: 0 24px; font-size: 15px; }
.ax-bouton--bloc  { display: flex; width: 100%; }
.ax-bouton--icone { width: var(--ax-cible); padding: 0; }
.ax-bouton--petit.ax-bouton--icone { width: 32px; }
@media (pointer: coarse), (max-width: 760px) {
  .ax-bouton--petit { min-height: var(--ax-cible); min-width: var(--ax-cible); }
  .ax-bouton--petit.ax-bouton--icone { width: var(--ax-cible); }
}

/* --- sur velours : le bouton principal s'inverse (pièce claire), le filet devient blanc --- */
.ax-sur-velours .ax-bouton--velours {
  --ax-fil: color-mix(in srgb, var(--ax-v1, var(--bouton-b)) 30%, transparent);
  background: var(--carte); color: var(--ax-v1, var(--bouton-b)); box-shadow: 0 6px 10px -8px rgba(0, 0, 0, .5);
}
.ax-sur-velours .ax-bouton--velours:hover, .ax-sur-velours .ax-bouton--velours.ax-est-survol {
  --ax-fil: var(--ax-v1, var(--bouton-b)); background: var(--fond-2); filter: none;
}
.ax-sur-velours .ax-bouton--velours:active, .ax-sur-velours .ax-bouton--velours.ax-est-appui { background: var(--piste); filter: none; box-shadow: none; }
.ax-sur-velours .ax-bouton--filet, .ax-sur-velours .ax-bouton--danger {
  --ax-fil: var(--ax-passepoil);
  background: transparent; color: var(--ax-encre); border-color: var(--ax-trait-velours);
}
.ax-sur-velours .ax-bouton--filet:hover, .ax-sur-velours .ax-bouton--filet.ax-est-survol,
.ax-sur-velours .ax-bouton--danger:hover, .ax-sur-velours .ax-bouton--danger.ax-est-survol {
  --ax-fil: var(--relief-clair); background: var(--ax-voile); border-color: var(--ax-encre);
}
.ax-sur-velours .ax-bouton--filet:active, .ax-sur-velours .ax-bouton--filet.ax-est-appui,
.ax-sur-velours .ax-bouton--danger:active, .ax-sur-velours .ax-bouton--danger.ax-est-appui { background: var(--ax-creux); }
.ax-sur-velours .ax-bouton--discret { color: var(--ax-encre); }
.ax-sur-velours .ax-bouton--discret:hover, .ax-sur-velours .ax-bouton--discret.ax-est-survol { background: var(--ax-voile); }
.ax-sur-velours .ax-bouton--discret:active, .ax-sur-velours .ax-bouton--discret.ax-est-appui { background: var(--ax-creux); }

/* --- segments : un choix parmi quelques vues (Liste / Tuiles / Carte). aria-pressed="true" marque le choix. --- */
.ax-segments {
  box-sizing: border-box; display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--trait); border-radius: var(--ax-rayon-2); background: var(--fond-2);
}
.ax-segments > button {
  box-sizing: border-box; min-height: 34px; margin: 0; padding: 0 14px; border: 0; border-radius: 7px; background: none;
  color: var(--texte); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color var(--ax-vif), filter var(--ax-vif);
}
.ax-segments > button:hover, .ax-segments > button.ax-est-survol { background-color: var(--piste); }
.ax-segments > [aria-pressed="true"] { box-shadow: inset 0 1px 0 var(--ax-voile); }
.ax-segments > [aria-pressed="true"]:hover, .ax-segments > [aria-pressed="true"].ax-est-survol { filter: brightness(1.1); }
.ax-segments > button:focus-visible, .ax-segments > button.ax-est-focus { outline: 2px solid var(--ax-focus); outline-offset: 2px; }
.ax-segments > button:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.ax-sur-velours .ax-segments { background: var(--ax-creux); border-color: var(--ax-trait-velours); }
.ax-sur-velours .ax-segments > button { color: var(--ax-encre); }
.ax-sur-velours .ax-segments > button:hover, .ax-sur-velours .ax-segments > button.ax-est-survol { background-color: var(--ax-voile); }
.ax-sur-velours .ax-segments > [aria-pressed="true"] { background: var(--carte); color: var(--ax-v1, var(--bouton-b)); box-shadow: none; }
.ax-sur-velours .ax-segments > [aria-pressed="true"]:hover { background: var(--fond-2); filter: none; }
@media (pointer: coarse), (max-width: 760px) { .ax-segments > button { min-height: var(--ax-cible); } }

@media (prefers-reduced-motion: reduce) {
  .ax-bouton, .ax-segments > button { transition: none; }
  .ax-bouton:active, .ax-bouton.ax-est-appui { transform: none; }
}
