:root {
  --ink: #111113;
  --ink-2: #4a4a50;
  --muted: #76767e;
  --line: #e2e1dd;
  --bg: #f4f3f0;
  --card: #ffffff;
  --accent: #d6101b;
  --accent-ink: #ffffff;
  --ok: #1a7f46;
  --warn: #b26a00;
  --radius: 10px;
  --maxw: 1180px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
h1 { font-size: clamp(1.5rem, 2.4vw + 1rem, 2.1rem); line-height: 1.15; margin: 0 0 .35rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0; }
.muted { color: var(--muted); }
.petit { font-size: .84rem; }
.ref { font-variant-numeric: tabular-nums; letter-spacing: .01em; font-size: .88rem; }

/* En-tête */
.haut { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.haut-in { max-width: var(--maxw); margin: 0 auto; padding: .65rem 16px; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.marque { text-decoration: none; display: flex; align-items: baseline; gap: .6rem; margin-right: auto; }
.logo { font-weight: 800; letter-spacing: .22em; font-size: 1.15rem; }
.sous { color: #b9b9c0; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.menu { display: flex; gap: .15rem; flex-wrap: wrap; }
.menu a { color: #d9d9de; text-decoration: none; padding: .4rem .7rem; border-radius: 6px; font-size: .94rem; }
.menu a:hover { background: #26262b; color: #fff; }
.menu a.actif { background: #fff; color: var(--ink); }
.pastille { display: inline-block; min-width: 1.35rem; margin-left: .35rem; padding: 0 .4rem; border-radius: 99px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; font-weight: 700; }
.menu a.actif .pastille { background: var(--accent); }
.deco { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: #b9b9c0; }
.qui { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien { background: none; border: 0; color: #fff; cursor: pointer; text-decoration: underline; font: inherit; padding: .2rem; }

/* Page */
.page { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 16px 3rem; flex: 1; }
.bas { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 16px 1.4rem; }
.entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1rem; margin-bottom: 1rem; }
.fil { font-size: .88rem; color: var(--muted); margin: 0 0 .8rem; }
.fil a { color: var(--ink-2); }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: #e8f5ee; border-color: #b7dec5; color: #104d2a; }
.flash.erreur { background: #fdecec; border-color: #f2b8b8; color: #7a1010; }
.info { background: #fff7e6; border: 1px solid #f0d9a4; border-radius: var(--radius); padding: .7rem 1rem; margin: 1rem 0; color: #6b4a00; }
.vide { text-align: center; color: var(--ink-2); padding: 3rem 1rem; }
.cadre { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; }

/* Boutons, champs */
.btn {
  display: inline-block; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  padding: .6rem 1.05rem; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  min-height: 44px;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn.plein { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.plein:hover { background: #b50d17; border-color: #b50d17; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1.5px solid #cfcdc7; border-radius: 8px; background: #fff; font: inherit; color: inherit;
  min-height: 44px;
}
textarea { resize: vertical; }
:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .85rem; }
label input, label select, label textarea { margin-top: .3rem; font-weight: 400; }
label.coche { display: flex; gap: .6rem; align-items: center; font-weight: 500; }
label.coche input { width: auto; min-height: 0; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1rem; padding: .8rem 1rem .4rem; background: var(--card); }
legend { font-weight: 700; padding: 0 .4rem; font-size: .92rem; }
.form { max-width: 440px; }
.form.large { max-width: 640px; }
.recherche { display: flex; gap: .5rem; }
.recherche input { min-width: 14rem; }

/* Connexion */
.connexion { max-width: 440px; margin: 3rem auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem; }

/* Puces de filtre */
.puces { display: flex; gap: .4rem; overflow-x: auto; padding: .1rem 0 .6rem; margin-bottom: .4rem; scrollbar-width: thin; }
.puces a { white-space: nowrap; text-decoration: none; border: 1.5px solid var(--line); background: var(--card); padding: .4rem .85rem; border-radius: 99px; font-size: .92rem; min-height: 40px; display: inline-flex; align-items: center; gap: .35rem; }
.puces a:hover { border-color: var(--ink); }
.puces a.actif { background: var(--ink); color: #fff; border-color: var(--ink); }
.puces small { opacity: .65; }

/* Catalogue */
.groupe { margin: 1.6rem 0; }
.groupe > h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); border-bottom: 2px solid var(--ink); padding-bottom: .4rem; margin-bottom: .9rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, transform .15s; }
.carte:hover { border-color: var(--ink); transform: translateY(-2px); }
.vignette { position: relative; background: #fff; aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 1px solid var(--line); }
/* Cadre carré identique pour TOUS les produits : la photo est posée en absolu, elle ne peut plus agrandir la carte. */
.vignette img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
.badge { background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 4px; vertical-align: middle; }
.vignette .badge { position: absolute; top: 8px; left: 8px; }
.corps { padding: .7rem .85rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.corps h3 { font-size: .96rem; line-height: 1.25; }
.prix { margin: .35rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; }
.prix strong { font-size: 1.1rem; }
.prix.grand strong { font-size: 1.6rem; }
.ppc { color: var(--muted); font-size: .8rem; }

/* Fiche produit */
.fiche { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem; align-items: start; }
.fiche-img { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1 / 1; width: 100%; max-width: 560px; overflow: hidden; }
.fiche-img img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.specs { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .92rem; }
.specs th, .specs td { text-align: left; padding: .4rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { color: var(--muted); font-weight: 500; width: 40%; }
.commande { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 1rem; }
.choix { display: flex; gap: .7rem; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .5rem; font-weight: 500; cursor: pointer; }
.choix:has(input:checked) { border-color: var(--ink); background: #faf9f6; }
.choix input { width: auto; min-height: 0; margin: 0; }
.choix span { flex: 1; }
.tailles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; padding-bottom: .6rem; }
.taille { margin: 0; text-align: center; font-size: .85rem; }
.taille span { display: block; font-weight: 700; }
.taille input { text-align: center; padding-inline: .2rem; margin-top: .15rem; }
.qte input { max-width: 8rem; }

/* Tableaux */
.tableau-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tableau { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tableau th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .65rem .8rem; border-bottom: 1px solid var(--line); background: #faf9f6; white-space: nowrap; }
.tableau td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tfoot td { background: #faf9f6; font-size: 1rem; }
.tableau tr.inactif td { opacity: .55; }
.num { text-align: right; white-space: nowrap; }
.case { width: 2.4rem; }
.case input { width: 20px; height: 20px; min-height: 0; }
.qte-ligne { width: 5rem; text-align: right; }
.statut { font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; background: #eee; white-space: nowrap; }
.statut.nouvelle { background: #fff1cc; color: #7a5200; }
.statut.transmise { background: #dff3e6; color: #12522e; }
.statut.annulee { background: #eee; color: #666; }
.ligne-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.ligne-form label { margin: 0; }
.ligne-form h2 { width: 100%; margin: 0; }
.barre-action { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--bg); padding: .8rem 0; border-top: 1px solid var(--line); margin-top: .8rem; }

@media (max-width: 760px) {
  .fiche { grid-template-columns: 1fr; gap: 1rem; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .recherche { width: 100%; }
  .recherche input { min-width: 0; flex: 1; }
  .deco { width: 100%; justify-content: space-between; }
  .tableau th, .tableau td { padding: .55rem .5rem; }
}
@media (prefers-reduced-motion: reduce) { .carte { transition: none; } .carte:hover { transform: none; } }

/* Photos du catalogue à fond noir : le cadre prend la couleur de la photo */
.fond-noir { background: #000 !important; }
.vignette img, .fiche-img img { mix-blend-mode: normal; }

/* Vitrine : bascule de catalogue, compte, statuts */
.bascule a { font-weight: 600; }
.connexion.large { max-width: 560px; }
.form label.coche span { font-weight: 400; font-size: .88rem; line-height: 1.4; }
.statut.modifiee { background: #e3edff; color: #17418f; }
.annul { margin-top: .8rem; }

/* Description produit */
.descr { margin: 1rem 0 .4rem; color: var(--ink-2); }
.descr p { margin: 0 0 .7rem; line-height: 1.55; }
.points { margin: 0 0 .8rem; padding: 0; list-style: none; display: grid; gap: .3rem; }
.points li { padding-left: 1.2rem; position: relative; font-size: .95rem; }
.points li::before { content: ""; position: absolute; left: .1rem; top: .55em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }
.usage { font-size: .93rem; background: #f4f3f0; border-radius: 8px; padding: .55rem .75rem; }

/* Guide des pointures : colonnes de largeur égale, titres et valeurs centrés sur le même axe */
.groupe .tableau-wrap:has(.tableau-pointures) { max-width: 720px; }
.tableau-pointures { table-layout: fixed; width: 100%; }
.tableau-pointures th, .tableau-pointures td { text-align: center; padding: .55rem .35rem; font-variant-numeric: tabular-nums; }
.tableau-pointures th { white-space: normal; line-height: 1.25; vertical-align: bottom; font-size: .72rem; }
.tableau-pointures tbody tr:nth-child(even) td { background: #faf9f6; }
.tableau-pointures td:first-child { font-weight: 700; }
.tableau-pointures td:nth-last-child(-n+2) { color: var(--accent); font-weight: 600; }

.tag { margin: 0 0 .15rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Aperçu agrandi au survol d'une photo (liste) et zoom sur place (fiche) */
.zoom { position: fixed; z-index: 60; width: clamp(400px, min(58vw, 80vh), 640px); aspect-ratio: 1 / 1; background: #fff;
        border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); pointer-events: none; }
.zoom[hidden] { display: none; }
.zoom img { width: 100%; height: 100%; object-fit: contain; padding: 14px; box-sizing: border-box; }
.vignette img { cursor: zoom-in; }
@media (hover: hover) and (pointer: fine) {
  .fiche-img { cursor: zoom-in; }
  .fiche-img img { transition: transform .18s ease; }
  .fiche-img:hover img { transform: scale(1.9); }
}
@media (prefers-reduced-motion: reduce) { .fiche-img img { transition: none; } }

/* Logo officiel dans l'en-tête */
.logo-img { display: block; height: 18px; width: auto; }
.marque { align-items: center; }

/* Liens ski <-> fixation */
.liens { margin: 1.2rem 0; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.liens h2 { font-size: 1rem; margin: 0 0 .5rem; }
.liens-liste { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.liens-liste a { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; border: 1.5px solid var(--line); border-radius: 8px; padding: .5rem; height: 100%; }
.liens-liste a:hover { border-color: var(--ink); }
.liens-liste img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.lien-nom { font-weight: 600; font-size: .9rem; line-height: 1.25; }

/* Vignette produit dans le panier et les commandes */
.cellule-produit { display: flex; gap: .75rem; align-items: center; min-width: 14rem; }
.mini { flex: 0 0 64px; width: 64px; height: 64px; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: block; overflow: hidden; position: relative; }
.mini img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.mini-texte { min-width: 0; }
@media (max-width: 760px) { .mini { flex-basis: 52px; width: 52px; height: 52px; } .cellule-produit { min-width: 11rem; } }

/* Commande sans compte */
.commander { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.commander .form.large { max-width: none; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.erreurs { margin: .4rem 0 0; padding-left: 1.2rem; }
.choix-livraison { background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: .8rem 1rem; cursor: pointer; }
.choix-livraison:has(input:checked) { border-color: var(--ink); }
.livraison { display: none; }
.choix-livraison:has(input:checked) + .livraison { display: block; }
.recap { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.recap h2 { margin: 0 0 .6rem; }
.recap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.recap li { display: flex; gap: .6rem; align-items: center; }
.recap .mini { flex-basis: 48px; width: 48px; height: 48px; }
.recap-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font-size: .9rem; }
.recap-prix { font-size: .85rem; white-space: nowrap; color: var(--ink-2); }
.recap-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin: .8rem 0 .4rem; padding-top: .7rem; }
.lien-prive { display: block; width: 100%; font: inherit; font-size: .9rem; background: #fff; border: 1.5px dashed var(--ink-2); border-radius: 8px; padding: .6rem .7rem; word-break: break-all; }
.bloc-adresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.bloc-adresses .cadre { margin: 0; }
@media (max-width: 860px) { .commander { grid-template-columns: 1fr; } .recap { position: static; order: -1; } .deux { grid-template-columns: 1fr; } }
/* Sans JavaScript, la mise à jour du panier reste manuelle ; avec, elle est automatique. */
.js .maj-manuelle { display: none; }

#form-panier.maj-en-cours { opacity: .65; transition: opacity .15s; }

.contact-modif { background: #fff7e6; border: 1.5px solid #f0d9a4; border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; color: #5b3d00; }
.contact-modif a { color: inherit; font-size: 1.15rem; white-space: nowrap; }
.chaussure input[type=number] { max-width: 12rem; }

.public { margin: .15rem 0 .25rem; color: var(--ink-2); font-size: .95rem; }
.chaussure input[type=number] { display: block; }

/* Choix de la fixation sur la fiche d'un ski */
.carte-fix { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: .15rem; width: 100%; height: 100%; cursor: pointer;
             border: 2px solid var(--line); border-radius: 8px; padding: .5rem; position: relative; background: var(--card); }
.carte-fix:hover { border-color: var(--ink); }
.carte-fix:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.carte-fix img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.carte-fix.actif { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #fff6f6; }
.coche-fix { display: none; font-size: .78rem; font-weight: 700; color: var(--accent); }
.carte-fix.actif .coche-fix { display: block; }
.sans-fix { display: grid; place-items: center; aspect-ratio: 1 / 1; background: #f4f3f0; color: var(--muted); border-radius: 6px; font-weight: 600; }
.choix-fixations .liens-liste li { display: flex; flex-direction: column; gap: .3rem; }
.voir-fix { font-size: .8rem; text-align: center; color: var(--ink-2); }

/* Version : masquée (avec JavaScript) quand les cartes de fixation la remplacent */
.js .version-remplacee { display: none; }

/* Aperçu d'une fixation dans une fenêtre */
dialog.apercu { border: 0; border-radius: 14px; padding: 0; width: min(640px, 94vw); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
dialog.apercu::backdrop { background: rgba(17, 17, 19, .55); }
.apercu-corps { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.2rem; padding: 1.4rem; }
.apercu-photo { background: #fff; border: 1px solid var(--line); border-radius: 10px; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: .6rem; }
.apercu-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.apercu-texte h2 { margin: 0 0 .2rem; font-size: 1.35rem; }
.apercu-fermer { position: absolute; top: .4rem; right: .6rem; width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink-2); }
.apercu-fermer:hover { color: var(--ink); }
@media (max-width: 560px) { .apercu-corps { grid-template-columns: 1fr; padding-top: 2.6rem; } }

/* Taille de chaussure par paire (fiche d'un ski) */
.chaussures[hidden] { display: none; }
.chaussures-liste { display: grid; gap: .5rem; margin: .6rem 0; }
.rang-paire { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: 0; padding: .35rem .6rem; background: #faf9f6; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.rang-paire input { width: 7.5rem; margin: 0; text-align: center; }
.chaussure-commune[hidden], .chaussures-vide[hidden] { display: none; }
