/* Les couleurs et polices ci-dessous sont des valeurs de départ :
   js/common.js (applyTheme) les remplace par celles du métier choisi. */
:root {
  --ink: #1b1e45;
  --paper: #f4f5fa;
  --primary: #2b2f8f;
  --accent: #e8a317;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --surface: #fff;
  --line: color-mix(in srgb, var(--ink) 14%, var(--paper));
  --muted: color-mix(in srgb, var(--ink) 68%, var(--paper));
  --soft: color-mix(in srgb, var(--primary) 8%, var(--paper));
  --danger: #b3261e;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(1180px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); scroll-margin-top: 72px; }
.muted { color: var(--muted); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
  font: 700 .95rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn.small { padding: .4rem .9rem; font-size: .85rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); }

.field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.field label { font-weight: 700; font-size: .88rem; }
.field small { color: var(--muted); }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], textarea {
  width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 5.5rem; }
.form-error { color: var(--danger); font-weight: 700; min-height: 1.4em; margin-bottom: .5rem; }

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand { font: 700 1.3rem var(--font-display); text-decoration: none; margin-right: auto; letter-spacing: -.01em; }
.nav { display: flex; gap: 1.25rem; }
.nav a { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--ink); }

/* ---------- Accueil ---------- */
.hero { padding-block: clamp(2rem, 6vw, 5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -.025em; margin: .9rem 0 1.1rem; }
.hero .lead { max-width: 52ch; color: var(--muted); font-size: 1.1rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-art {
  position: relative; margin: 0; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 999px 999px var(--radius) var(--radius); background: var(--soft);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art figcaption {
  position: absolute; left: 14px; right: 14px; bottom: 14px; padding: .6rem 1rem;
  background: var(--paper); border-radius: 12px; font-weight: 700; font-size: .92rem;
}

.steps { background: var(--soft); }
.steps h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 2rem; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 2rem; }
.steps li { border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps .n { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--ink); font: 700 .95rem var(--font-display); margin-bottom: .6rem; }
.steps h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.steps p { color: var(--muted); }

.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  padding: .4rem .95rem; border-radius: 999px; font: 700 .88rem var(--font-body); cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.card { display: flex; flex-direction: column; gap: .7rem; text-decoration: none; }
.card .pic { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .pic img { transform: scale(1.04); }
.card h3 { font-size: 1.1rem; font-weight: 700; }
.card .meta { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .9rem; }
.card .meta strong { color: var(--ink); white-space: nowrap; }
.empty { padding: 2.5rem 0; max-width: 46ch; display: grid; gap: 1rem; justify-items: start; color: var(--muted); }

/* ---------- Fiche ---------- */
.back { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-weight: 700; margin-bottom: 1.5rem; }
.item { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.gallery .main { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: none; width: 64px; height: 64px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--soft); cursor: pointer; }
.thumb[aria-pressed=true] { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .info h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: .5rem 0 .8rem; letter-spacing: -.02em; }
.price { font: 700 1.9rem var(--font-display); margin-bottom: 1.2rem; }
.facts { display: grid; gap: .5rem; margin: 0 0 1.2rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.desc { white-space: pre-line; color: var(--muted); margin-bottom: 1.6rem; max-width: 60ch; }
.item .actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- À propos et pied de page ---------- */
.about { background: var(--ink); color: var(--paper); }
.about .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.about h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 1rem; }
.about p { max-width: 56ch; opacity: .85; }
.about .contact { display: grid; gap: .75rem; justify-items: start; }
.about .contact .btn-ghost { border-color: var(--paper); color: var(--paper); }
.foot { padding-block: 1.5rem; color: var(--muted); font-size: .88rem; }
.boot-error { padding: 3rem var(--gutter); font-weight: 700; }

/* ---------- Discussion ---------- */
.chat-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.chat {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); z-index: 40;
  display: flex; flex-direction: column; background: var(--surface);
  box-shadow: -14px 0 44px rgba(0, 0, 0, .2);
  transform: translateX(105%); visibility: hidden; transition: transform .25s ease, visibility .25s;
}
.chat.open { transform: none; visibility: visible; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem .9rem 1.25rem; background: var(--primary); color: #fff; }
.chat-head small { display: block; opacity: .8; }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat .start { overflow: auto; padding: 1.25rem; }
.chat .start p { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }
.msgs { flex: 1; overflow: auto; padding: 1rem; }
.msg { max-width: 82%; width: fit-content; padding: .55rem .8rem; border-radius: 14px; margin-bottom: .5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { margin-left: auto; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { background: var(--soft); border-bottom-left-radius: 4px; }
.msg time { display: block; font-size: .72rem; opacity: .7; margin-top: .15rem; }
.compose { display: flex; gap: .5rem; align-items: end; padding: .75rem; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.compose textarea { min-height: 2.6rem; max-height: 8rem; flex: 1; }
.compose .btn { padding: .7rem .9rem; }

@media (max-width: 820px) {
  .hero .wrap, .item, .about .wrap { grid-template-columns: 1fr; }
  .hero-art { aspect-ratio: 16 / 10; border-radius: var(--radius); }
  .nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Panier ---------- */
.card-wrap { position: relative; }
.card-add {
  position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.card-add:hover { background: var(--accent); }
.cart-fab { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.cart-fab.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); z-index: 45;
  display: flex; flex-direction: column; background: var(--surface);
  box-shadow: -14px 0 44px rgba(0, 0, 0, .2);
  transform: translateX(105%); visibility: hidden; transition: transform .25s ease, visibility .25s;
}
.cart.open { transform: none; visibility: visible; }
.cart-body { flex: 1; overflow: auto; padding: 1.1rem 1.25rem 1.5rem; display: grid; gap: .9rem; align-content: start; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.cart-lines li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; }
.cl-t { display: grid; min-width: 0; }
.cl-t strong { overflow-wrap: anywhere; }
.qty { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; }
.qty button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.qty button:hover { border-color: var(--ink); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; padding-block: .3rem; border-top: 2px solid var(--ink); }
.cart-total strong { font: 700 1.5rem var(--font-display); }
.small-note { font-size: .86rem; }

/* ---------- Améliorations d'affichage des sites clients ---------- */
.hero-facts { list-style: none; margin: 1.75rem 0 0; padding: 1.1rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .6rem; max-width: 52ch; }
.hero-facts li { display: flex; align-items: flex-start; gap: .65rem; color: var(--muted); font-size: .95rem; }
.hero-facts svg { flex: none; color: var(--primary); margin-top: .12rem; }
.hero-facts span { overflow-wrap: anywhere; }

.card .pic { position: relative; }
.card .price-tag {
  position: absolute; left: 10px; bottom: 10px; padding: .32rem .7rem; border-radius: 999px;
  background: var(--paper); color: var(--ink); font: 700 .9rem var(--font-body); white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.card h3 { line-height: 1.25; }
.card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.card:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; border-radius: var(--radius); }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .8rem; } .card h3 { font-size: 1rem; } .card .price-tag { font-size: .8rem; left: 8px; bottom: 8px; } }

.map-frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--soft); min-height: 260px; }
.map .map-frame iframe { display: block; border: 0; border-radius: 0; width: 100%; aspect-ratio: 4 / 3; min-height: 260px; }
.map .map-go { position: absolute; left: 12px; bottom: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.foot a { color: var(--muted); }
.hero h1 { text-wrap: balance; }
.section-head h2, .steps h2 { text-wrap: balance; }

/* ---------- Catalogue : beaucoup d'articles, bien rangés ---------- */
.hero h1.long { font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: 1.1; }
.hero-art.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; aspect-ratio: 1 / 1; border-radius: var(--radius); background: transparent; }
.hero-art.mosaic img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 12px; background: var(--soft); }
.hero-art.mosaic.n3 img:first-child { grid-row: span 2; }
.hero-art.mosaic figcaption { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.search {
  width: 100%; max-width: 420px; margin: 0 0 1.5rem; padding: .75rem 1rem; border: 1.5px solid var(--line);
  border-radius: 999px; background: var(--surface, #fff); color: var(--ink); font: 600 1rem var(--font-body);
}
.search:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-color: transparent; }
.no-result { padding: 2rem 0; color: var(--muted); }
.more { display: flex; margin: 2rem auto 0; }
.card { transition: transform .2s ease; }
.card:hover { transform: translateY(-3px); }
.card .pic { box-shadow: 0 1px 0 var(--line); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }

/* =====================================================================
   Dispositions : chaque site peut avoir une structure différente
   (classique, vitrine, galerie, boutique). Les couleurs et polices restent celles du client.
   ===================================================================== */
.card .price-tag { z-index: 2; }

/* ----- Vitrine : photo plein écran, articles en images plein cadre ----- */
[data-layout=vitrine] .brand { text-transform: uppercase; letter-spacing: .14em; font-size: 1.02rem; }
.hv { position: relative; isolation: isolate; color: #fff; min-height: min(80vh, 660px); display: grid; align-items: end; }
.hv-bg, .hv-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hv::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, .78) 100%); }
.hv-in { padding-block: clamp(5rem, 14vw, 8rem) clamp(2rem, 5vw, 3.5rem); }
.hv .eyebrow { color: var(--accent); }
.hv h1 { font-size: clamp(2.5rem, 7.5vw, 5.2rem); color: #fff; max-width: 15ch; margin: .7rem 0 1rem; letter-spacing: -.03em; }
.hv h1.long { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 22ch; }
.hv .lead { max-width: 56ch; color: rgba(255, 255, 255, .9); font-size: 1.1rem; }
.hv .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hv .btn-ghost { border-color: #fff; color: #fff; }
.hv-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 2rem 0 0; padding: 0; }
.hv-facts li { display: flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(8px); font-size: .9rem; }
.hv-facts svg { flex: none; color: var(--accent); }
.lay-vitrine #catalogue .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.lay-vitrine .card { display: grid; border-radius: var(--radius); overflow: hidden; }
.lay-vitrine .card .pic { grid-area: 1 / 1; aspect-ratio: 4 / 5; border-radius: 0; }
.lay-vitrine .card .pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .72)); }
.lay-vitrine .card h3, .lay-vitrine .card .meta { grid-area: 1 / 1; z-index: 1; padding-inline: 1.1rem; color: #fff; pointer-events: none; }
.lay-vitrine .card h3 { align-self: end; margin-bottom: 2.2rem; font-size: 1.3rem; }
.lay-vitrine .card .meta { align-self: end; padding-bottom: 1rem; color: rgba(255, 255, 255, .8); }
.lay-vitrine .card:hover h3 { text-decoration: none; }
.lay-vitrine .steps { background: var(--ink); color: var(--paper); }
.lay-vitrine .steps li { border-top-color: var(--accent); }
.lay-vitrine .steps p { color: rgba(255, 255, 255, .72); }

/* ----- Galerie : titre centré, photos en mosaïque ----- */
[data-layout=galerie] .top .wrap { flex-wrap: wrap; justify-content: center; padding-block: .85rem; gap: .5rem 1.5rem; }
[data-layout=galerie] .brand { flex-basis: 100%; text-align: center; margin: 0; font-size: 1.7rem; }
.hg { text-align: center; padding-block: clamp(2.5rem, 7vw, 5rem) 1rem; }
.hg .wrap { display: grid; justify-items: center; }
.hg h1 { font-size: clamp(2.4rem, 6.5vw, 4.8rem); max-width: 18ch; margin: .8rem 0 1rem; letter-spacing: -.03em; }
.hg h1.long { font-size: clamp(1.9rem, 4.6vw, 3.1rem); max-width: 26ch; }
.hg .lead { max-width: 56ch; color: var(--muted); font-size: 1.1rem; }
.hg .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.5rem; }
.hg-facts { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem; margin: 1.75rem 0 0; padding: 0; color: var(--muted); font-size: .92rem; }
.hg-facts li { display: flex; align-items: center; gap: .5rem; }
.hg-facts svg { color: var(--primary); flex: none; }
.lay-galerie .section-head { justify-content: center; flex-direction: column; align-items: center; text-align: center; }
.lay-galerie #catalogue .grid { display: block; column-count: 3; column-gap: 1rem; }
.lay-galerie .grid > * { break-inside: avoid; margin-bottom: 1rem; }
.lay-galerie .card .pic { aspect-ratio: auto; }
.lay-galerie .card .pic img { height: auto; }
.lay-galerie .grid > :nth-child(4n+2) .pic img { aspect-ratio: 1 / 1; object-fit: cover; }
.lay-galerie .grid > :nth-child(4n+3) .pic img { aspect-ratio: 4 / 5; object-fit: cover; }
.lay-galerie .card .meta { display: none; }
.lay-galerie .card h3 { font-size: 1rem; font-weight: 600; }
.lay-galerie .steps { background: transparent; border-top: 1px solid var(--line); }
.lay-galerie .steps h2 { text-align: center; }
@media (max-width: 900px) { .lay-galerie #catalogue .grid { column-count: 2; } }

/* ----- Boutique : bandeau compact, grille serrée ----- */
.hb { background: var(--soft); border-bottom: 1px solid var(--line); padding-block: 1.75rem; }
.hb .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem 3rem; align-items: center; }
.hb h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin: .4rem 0 .5rem; }
.hb .lead { color: var(--muted); max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hb-side { display: grid; gap: 1rem; justify-items: start; }
.hb .actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hb-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.hb-facts li { display: flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .82rem; }
.hb-facts svg { color: var(--primary); flex: none; }
.lay-boutique #catalogue { padding-top: 1.75rem; }
.lay-boutique .section-head h2 { font-size: 1.4rem; }
.lay-boutique .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .9rem; }
.lay-boutique .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem; gap: .5rem; }
.lay-boutique .card .pic { aspect-ratio: 1 / 1; border-radius: 10px; }
.lay-boutique .card h3 { font-size: .98rem; }
.lay-boutique .steps { padding-block: 1.5rem; }
.lay-boutique .steps h2 { font-size: 1.2rem; margin-bottom: 1rem; }
@media (max-width: 820px) { .hb .wrap { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .lay-boutique .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Corrections de détail */
.lay-vitrine .card .price-tag { top: 12px; bottom: auto; left: 12px; }
.lay-boutique .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.lay-boutique .card .price-tag { white-space: normal; max-width: calc(100% - 16px); line-height: 1.2; font-size: .8rem; }

/* =====================================================================
   Téléphone (≤ 560 px) : placé en dernier pour l'emporter sur les dispositions.
   Catalogue en 2 colonnes pour TOUTES les dispositions (sauf galerie, déjà en 2 colonnes),
   zones tactiles d'au moins 44 px, en-tête compact, héros vitrine lisible.
   ===================================================================== */
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  html { -webkit-text-size-adjust: 100%; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding-inline: 1rem; }
  .chip { min-height: 40px; display: inline-flex; align-items: center; }
  .icon-btn { width: 44px; height: 44px; }
  .top .wrap { min-height: 56px; gap: .6rem; }
  .brand { font-size: 1.12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .section { padding-block: 2rem; }

  .lay-classique #catalogue .grid, .lay-vitrine #catalogue .grid, .lay-boutique #catalogue .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem .6rem;
  }
  .card h3 { font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .lay-classique .card .meta { flex-direction: column; gap: 0; font-size: .85rem; }
  .lay-galerie #catalogue .grid { column-gap: .6rem; }
  .lay-galerie .grid > * { margin-bottom: .6rem; }

  .lay-vitrine .card .pic { aspect-ratio: 3 / 4; }
  .lay-vitrine .card h3 { font-size: .98rem; margin-bottom: 1.5rem; padding-inline: .7rem; }
  .lay-vitrine .card .meta { padding-inline: .7rem; padding-bottom: .65rem; font-size: .78rem; }
  .lay-vitrine .card .price-tag { top: 8px; left: 8px; }
  .lay-boutique .card { padding: .4rem; }

  .hv { min-height: min(74svh, 540px); }
  .hv::after { background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .86) 100%); }
  .hv-in { padding-block: 4rem 1.75rem; }
  .hv .eyebrow { color: #fff; }
  .hv h1 { font-size: clamp(1.9rem, 9vw, 2.5rem); }
  .hv .lead { font-size: 1rem; }
  .hv-facts { margin-top: 1.25rem; }
  .hv-facts li { font-size: .84rem; padding: .4rem .8rem; }
  .hg { padding-block: 2rem .5rem; }
  .hg h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  [data-layout=galerie] .brand { font-size: 1.4rem; }

  /* Fiche article : boutons pleine largeur, faciles à toucher */
  .item .actions { flex-direction: column; align-items: stretch; }
  .item .actions .btn { width: 100%; }
}

/* Champ photo : bouton lisible partout */
input[type=file] { font: inherit; width: 100%; max-width: 100%; min-width: 0; }
.field, .logo-box { min-width: 0; }
input[type=file]::file-selector-button {
  font: 700 .9rem var(--font-body); padding: .55rem 1rem; margin-right: .75rem; border-radius: 999px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer;
}

/* ---------- Site vivant : mouvement discret, bouton WhatsApp, photo agrandie ---------- */
.top { transition: box-shadow .25s ease; }
.top .wrap { transition: min-height .25s ease; }
.scrolled .top { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.scrolled .top .wrap { min-height: 52px; }
.brand { display: inline-flex; align-items: center; }
.brand img.logo { flex: 0 0 auto; transition: height .25s ease; }
.scrolled .brand img.logo { height: 32px; }

/* Les catégories restent collées sous l'en-tête */
.chips-bar { position: sticky; top: var(--top-h, 64px); z-index: 15; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); padding-block: .6rem; margin: -.5rem 0 1rem; }
.lay-galerie .chips-bar .chips { justify-content: center; }
.chip { transition: background .2s ease, color .2s ease, transform .15s ease; }
.chip:active { transform: scale(.95); }

/* Apparition douce */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.rv.in { opacity: 1; transform: none; }
.card:active .pic { transform: scale(.985); }
.card .pic { transition: transform .2s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero .wrap > *, .hv-in > *, .hg .wrap > *, .hb .wrap > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero .wrap > :nth-child(2), .hv-in > :nth-child(2), .hg .wrap > :nth-child(2), .hb .wrap > :nth-child(2) { animation-delay: .12s; }
.hv-in > :nth-child(3), .hg .wrap > :nth-child(3) { animation-delay: .22s; }
.hv-in > :nth-child(4), .hg .wrap > :nth-child(4) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .hero .wrap > *, .hv-in > *, .hg .wrap > *, .hb .wrap > * { animation: none; }
  .wa-fab { animation: none !important; }
}

/* Bouton rond WhatsApp (au-dessus du bouton Écrire) */
.wa-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: #1faa59; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: wa-pop .5s .8s cubic-bezier(.3, 1.5, .5, 1) both;
}
.chat-fab ~ .wa-fab { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 62px); }
.wa-fab:hover { filter: brightness(1.08); }
@keyframes wa-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
body:has(#chat.open) .wa-fab, body:has(#cart.open) .wa-fab, body.lb-open .wa-fab { display: none; }

/* Photo agrandie */
.gallery .main.zoomable { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; position: relative; }
.gallery .main.zoomable::after { content: '⤢'; position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.1rem; }
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(8, 10, 24, .93); display: grid; place-items: center; animation: rise .25s ease both; }
.lb img { max-width: 100vw; max-height: 100vh; object-fit: contain; touch-action: pan-y; }
.lb-x, .lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 1.8rem; line-height: 1; }
.lb-x { top: max(14px, env(safe-area-inset-top)); right: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-count { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; font-size: .9rem; }

@media (max-width: 560px) {
  /* Une seule ligne de catégories qu'on balaye du pouce */
  .chips-bar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips-bar .chips::-webkit-scrollbar { display: none; }
  .chips-bar .chip { flex: 0 0 auto; white-space: nowrap; }
  .lay-galerie .chips-bar .chips { justify-content: flex-start; }
  .scrolled .top .wrap { min-height: 48px; }
  .brand img.logo { height: 34px; }
  .scrolled .brand img.logo { height: 28px; }
}

/* Pied de page d'un site client : les liens ne passent jamais sous les boutons flottants */
.foot-links { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; }
@media (max-width: 700px) {
  .foot { padding-bottom: 5.5rem; }
  .foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- Photo de couverture choisie par le client ---------- */
/* Classique : la photo remplit la vignette ronde, sans le fond coloré */
.hero-art.cover { border-radius: var(--radius); background: none; aspect-ratio: 4 / 3; }

/* Galerie et boutique : la photo passe en fond, le texte reste lisible grâce au voile */
.cover-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.cover-bg img { width: 100%; height: 100%; object-fit: cover; }
.hg.has-cover, .hb.has-cover { position: relative; isolation: isolate; color: #fff; }
.hg.has-cover::after, .hb.has-cover::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, .74) 100%);
}
.hg.has-cover { padding-block: clamp(3.5rem, 9vw, 6rem) clamp(2rem, 5vw, 3rem); }
.hb.has-cover { padding-block: clamp(2.5rem, 6vw, 4rem); border-bottom: 0; background: none; }
.hg.has-cover h1, .hb.has-cover h1 { color: #fff; }
.hg.has-cover .eyebrow, .hb.has-cover .eyebrow { color: #fff; opacity: .85; }
.hg.has-cover .lead, .hb.has-cover .lead { color: rgba(255, 255, 255, .9); }
.hg.has-cover .hg-facts, .hb.has-cover .hb-facts { color: #fff; }
.hg.has-cover .hg-facts svg, .hb.has-cover .hb-facts svg { color: #fff; }
.hg.has-cover .btn-ghost, .hb.has-cover .btn-ghost { border-color: #fff; color: #fff; }

/* ---------- Commande enregistrée chez le vendeur ---------- */
.order-form { display: grid; gap: .85rem; }
.order-form .small-note { margin-top: -.2rem; }
.order-host { margin-top: 1.25rem; }
.order-host .order-form { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.order-done { display: flex; gap: .8rem; align-items: flex-start; padding: 1.1rem; border-radius: 14px; background: color-mix(in srgb, #1faa59 10%, var(--paper)); border: 1px solid color-mix(in srgb, #1faa59 35%, var(--line)); }
.order-done .od-ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: #1faa59; color: #fff; display: grid; place-items: center; }
.order-done strong { display: block; font-size: 1.05rem; }
.order-done p { color: var(--muted); margin: .25rem 0 .7rem; line-height: 1.5; }

/* ==========================================================================
   Identité « wax » : chaque site porte son tissu, à ses couleurs
   ========================================================================== */

/* Lisière : le bord d'un pagne, entre l'en-tête du site et la suite, et avant le pied de page */
.lisiere { height: 16px; background-image: var(--wax); background-size: auto 100%; background-repeat: repeat-x; }
@media (min-width: 761px) { .lisiere { height: 20px; } }

/* Le prix devient une étiquette collée sur la photo */
.card .price-tag {
  background: var(--accent); color: var(--ink); border-radius: 8px 8px 8px 2px;
  transform: rotate(-3deg); transform-origin: left bottom; letter-spacing: -.01em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}
.card:hover .price-tag { transform: rotate(0deg) scale(1.04); }
.card .price-tag { transition: transform .2s ease; }

/* Étapes : chaque carte commence par un morceau de lisière */
.steps li { border-top: 0; padding-top: 0; }
.steps li::before { content: ''; display: block; width: 72px; height: 10px; border-radius: 5px; margin-bottom: 1rem; background-image: var(--wax); background-size: auto 100%; }
.lay-vitrine .steps li { border-top: 0; }

/* « À propos » : le tissu en filigrane derrière le texte */
.about { position: relative; isolation: isolate; overflow: hidden; }
.about::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--wax-soft); background-size: 72px auto; opacity: .1; }

/* Bandeau de confiance : petites puces à motif au lieu des simples coches */
.trust span svg { color: var(--accent); }

/* « +1 » qui s'envole du bouton d'ajout */
.pop-plus { position: fixed; z-index: 80; transform: translate(-50%, 0); pointer-events: none; font: 800 1.15rem var(--font-display); color: var(--ink); background: var(--accent); padding: .15rem .55rem; border-radius: 999px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); animation: pop-up .9s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes pop-up { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -64px) scale(1); } }

/* Confettis à la commande */
.order-done { position: relative; overflow: visible; }
.confetti { position: absolute; left: 0; right: 0; top: -10px; height: 0; pointer-events: none; }
.confetti i { position: absolute; top: 0; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall 1.8s cubic-bezier(.25, .7, .4, 1) forwards; }
@keyframes confetti-fall {
  0% { opacity: 1; transform: translate(0, -20px) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), 260px) rotate(var(--rot)); }
}

@media (prefers-reduced-motion: reduce) {
  .card .price-tag, .card:hover .price-tag { transform: none; transition: none; }
  .pop-plus, .confetti { display: none; }
}

/* Coup de cœur : le visiteur garde ses articles préférés (sur son téléphone) */
.card-fav {
  position: absolute; top: 10px; left: 10px; z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18); backdrop-filter: blur(4px);
}
.card-fav svg { fill: none; transition: fill .2s ease, color .2s ease; }
.card-fav[aria-pressed=true] { color: #e0245e; }
.card-fav[aria-pressed=true] svg { fill: #e0245e; }
.card-fav.beat { animation: heart-beat .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes heart-beat { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .card-fav.beat { animation: none; } }

/* ---------- Choix d'une fiche (contenance, taille, parfum…) ---------- */
.opt-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 1.1rem; }
.opt-chip {
  display: grid; gap: .1rem; text-align: left; min-width: 6.5rem; padding: .55rem .85rem;
  border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer;
  font: inherit; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt-chip span { font-weight: 700; }
.opt-chip small { color: var(--muted); font-size: .8rem; }
.opt-chip:hover { border-color: var(--primary); }
.opt-chip:active { transform: scale(.97); }
.opt-chip[aria-checked=true] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--paper)); box-shadow: inset 0 0 0 1px var(--primary); }
.opt-chip[aria-checked=true] small { color: var(--primary); font-weight: 700; }
.cl-opt { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--soft); }
a.card-add { text-decoration: none; }
