/* ==========================================================================
   SANSIL 3D — components.css
   Briques réutilisables par toutes les pages.
   ========================================================================== */

/* --- En-tête -------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--c-overlay);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.header.is-scrolled { border-bottom-color: var(--c-border); }

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  width: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--f-display);
  font-weight: var(--w-bold);
  font-size: 1.0625rem;
  letter-spacing: var(--ls-tight);
  color: var(--c-text);
  text-decoration: none;
  margin-right: auto;
}

.logo img { width: 32px; height: 32px; object-fit: contain; }

/* Pied de page : le verrouillage complet, marque et baseline comprises */
.logo--complet {
  display: block;
  max-width: 190px;
  margin-bottom: var(--s-2);
}

.logo--complet img { width: 100%; height: auto; }
.logo:hover { filter: var(--hover-lift); }

.nav { display: flex; align-items: center; gap: var(--s-2); }

.nav__link {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--c-muted);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  text-decoration: none;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link:focus-visible { color: var(--c-text); background: var(--c-cyan-08); }

.nav__link[aria-current="page"] { color: var(--c-text); }

.nav__link[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--grad-accent);
}

/* Bouton hamburger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--c-text);
  border-radius: var(--r-pill);
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Tiroir mobile */
.drawer {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: var(--z-drawer);
  display: grid;
  align-content: start;
  gap: var(--s-2);
  padding: var(--s-6) var(--gutter) var(--s-8);
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              visibility var(--dur);
}

.drawer.is-open { opacity: 1; transform: none; visibility: visible; }

.drawer a {
  padding: var(--s-4) var(--s-2);
  border-bottom: 1px solid var(--c-border);
  font-family: var(--f-display);
  font-size: var(--t-h4);
  color: var(--c-text);
  text-decoration: none;
}

/* --- Sélecteur de langue -------------------------------------------------- */
/* Quatre libellés alignés mangeaient ~230 px de barre : à l'étroit, la
   navigation compressait ses voisins et le numéro de téléphone se cassait en
   colonne. Un seul bouton déroulant rend cette largeur, et `nowrap` interdit
   désormais à un lien de se couper en plusieurs lignes. */

.nav > * { flex: 0 0 auto; }
.nav__link { white-space: nowrap; }

.langsw { position: relative; }

.langsw > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  color: var(--c-muted);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

/* Safari affiche encore son triangle sans cette règle */
.langsw > summary::-webkit-details-marker { display: none; }

.langsw > summary:hover,
.langsw > summary:focus-visible {
  color: var(--c-text);
  background: var(--c-cyan-08);
  border-color: var(--c-cyan-40);
}

.langsw__globe { width: 16px; height: 16px; flex: none; }
.langsw__code { font-family: var(--f-mono); letter-spacing: 0.04em; }

.langsw__caret {
  width: 10px;
  height: 10px;
  flex: none;
  transition: transform var(--dur-fast) var(--ease);
}

.langsw[open] > summary .langsw__caret { transform: rotate(180deg); }

.langsw__menu {
  position: absolute;
  top: calc(100% + var(--s-2));
  right: 0;
  z-index: var(--z-drawer);
  display: grid;
  gap: 2px;
  min-width: 200px;
  padding: var(--s-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--e-2);
}

.langsw__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--c-muted);
  font-size: var(--t-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.langsw__item:hover,
.langsw__item:focus-visible { color: var(--c-text); background: var(--c-surface-2); }
.langsw__item[aria-current="true"] { color: var(--c-text); }

.langsw__abbr {
  min-width: 2.2em;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-cyan);
}

/* Langues dans le tiroir mobile : pastilles, pas une pile de lignes pleines */
.drawer__langs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-2) 0;
}

.drawer__langs a {
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  font-family: var(--f-body);
  font-size: var(--t-sm);
  color: var(--c-muted);
}

.drawer__langs a[aria-current="true"] {
  color: var(--c-on-accent);
  background: var(--c-cyan);
  border-color: var(--c-cyan);
}

/* Le seuil est calé sur la largeur réellement occupée par la barre complète.
   En dessous, le menu déroulant prend le relais : mieux vaut un tiroir qu'une
   navigation qui déborde. */
@media (min-width: 78rem) {
  .nav-toggle, .drawer { display: none; }
}

@media (max-width: 77.99rem) {
  .nav { display: none; }
}

/* --- Boutons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  min-height: 44px; /* cible tactile */
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: filter var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.btn:hover { filter: var(--hover-lift); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; transform: none; filter: none;
}

.btn--primary {
  background: var(--c-cyan);
  color: var(--c-on-accent);
  box-shadow: 0 6px 22px rgba(0, 229, 255, 0.22);
}

.btn--accent {
  background: var(--grad-accent);
  color: var(--c-on-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border-strong);
}

.btn--ghost:hover { background: var(--c-cyan-08); border-color: var(--c-cyan-40); }

.btn--quiet { background: transparent; color: var(--c-muted); padding-inline: var(--s-3); }
.btn--lg { padding: var(--s-4) var(--s-6); font-size: var(--t-body); min-height: 52px; }
.btn--block { width: 100%; }

/* --- Badges & puces ------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-3);
  border-radius: var(--r-pill);
  background: var(--c-cyan-08);
  border: 1px solid var(--c-cyan-16);
  color: var(--c-cyan);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.02em;
}

.badge--success { background: var(--c-success-12); border-color: transparent; color: var(--c-success); }
.badge--danger { background: var(--c-danger-12); border-color: transparent; color: var(--c-danger); }
.badge--violet { background: var(--c-violet-08); border-color: var(--c-violet-16); color: var(--c-violet-clair); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- Cartes --------------------------------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.card--link:hover,
.card--link:focus-within {
  background: var(--c-surface-2);
  border-color: var(--c-cyan-40);
  transform: translateY(-3px);
  box-shadow: var(--e-2);
}

/* Le lien couvre toute la carte sans dupliquer le libellé pour les lecteurs d'écran */
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--c-cyan-08);
  color: var(--c-cyan);
}

.card__title { font-size: var(--t-h4); }
.card__text { color: var(--c-muted); font-size: var(--t-sm); }
.card__foot { margin-top: auto; padding-top: var(--s-3); }

/* Carte produit */
.product__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: var(--c-bg) var(--layer-lines);
  overflow: hidden;
}

.product__media img { width: 100%; height: 100%; object-fit: cover; }

.price {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: var(--w-bold);
}

.price small { font-family: var(--f-body); font-size: var(--t-xs); color: var(--c-muted); font-weight: var(--w-regular); }

/* --- Tableau de specs ----------------------------------------------------- */

.specs { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.specs th, .specs td { padding: var(--s-3) var(--s-2); text-align: left; border-bottom: 1px solid var(--c-border); }
.specs th { color: var(--c-muted); font-weight: var(--w-medium); }
.specs td { font-family: var(--f-mono); }

/* --- Formulaires ---------------------------------------------------------- */

.field { display: grid; gap: var(--s-2); }

.label { font-size: var(--t-sm); font-weight: var(--w-medium); }
.label span { color: var(--c-muted); font-weight: var(--w-regular); }

.input, .select, .textarea {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  min-height: 46px;
  background: var(--c-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  color: var(--c-text);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--c-placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-cyan-40); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-cyan);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-cyan-16);
}

.textarea { min-height: 130px; resize: vertical; }
.hint { font-size: var(--t-xs); color: var(--c-muted); }
.error { font-size: var(--t-xs); color: var(--c-danger); }
.input[aria-invalid="true"] { border-color: var(--c-danger); }

/* Zone de dépôt de fichier (devis / slicer) */
.dropzone {
  display: grid;
  place-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-5);
  text-align: center;
  background: var(--c-surface);
  border: 1.5px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--c-cyan);
  background: var(--c-cyan-08);
}

/* --- Chargement ----------------------------------------------------------- */

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--c-border-strong);
  border-top-color: var(--c-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.5s; }
}

/* --- Fil d'ariane --------------------------------------------------------- */

.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--t-xs); color: var(--c-muted); }
.crumbs a { color: var(--c-muted); text-decoration: none; }
.crumbs a:hover { color: var(--c-cyan); }

/* --- Pied de page --------------------------------------------------------- */

.footer {
  padding-block: var(--s-8) var(--s-6);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  font-size: var(--t-sm);
}

.footer__grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.footer__titre {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: var(--w-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--s-4);
}

.footer ul { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.footer a { color: var(--c-muted); text-decoration: none; }
.footer a:hover { color: var(--c-cyan); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: var(--t-xs);
}


/* --- CTA flottant (mobile) ------------------------------------------------ */

.cta-flottant {
  position: fixed;
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: var(--z-sticky);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: var(--s-3) var(--s-5);
  background: var(--grad-accent);
  color: var(--c-on-accent);
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  text-decoration: none;
  border-radius: var(--r-pill);
  box-shadow: var(--e-3);
  transform: translateY(120%);
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
}

.cta-flottant.is-visible { transform: translateY(0); }
.cta-flottant:hover { filter: var(--hover-lift); }

/* Ne s'affiche que sur petit écran : sur desktop, l'en-tête suffit */
@media (min-width: 48rem) {
  .cta-flottant { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cta-flottant { transition: none; }
}

/* ==========================================================================
   Figures illustratives
   Utilisées sur les pages éditoriales : accueil, atelier, matières, hubs.
   La légende porte la mention « vue d'illustration » : les visuels ne sont
   pas des photographies de commandes réelles, et le dire évite toute
   ambiguïté commerciale.
   ========================================================================== */

.figure {
  margin: 2.5rem 0;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
}

.figure figcaption {
  margin-top: .7rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--c-muted);
}

/* ==========================================================================
   Bandeau de consentement
   Ancré en bas, sans voile d'arrière-plan : la lecture n'est jamais bloquée,
   ce qui évite le schéma trompeur du mur de cookies. Les deux actions
   partagent la même rangée et la même taille — refuser doit coûter le même
   effort qu'accepter.
   ========================================================================== */

.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-modal);
  padding: var(--s-4);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.consent__boite {
  pointer-events: auto;
  width: min(46rem, 100%);
  padding: var(--s-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--e-3);
}

.consent__titre {
  margin: 0 0 .4rem;
  font-weight: var(--w-semibold);
}

.consent__texte {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--c-muted);
  line-height: 1.55;
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.consent__actions .btn {
  flex: 1 1 8rem;
  justify-content: center;
}




@media (max-width: 480px) {
  .consent { padding: var(--s-2); }
  .consent__actions .btn { flex-basis: 100%; }
}
