/* ==========================================================================
   CartoContour : feuille de style unique
   Palette reprise des cartes elles-memes : papier (#f2ead9 des presets),
   encre brune, eau sarcelle (#1f6f78) et rouge de trace.
   ========================================================================== */

:root {
  --paper: #f3ede1;
  --paper-2: #ebe3d4;
  --paper-3: #e1d7c5;
  --card: #fbf8f2;
  --ink: #27221d;
  --ink-2: #4b433a;
  --muted: #776c5f;
  --line: #ddd3c2;
  --line-2: #cabea9;
  --rust: #b4482d;
  --rust-ink: #913a24;
  --teal: #1f6f78;
  --trace: #f0c033;
  --frame: #2b2622;
  --oak: #c4a37a;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 6px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow-print: 0 1px 2px rgba(39, 34, 29, .16), 0 16px 30px -14px rgba(39, 34, 29, .38);
  --shadow-frame: 0 2px 3px rgba(20, 15, 10, .25), 0 26px 40px -16px rgba(50, 38, 25, .55);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, .h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; font-optical-sizing: auto; }
h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3, .h3 { font-size: 1.25rem; }
em { font-style: italic; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font: 600 .75rem/1.4 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .9em; }
.lead { font-size: 1.125rem; color: var(--ink-2); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; left: -9999px; top: 12px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--rust); color: #fff; border: 1px solid var(--rust);
  padding: .8em 1.35em; border-radius: 3px;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--rust-ink); border-color: var(--rust-ink); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-small { padding: .5em 1em; font-size: .875rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; cursor: pointer; font-size: .875rem; }

/* ---------- En-tete ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 237, 225, .9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.3rem; font-weight: 500; }
.logo img { width: auto; height: 36px; flex: none; }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: .925rem; }
.nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.nav a { white-space: nowrap; }
/* Ecran moyen : Collection et Styles (ancres de l'accueil) s'effacent pour
   laisser « Vous organisez une course ? » sur une ligne. */
@media (max-width: 900px) { .nav .nav-second { display: none; } }
.nav a:not(.btn):hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Cadres (mur de l'accueil) ---------- */
.frame { margin: 0; background: #fbfaf6; padding: 8%; border: 6px solid var(--frame); box-shadow: var(--shadow-frame); }
.frame img { display: block; width: 100%; height: auto; outline: 1px solid rgba(0, 0, 0, .08); }

/* ---------- Accueil : hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 7vw, 104px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 em { color: var(--rust); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0; font-size: .875rem; color: var(--muted); }
.hero-facts li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); margin-right: 8px; vertical-align: middle; }
.hero-wall {
  display: grid; grid-template-columns: 1fr 1.15fr; grid-template-rows: auto auto;
  gap: 7% 7%; align-items: center; padding: 8% 7%;
  background: radial-gradient(120% 90% at 30% 0%, #f2ede4 0%, #e4dccd 62%, #dad0bf 100%);
  border-radius: var(--r);
}
.wall-1 { grid-row: 1 / span 2; }
.wall-2 .frame { border-color: var(--oak); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-alt { background: var(--paper-2); }
.section-tight { padding: 40px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: 40px; }
.section-lead { color: var(--ink-2); max-width: 40em; margin: 0; }

/* ---------- Collection ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: .875rem; cursor: pointer; transition: background .15s, color .15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 44px 28px; }
.grid-cards-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-link { display: block; text-decoration: none; }
.card-wall {
  position: relative; aspect-ratio: 4 / 5; display: grid; place-items: center;
  background: var(--paper-2); border-radius: var(--r); overflow: hidden;
  transition: background .2s;
}
.section-alt .card-wall { background: var(--paper-3); }
.poster-img {
  grid-area: 1 / 1; display: block; width: 62%; height: auto;
  box-shadow: var(--shadow-print);
  transition: opacity .35s ease, transform .35s ease;
}
.poster-img.is-landscape { width: 84%; }
.poster-img.is-alt { opacity: 0; }
.card-link:hover .card-wall { background: var(--paper-3); }
.card-link:hover .poster-img { transform: translateY(-4px); }
.card-link:hover .poster-img.is-alt { opacity: 1; }
.card-body { padding-top: 16px; }
.card-body .eyebrow { margin-bottom: .4em; }
.card-body h3 { font-size: 1.35rem; margin-bottom: .1em; }
.card-sub { color: var(--ink-2); margin-bottom: 10px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .85rem; }
.swatches { display: inline-flex; align-items: center; gap: 4px; }
.swatch-label { color: var(--muted); margin-left: 4px; }
.price { font-weight: 600; white-space: nowrap; }
.card-link:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
/* Sous la collection : demander un lieu absent, ou envoyer une trace */
.collection-plus {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  margin-top: 56px; padding: 24px 28px; border: 1px dashed var(--line-2); border-radius: 10px;
}
.collection-plus > div:first-child { flex: 1 1 380px; }
.collection-plus h3 { margin-bottom: .3em; }
.collection-plus p { margin: 0; color: var(--ink-2); max-width: 44em; }
.collection-plus-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.collection-plus-actions.is-trace { flex-direction: row-reverse; }

.swatch { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.swatch-alpage { background: linear-gradient(135deg, #7c9856 0 50%, #c9ab6f 50% 100%); }
.swatch-givre { background: linear-gradient(135deg, #e9edec 0 50%, #2a7c73 50% 100%); }
.swatch-carnet { background: linear-gradient(135deg, #f0e5cf 0 50%, #b48c62 50% 100%); }
.swatch-carnet-profil { background: linear-gradient(135deg, #f0e5cf 0 50%, #a6d6e8 50% 72%, #50211f 72% 100%); }
.swatch-relief3d { background: linear-gradient(135deg, #efe6cf 0 50%, #9fcabd 50% 100%); }
.swatch-aplats { background: linear-gradient(135deg, #5f8a5e 0 34%, #e8b47e 34% 67%, #1f3f66 67% 100%); }
.swatch-platre { background: linear-gradient(135deg, #ece5d8 0 60%, #1b2b45 60% 100%); }
.swatch-minuit { background: linear-gradient(135deg, #1d3352 0 60%, #d9b45a 60% 100%); }
.swatch-chlorophylle { background: linear-gradient(135deg, #7d9c55 0 50%, #6d9cab 50% 100%); }
.swatch-forestier { background: linear-gradient(135deg, #3d5a20 0 50%, #a5b06d 50% 100%); }
.swatch-terroir { background: linear-gradient(135deg, #f6f0e4 0 50%, #8e3b52 50% 100%); }
.swatch-hiver { background: linear-gradient(135deg, #ffffff 0 50%, #6f90bd 50% 100%); }
.swatch-ete { background: linear-gradient(135deg, #aabf7e 0 50%, #968e82 50% 100%); }
.swatch-hiver-perspective { background: linear-gradient(135deg, #ffffff 0 34%, #6f90bd 34% 67%, #336660 67% 100%); }
.swatch-ete-perspective { background: linear-gradient(135deg, #aabf7e 0 34%, #968e82 34% 67%, #2f4d24 67% 100%); }

/* ---------- Styles ---------- */
.grid-styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 32px 24px; }
.style-swatch { aspect-ratio: 1; overflow: hidden; border-radius: var(--r); margin-bottom: 16px; box-shadow: var(--shadow-print); }
.style-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.style-card:hover .style-swatch img { transform: scale(1.05); }
.style-card p { font-size: .925rem; color: var(--ink-2); margin-bottom: .6em; }
.style-card .style-seen { font-size: .825rem; color: var(--muted); }
.style-seen a { color: var(--teal); }

/* ---------- Sur mesure (bandeau sombre) ---------- */
.section-dark { background: #24201c; color: var(--paper); }
.section-dark .eyebrow { color: #c4b59c; }
.section-dark .section-lead { color: #d9cfbe; }
.custom-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.steps { list-style: none; padding: 0; margin: 32px 0 36px; display: grid; gap: 22px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(243, 237, 225, .35); font-family: var(--display); font-size: 1.2rem; }
.steps h3 { font-size: 1.15rem; margin-bottom: .25em; }
.steps p { color: #cfc4b2; margin: 0; font-size: .95rem; }
.custom-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.section-dark .btn-ghost { color: var(--paper); border-color: rgba(243, 237, 225, .55); }
.section-dark .btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.custom-alt { margin: 18px 0 0; max-width: 34em; font-size: .925rem; color: #cfc4b2; }
.custom-visual { position: relative; color: #d8ccb6; max-width: 460px; justify-self: center; width: 100%; }
.trace-illus { width: 100%; height: auto; display: block; }
.trace-line { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.6s ease-out .3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .trace-line { animation: none; stroke-dashoffset: 0; } }
.gpx-chip { position: absolute; left: 0; bottom: 6%; display: grid; gap: 2px; background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: var(--r); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); font-size: .85rem; }
.gpx-chip span { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted); font-size: .78rem; }

/* ---------- Fabrication & FAQ ---------- */
.grid-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px 32px; }
.fact svg { width: 32px; height: 32px; color: var(--rust); margin-bottom: 12px; }
.fact h3 { font-size: 1.15rem; }
.fact p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.faq-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 32px 64px; }
.faq details { border-top: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 1px solid var(--line-2); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 1.5rem/1 var(--display); color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); padding-right: 36px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 48px 0 56px; font-size: .875rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 2fr; gap: 32px 48px; }
.footer-brand { font: 500 1.25rem/1.2 var(--display); color: var(--ink); }
.footer-title { font-weight: 600; color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink-2); }
.footer-sources p:last-child { font-size: .8rem; color: var(--muted); }

/* ---------- Page produit ---------- */
.crumbs { display: flex; gap: 8px; padding: 22px 0 14px; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.product-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; padding-bottom: 56px; }
.viewer { position: sticky; top: 84px; }
.viewer-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--paper-2); border-radius: 999px; }
.viewer-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.viewer-tabs button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 500; }
.stage {
  position: relative; container-type: size; margin-top: 12px;
  width: 100%; aspect-ratio: 6 / 5; max-height: calc(100vh - 180px); min-height: 320px;
  background: var(--paper-2); border-radius: var(--r); overflow: hidden;
  transition: background .3s;
}
.poster {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  aspect-ratio: 5 / 7; height: min(88cqh, 88cqw * 1.4); width: auto;
  box-shadow: var(--shadow-print);
  transition: height .3s, width .3s, padding .3s, border-width .3s;
}
.poster.is-landscape { aspect-ratio: 7 / 5; height: auto; width: min(88cqw, 88cqh * 1.4); }
.poster img { display: block; width: 100%; height: 100%; object-fit: contain; }
.viewer[data-view="mur"] .stage { background: radial-gradient(130% 100% at 50% 0%, #f3eee6 0%, #e2d9ca 70%, #d6cbb8 100%); }
.viewer[data-view="mur"] .poster {
  height: min(72cqh, 72cqw * 1.4);
  background: #fbfaf6; border: max(5px, 1.3cqw) solid var(--frame); padding: 4.5cqh;
  box-shadow: var(--shadow-frame);
}
.viewer[data-view="mur"] .poster.is-landscape { height: auto; width: min(76cqw, 72cqh * 1.4); }
.viewer[data-view="mur"] .poster img { outline: 1px solid rgba(0, 0, 0, .08); }
.detail { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewer[data-view="detail"] .poster { display: none; }
.viewer[data-view="detail"] .detail { display: block; }
.viewer-caption { font-size: .85rem; color: var(--muted); margin-top: 10px; }

.buybox h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); margin-bottom: .15em; }
.product-sub { font: italic 400 1.3rem/1.3 var(--display); color: var(--ink-2); margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 20px; margin: 0 0 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-weight: 600; }
.product-desc { color: var(--ink-2); }
.opt-group { border: 0; padding: 0; margin: 26px 0 0; min-width: 0; }
.opt-group legend { font: 600 .75rem/1.4 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 10px; }
.opt-value { margin-left: .6em; font-size: .9rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); }

/* entrees radio/checkbox masquees mais focalisables */
.style-tile input, .format-opt input, .style-card-opt input, .segmented input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
/* Vignettes compactes : le nom du style choisi est dans la legende. */
.style-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px; }
.style-tile { position: relative; cursor: pointer; display: grid; }
.style-tile-img { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r); background: var(--paper-2); box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .15s; }
.style-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.style-tile-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.style-tile:hover .style-tile-img { box-shadow: 0 0 0 1px var(--ink); }
.style-tile input:checked + .style-tile-img { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.style-tile input:focus-visible + .style-tile-img { outline: 2px solid var(--teal); outline-offset: 5px; }

.format-list { display: grid; gap: 8px; }
.format-opt { position: relative; display: grid; grid-template-columns: 5.5em 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; background: transparent; transition: border-color .15s, background .15s; }
.format-opt:hover { border-color: var(--ink); }
.format-opt:has(input:checked) { border-color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--ink); }
.format-opt:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.format-name { font-weight: 600; }
.format-dim { font-size: .85rem; color: var(--muted); }
.format-price { font-weight: 600; }
/* Fiche produit : les formats sur une ligne */
.format-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.format-row .format-opt { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; padding: 9px 6px; text-align: center; }
.format-row .format-price { font-weight: 400; color: var(--ink-2); }

.check-opt { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; cursor: pointer; }
.check-opt input { accent-color: var(--rust); width: 18px; height: 18px; margin: 3px 0 0; flex: none; }
.buy-row { margin-top: 22px; display: flex; align-items: center; gap: 20px; }
.buy-row .total { flex-direction: column; align-items: flex-start; gap: 4px; }
.buy-row .btn { flex: 1; padding-block: .95em; font-size: 1rem; }
.buy-note { margin: 10px 0 0; }
.buybox .product-desc { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
.total-label { color: var(--muted); font-size: .9rem; }
.total span:last-child { font: 500 2rem/1 var(--display); }
.custom-link { margin-top: 18px; font-size: .925rem; }

/* Barre d'achat : choix courant et bouton, quand celui de la fiche est
   hors de l'ecran (produit.js) */
.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(251, 248, 242, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px -16px rgba(39, 34, 29, .45);
  transform: translateY(110%); transition: transform .25s ease;
}
.buy-bar.is-visible { transform: none; }
.buy-bar-inner { display: flex; align-items: center; gap: 14px; height: 68px; }
.buy-bar-thumb { flex: none; height: 46px; width: auto; max-width: 64px; object-fit: contain; box-shadow: var(--shadow-print); }
.buy-bar-info { flex: 1; min-width: 0; margin: 0; font-size: .9rem; line-height: 1.35; }
.buy-bar-info b, .buy-bar-info span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.buy-bar-info b { font: 500 1.05rem/1.3 var(--display); }
.buy-bar-info span { color: var(--muted); font-size: .825rem; }
.buy-bar-total { font: 500 1.4rem/1 var(--display); white-space: nowrap; }
.page-produit .site-footer { padding-bottom: 124px; }
@media (max-width: 960px) { .page-commande .site-footer { padding-bottom: 124px; } }
@media (prefers-reduced-motion: reduce) { .buy-bar { transition: none; } }
.custom-link a { color: var(--teal); }
.places { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 32px; }
.places li { padding: 8px 0; border-bottom: 1px dotted var(--line-2); font-size: .925rem; }
.places li::before { content: "▲"; font-size: .55em; color: var(--muted); margin-right: 10px; vertical-align: 2px; }

/* ---------- Commande ---------- */
.page-head { padding: 36px 0 28px; }
.page-head .lead { margin: 0; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(28px, 4vw, 56px); align-items: start; padding-bottom: 88px; }
.order-main { counter-reset: step; min-width: 0; }
.page-commande .page-head { padding: 28px 0 4px; }
.page-commande .page-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.page-commande .page-head .lead { font-size: 1rem; max-width: 40em; }
.mode-link { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.mode-link a { color: var(--teal); }

.block { border: 0; border-top: 1px solid var(--line); margin: 28px 0 0; padding: 26px 0 4px; min-width: 0; counter-increment: step; }
.block-hint { margin: -10px 0 16px; }
.block > legend { float: left; width: 100%; padding: 0; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; font: 500 1.4rem/1.2 var(--display); }
.block > legend::before { content: counter(step); display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 .85rem/1 var(--body); }
.block > legend ~ * { clear: both; }

.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label { font-weight: 500; font-size: .9rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 111, 120, .18); }
.field input:disabled { opacity: .5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-row-tight { grid-template-columns: 1fr auto; align-items: end; margin-top: 18px; }
.field-qty input { width: 96px; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.field-error, .is-error { color: var(--rust-ink); font-weight: 500; font-size: .9rem; }
.checks { display: grid; gap: 2px; margin-bottom: 16px; }
.checks .check-opt { margin-top: 8px; }
/* Champs facultatifs replies sous une ligne */
.more-fields { margin: 0 0 16px; }
.more-fields summary { display: block; cursor: pointer; list-style: none; font-size: .9rem; color: var(--teal); }
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary::before { content: "+"; display: inline-block; width: 1.1em; font: 500 1rem/1 var(--body); }
.more-fields[open] summary::before { content: "−"; }
.more-fields summary .muted { color: var(--muted); }
.more-fields[open] summary { margin-bottom: 14px; }
.check-first { margin: 0 0 16px; }

.dropzone { position: relative; border: 1.5px dashed var(--line-2); border-radius: 10px; background: var(--card); padding: 30px 20px; text-align: center; margin-bottom: 18px; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--teal); background: #eef2ee; }
.dropzone:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone label { display: grid; gap: 6px; justify-items: center; }
.dropzone svg { width: 40px; height: 40px; color: var(--rust); }
.dropzone u { color: var(--teal); text-underline-offset: 3px; }

.trace-card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 16px; margin-bottom: 18px; }
.trace-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.trace-file { font-weight: 600; font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
.trace-body { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center; }
.trace-map { display: block; width: 100%; height: 240px; background: var(--paper-2); border-radius: var(--r); }
.t-halo { fill: none; stroke: var(--card); stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.t-line { fill: none; stroke: var(--rust); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.t-start { fill: var(--ink); stroke: var(--card); stroke-width: 2; vector-effect: non-scaling-stroke; }
.t-end { fill: var(--card); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.stats-small { margin-bottom: 12px; }
.trace-profile { display: block; width: 100%; height: 84px; }
.p-area { fill: rgba(180, 72, 45, .14); }
.p-line { fill: none; stroke: var(--rust); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#trace-msg:empty { display: none; }
#trace-msg { margin: 12px 0 0; }

.style-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 16px; }
.style-card-opt { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.style-card-opt:hover { border-color: var(--ink); }
.style-card-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), 0 8px 18px -10px rgba(39, 34, 29, .4); }
.style-card-opt:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.style-card-img { display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.style-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.style-card-img span { font: 400 2.4rem/1 var(--display); color: var(--muted); }
.style-card-name { font: 500 1.1rem/1.2 var(--display); padding: 10px 12px 0; }
.style-card-desc { font-size: .8rem; color: var(--muted); padding: 4px 12px 12px; line-height: 1.45; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); }
.segmented label { position: relative; cursor: pointer; }
.segmented span { display: block; padding: 7px 12px; border-radius: 5px; font-size: .875rem; }
.segmented input:checked + span { background: var(--ink); color: var(--paper); }
.segmented input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 1px; }

.order-aside { position: sticky; top: 88px; }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: 0 12px 30px -20px rgba(39, 34, 29, .35); }
/* En-tete compact (vignette + titre) : le bouton reste visible sans defiler */
.summary-head { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 16px; }
.summary-preview { position: relative; aspect-ratio: 1; background: var(--paper-2); border-radius: var(--r); overflow: hidden; }
.summary-preview img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 74%; max-height: 86%; box-shadow: var(--shadow-print); }
.summary-preview.is-landscape img { max-width: 86%; }
.summary-title { font: 500 1.3rem/1.15 var(--display); margin: 0 0 3px; }
.summary-sub { font: italic 400 .95rem/1.3 var(--display); color: var(--ink-2); margin: 0; }
.summary-sub:empty { display: none; }
.summary-lines { display: grid; gap: 8px; margin: 0 0 14px; font-size: .85rem; }
.summary-lines div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
.summary-lines dt { color: var(--muted); }
.summary-lines dd {
  margin: 0; overflow-wrap: anywhere; white-space: pre-line;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
/* Choix acquis : modifiables, mais en retrait des champs a remplir */
.recap-tools { margin: -4px 0 16px; }
.recap-toggle { font-size: .85rem; }
.recap-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; margin-top: 10px; padding: 12px; background: var(--paper); border-radius: var(--r); }
.recap-edit .field { margin: 0; gap: 3px; }
.recap-edit .field-wide { grid-column: 1 / -1; }
.recap-edit .field > label { font-size: .78rem; font-weight: 500; color: var(--muted); }
.recap-edit .field select, .recap-edit .field input { padding: 6px 8px; font-size: .85rem; }
.recap-edit .check-opt { margin: 2px 0 0; font-size: .85rem; }
.recap-edit .check-opt input { width: 16px; height: 16px; margin-top: 2px; }
.summary .total { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 4px; }
.summary .btn { margin: 12px 0 12px; }
.summary .small { margin-bottom: .6em; }

/* ---------- Votre trace : apercu et reglages de l'affiche ---------- */
.order-grid[data-flow="sur-mesure"] { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
.style-tiles-named { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
.style-tiles-named .style-tile { gap: 4px; }
.style-tiles-named .style-tile-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-size: .75rem; text-align: center; line-height: 1.25; }
.field-sub { margin: 4px 0 0 28px; }
.block-hint-open { margin: 10px 0 14px; }
#bloc-affiche .opt-group:first-of-type { margin-top: 0; }
#bloc-affiche > .check-opt, #bloc-affiche .lieux { margin-top: 20px; }
.lieux .hint { margin-bottom: 6px; }
.lieux-autre { margin: 10px 0 0; }
.atelier-requis { margin-top: 6px; color: var(--rust-ink); font-weight: 500; }
/* Vue en perspective : sous-option des retouches a l'atelier. */
#bloc-affiche > .check-opt.check-sub { margin: 10px 0 0 28px; }
.lieux-liste { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 16px; max-height: 232px; overflow: auto; }
.lieux-liste:empty { display: none; }
.lieux-liste .check-opt { margin-top: 6px; font-size: .875rem; line-height: 1.35; }
.lieux-liste .check-opt input { width: 16px; height: 16px; margin-top: 2px; }
.lieux-liste small { color: var(--muted); font-size: .75rem; }
.has-apercu .trace-body { grid-template-columns: minmax(0, 1fr); }
.has-apercu .trace-map, .has-apercu .trace-profile { display: none !important; }

.apercu { margin-bottom: 16px; }
.apercu-cadre { position: relative; display: grid; place-items: center; min-height: 220px; padding: 14px; background: var(--paper-2); border-radius: var(--r); }
.apercu-cadre canvas { display: block; width: auto; height: auto; max-width: 100%; box-shadow: var(--shadow-print); transition: opacity .2s; }
.summary-pay .summary-lines { margin: 4px 0 12px; }
.apercu-cadre.is-loading canvas { opacity: .45; }
.apercu-vide { margin: 0; max-width: 16em; text-align: center; color: var(--muted); font-size: .9rem; }
.apercu-pied { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 8px 0 2px; }
.apercu-etat { margin: 0; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.apercu-pied .link-btn { flex: none; font-size: .8rem; }
.envoi { margin: 0 0 2px; }
.order-main > .apercu { margin: 24px 0 0; }
.dialog-apercu { max-width: min(94vw, 980px); padding: 16px; text-align: center; }
.dialog-apercu img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin-bottom: 12px; }

.dialog { border: 0; border-radius: 10px; padding: 24px; max-width: 580px; width: calc(100% - 32px); background: var(--card); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.dialog::backdrop { background: rgba(39, 34, 29, .5); }
.dialog pre { white-space: pre-wrap; background: var(--paper-2); padding: 14px; border-radius: var(--r); font: .8rem/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; max-height: 50vh; overflow: auto; }

/* ---------- Merci ---------- */
.thanks { max-width: 42em; text-align: center; padding: clamp(64px, 10vw, 120px) var(--gutter); }
.thanks .lead { margin: 0 auto 1em; }
.thanks-illus { width: 150px; margin-bottom: 20px; }
.thanks .btn { margin-top: 16px; }
.thanks-actions { display: flex; flex-wrap: wrap; gap: 0 12px; justify-content: center; }
.legal { max-width: 46em; padding: clamp(48px, 8vw, 96px) var(--gutter); }
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .4em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .custom-grid, .faq-grid, .product-grid, .order-grid { grid-template-columns: minmax(0, 1fr); }
  .viewer, .order-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-sources { grid-column: 1 / -1; }
  .stage { aspect-ratio: 1; max-height: 80vh; }
  .stage:has(.poster.is-landscape) { aspect-ratio: 4 / 3; }
  /* Commande d'une carte de la collection : la carte choisie en tete, puis
     les champs a remplir, puis le total et le bouton. */
  .order-grid[data-flow="catalogue"] .order-aside,
  .order-grid[data-flow="catalogue"] .summary { display: contents; }
  .order-grid[data-flow="catalogue"] .summary-recap,
  .order-grid[data-flow="catalogue"] .summary-pay { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
  .order-grid[data-flow="catalogue"] .summary-recap { order: -1; }
  .order-grid[data-flow="catalogue"] .recap-tools { margin-bottom: 0; }
  .order-grid[data-flow="sur-mesure"] { grid-template-columns: minmax(0, 1fr); }
  .apercu-cadre canvas { max-height: 72vh; }
  .order-grid[data-flow="catalogue"] { margin-top: 20px; }
  .order-grid[data-flow="catalogue"] .order-main { margin-top: -28px; } /* marge du premier bloc */
}
@media (max-width: 640px) {
  .nav a:not(.btn) { display: none; }
  .header-inner { height: 60px; }
  .logo { font-size: 1.15rem; }
  .buy-bar-inner { gap: 10px; height: 64px; }
  .buy-bar-thumb { height: 40px; }
  .buy-bar-total { font-size: 1.2rem; }
  .buy-bar .btn { padding: .7em 1em; }
  .field-row, .trace-body { grid-template-columns: minmax(0, 1fr); }
  .field-row-tight { grid-template-columns: 1fr auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-wall { padding: 7% 6%; }
  .frame { border-width: 4px; }
  .format-opt { grid-template-columns: 1fr auto; }
  .format-dim { grid-column: 1 / -1; grid-row: 2; }
  .viewer-tabs button { padding: 6px 10px; }
  .trace-map { height: 220px; }
}

/* Cartes et apercus : ni « Ouvrir l'image dans un nouvel onglet » ni
   « Enregistrer l'image » au clic droit ou a l'appui long, ni glisser-deposer.
   Le clic traverse l'image et atteint son lien, son bouton ou son etiquette :
   aucune image n'a d'action propre. Simple dissuasion (les outils du
   navigateur restent possibles) : la vraie protection est la definition
   limitee des images publiees (site/build.py). */
main img, main canvas, dialog img {
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
