/* =========================================================
   L'Atelier Commun — Impression 3D : matériel d'art
   Feuille de style unique (accueil + pages légales)
   ========================================================= */

:root {
  --bg: #f6efe4;          /* crème du logo */
  --surface: #fffaf2;     /* cartes */
  --ink: #2a1a45;         /* prune "L'Atelier" */
  --violet: #8466b8;      /* lavande "commun" */
  --violet-deep: #644a8e; /* face sombre du cube */
  --sand: #d9c4a0;        /* dessus du cube */
  --sand-soft: #ece0cb;
  --muted: #6e6478;
  --line: rgba(42, 26, 69, 0.1);
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(42, 26, 69, .04), 0 12px 40px -12px rgba(42, 26, 69, .14);
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Typo ---------- */
h1, h2, h3 { margin: 0; font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; }
h1 strong, h2 strong { color: var(--violet); font-weight: 700; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  color: var(--violet-deep);
  font-size: .75rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 52ch; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: .95rem; font-weight: 500;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { color: #fff; background: var(--ink); }
.btn-primary:hover { background: var(--violet-deep); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet-deep); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 96px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: 38px; }
.brand-name { display: grid; line-height: 1; }
.brand-name span { font-size: 1.15rem; font-weight: 300; letter-spacing: -.02em; }
.brand-name strong { margin-top: -1px; color: var(--violet); font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; }
.header .brand { gap: 14px; }
.header .brand img { width: 54px; height: 60px; }
.header .brand-name span { font-size: 1.55rem; }
.header .brand-name strong { font-size: 1.85rem; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.nav a:hover { color: var(--ink); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 8px 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  cursor: pointer; font-size: .9rem;
}
.cart-btn:hover { border-color: var(--violet); }
.cart-count {
  display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 999px; background: var(--violet); color: #fff; font-size: .8rem; font-weight: 600;
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); text-align: center; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55;
}
.hero::before { width: 520px; height: 420px; top: -120px; left: 50%; translate: -85% 0; background: #cdbbe8; }
.hero::after  { width: 480px; height: 380px; top: -60px; left: 50%; translate: -5% 0; background: #ecd9b4; }
.hero h1 { font-size: clamp(2.2rem, 5.6vw, 4.2rem); }
.hero .eyebrow { display: inline-block; line-height: 1.8; }
.hero .eyebrow::before { display: inline-block; margin-right: 10px; vertical-align: middle; }
.hero .lead { margin: 22px auto 0; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-visual { margin-top: clamp(48px, 7vw, 80px); }

/* ---------- Cadres photo (avec repli si l'image manque) ---------- */
.photo {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255,255,255,.7), transparent 55%),
    linear-gradient(145deg, var(--sand-soft), #e3d6f0);
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.photo.is-loaded img { opacity: 1; }
.photo-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--violet-deep); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; text-align: center;
}
.photo-fallback img { position: static; width: 64px; height: auto; opacity: .9; }
.photo.is-loaded .photo-fallback { display: none; }
.hero-3d img { position: absolute; inset: 0; margin: auto; width: 88%; height: 86%; object-fit: contain; opacity: 1; filter: drop-shadow(0 30px 34px rgba(42, 26, 69, .22)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -10px; } }
.ratio-wide { aspect-ratio: 16 / 8; }
.ratio-card { aspect-ratio: 4 / 5; }
.ratio-square { aspect-ratio: 1; }

/* ---------- Bandeau atouts ---------- */
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: clamp(70px, 10vw, 120px); }
.perk { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .95rem; }
.perk-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: #eee6f6; color: var(--violet-deep); }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 10vw, 120px) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.section-head .lead { margin: 0; max-width: 40ch; }

/* ---------- Produits ---------- */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 3vw, 32px); }
.product { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: var(--surface); padding: 10px; box-shadow: var(--shadow); }
.product .photo { border-radius: var(--radius); }
.product-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.product-thumbs:empty { display: none; }
.thumb { width: 58px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--sand-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active { border-color: var(--violet); }
.product-body { display: flex; flex-direction: column; flex: 1; gap: 16px; padding: 22px 16px 14px; }
.product-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.product-tag { display: inline-block; margin-bottom: 8px; padding: 4px 12px; border-radius: 999px; background: #eee6f6; color: var(--violet-deep); font-size: .75rem; font-weight: 500; letter-spacing: .04em; }
.product h3 { font-size: 1.6rem; font-weight: 400; }
.product-price { flex: none; font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.product-desc { margin: 0; color: var(--muted); }
.product-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.product-list li { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; color: var(--muted); }
.product-colors { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--muted); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.product-actions { margin-top: auto; padding-top: 6px; }
.product-made, .footer-made { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.product-made { justify-content: center; margin: 12px 0 0; }
.footer-made { margin: 10px 0 0; }
.product-made::before, .footer-made::before { content: ""; flex: none; width: 18px; height: 12px; border-radius: 2px; background: linear-gradient(90deg, #2b4c9b 33.3%, #fff 33.3% 66.6%, #d8343d 66.6%); box-shadow: 0 0 0 1px var(--line); }
.product-custom label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 500; }
.product-custom label span { color: var(--muted); font-weight: 400; }
.product-custom-field { position: relative; }
.product-custom input {
  width: 100%; height: 46px; padding: 0 64px 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  color: var(--ink); font: inherit; font-size: .95rem; transition: border-color .2s, background .2s;
}
.product-custom input::placeholder { color: #a59cad; }
.product-custom input:focus { outline: none; border-color: var(--violet); background: #fff; }
.product-custom-count { position: absolute; top: 50%; right: 14px; translate: 0 -50%; color: var(--muted); font-size: .75rem; pointer-events: none; }
.product-custom-hint { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.line-text { color: var(--violet-deep) !important; font-style: italic; }

/* ---------- L'idée ---------- */
.idea { padding-top: 0; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pillar { padding: 32px 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.pillar:nth-child(2) { background: #ece3f6; border-color: #dccff0; }
.pillar:nth-child(2) p { color: #5f5470; }
.pillar:nth-child(2) .pillar-icon { background: var(--violet); color: #fff; }
.pillar-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px; border-radius: 14px; background: #eee6f6; color: var(--violet-deep); font-size: 1.3rem; }
.pillar h3 { margin-bottom: 10px; font-size: 1.5rem; font-weight: 500; }
.pillar p { margin: 0; color: var(--muted); }

/* ---------- Liens dans les cartes produits ---------- */
.product h3 a:hover { color: var(--violet-deep); }
a.photo { display: block; }
.product-more { align-self: start; color: var(--violet-deep); font-size: .92rem; font-weight: 500; border-bottom: 1px solid currentColor; }
.product-more:hover { color: var(--ink); }

/* ---------- Page produit ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 28px 0 0; list-style: none; color: var(--muted); font-size: .85rem; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.breadcrumb a:hover { color: var(--ink); }
.pp { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; padding: 28px 0 clamp(60px, 8vw, 100px); }
.pp-gallery { position: sticky; top: 116px; }
.pp-gallery .photo { border-radius: calc(var(--radius) + 6px); }
.pp-info { display: flex; flex-direction: column; gap: 20px; }
.pp-info h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.pp-info .lead { margin: 0; }
.pp-price { margin: 0; font-size: 1.4rem; font-weight: 600; }
.pp-text p { margin: 0 0 12px; color: var(--muted); }
.pp-block-title { margin: 0 0 10px; font-size: .78rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--violet-deep); }
.pp-options { display: flex; flex-direction: column; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; font-size: .95rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.other-box { display: grid; grid-template-columns: 160px 1fr auto; gap: 28px; align-items: center; padding: 16px 28px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.other-box .photo { aspect-ratio: 1; border-radius: var(--radius-sm); }
.other-box h3 { font-size: 1.5rem; font-weight: 400; margin-top: 4px; }
.other-box p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Étapes ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; margin-bottom: 26px; color: var(--violet); font-size: .85rem; font-weight: 600; letter-spacing: .12em; }
.step h3 { margin-bottom: 10px; font-size: 1.3rem; font-weight: 500; }
.step p { margin: 0; color: var(--muted); }

/* ---------- Galerie ---------- */
.gallery { margin-top: 16px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.gallery .photo:first-child { grid-row: span 2; aspect-ratio: auto; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin-inline: auto; }
.faq h2 { margin-bottom: 36px; font-size: clamp(2rem, 4.4vw, 3.4rem); text-align: center; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; cursor: pointer; font-size: 1.1rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--violet); font-size: 1.4rem; line-height: 1; transition: rotate .2s; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 22px; color: var(--muted); max-width: 64ch; }

/* ---------- Contact ---------- */
.cta { position: relative; overflow: hidden; padding: clamp(48px, 7vw, 84px); border-radius: calc(var(--radius) + 8px); background: var(--ink); color: #f6efe4; text-align: center; }
.cta::before { content: ""; position: absolute; inset: -40% 30% auto -10%; height: 120%; border-radius: 50%; background: var(--violet); filter: blur(90px); opacity: .45; }
.cta > * { position: relative; }
.cta h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.cta h2 strong { color: var(--sand); }
.cta p { margin: 18px auto 30px; max-width: 46ch; color: rgba(246, 239, 228, .75); }
.cta .btn { color: var(--ink); background: var(--bg); }
.cta .btn:hover { background: #fff; }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 32px; border-top: 1px solid var(--line); }
.footer-tagline { margin: 6px 0 0; color: var(--muted); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: var(--ink); }
.footer small { display: block; width: 100%; color: var(--muted); font-size: .8rem; }

/* ---------- Panier ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(42, 26, 69, .3); opacity: 0; transition: opacity .25s; }
.drawer {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  width: min(100%, 420px); background: var(--surface);
  box-shadow: -20px 0 60px -20px rgba(42, 26, 69, .3);
  translate: 100% 0; transition: translate .3s ease;
}
body.cart-open .drawer { translate: 0 0; }
body.cart-open .drawer-backdrop { opacity: 1; }
body.cart-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.5rem; font-weight: 400; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.2rem; }
.icon-btn:hover { border-color: var(--violet); }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer-empty { display: grid; justify-items: center; gap: 12px; padding: 60px 0; color: var(--muted); text-align: center; }
.drawer-empty img { width: 52px; opacity: .8; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line-thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: linear-gradient(145deg, var(--sand-soft), #e3d6f0); }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line h3 { font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.line p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; }
.qty span { min-width: 18px; text-align: center; font-size: .9rem; }
.drawer-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.drawer-total { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 1.1rem; }
.drawer-total strong { font-weight: 600; }
.drawer-note { margin: 0 0 16px; color: var(--muted); font-size: .82rem; }

/* ---------- Pages légales ---------- */
.legal { padding: clamp(56px, 8vw, 96px) 0 40px; }
.legal-inner { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 18px; }
.legal .lead { margin-bottom: 40px; }
.legal-notice { padding: 18px 22px; margin-bottom: 28px; border-radius: var(--radius-sm); background: #eee6f6; color: var(--violet-deep); font-size: .92rem; }
.legal section { padding: 26px 0; border-top: 1px solid var(--line); }
.legal h2 { margin-bottom: 10px; font-size: 1.35rem; font-weight: 500; letter-spacing: -.01em; }
.legal p { margin: 6px 0; color: var(--muted); }
.legal strong { color: var(--ink); font-weight: 500; }
.legal-updated { margin-top: 24px; color: var(--muted); font-size: .8rem; }

/* ---------- Apparition douce ---------- */
.reveal { opacity: 0; translate: 0 16px; transition: opacity .7s ease, translate .7s ease; }
.reveal.is-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: none; transition: none; }
  .drawer, .drawer-backdrop { transition: none; }
  .hero-3d img { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .section-head { flex-direction: column; align-items: start; }
  .steps, .pillars { grid-template-columns: 1fr; }
  .pp { grid-template-columns: 1fr; }
  .pp-gallery { position: static; }
  .other-box { grid-template-columns: 96px 1fr; }
  .other-box .btn { grid-column: span 2; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .photo:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 10; }
}
@media (max-width: 720px) {
  .products, .perks { grid-template-columns: 1fr; }
  .ratio-wide { aspect-ratio: 4 / 3; }
  .header-inner { height: 78px; }
  .header .brand img { width: 44px; height: 49px; }
  .header .brand-name span { font-size: 1.3rem; }
  .header .brand-name strong { font-size: 1.5rem; }
  .cart-btn .cart-label { display: none; }
  .cart-btn { padding: 0 7px; }
}
