/* Le meilleur du canapé – feuille de style commune */
:root {
  --cream: #f7f1e8;
  --cream-2: #efe5d6;
  --paper: #fffdf9;
  --ink: #2e2620;
  --ink-soft: #6d6158;
  --line: #e4d8c6;
  --terracotta: #b85c38;
  --terracotta-dark: #96462a;
  --sage: #6f8a68;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 8px 24px rgba(60, 40, 20, 0.07);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--terracotta-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.hidden { display: none !important; }

/* ---------- Bandeau mode démo ---------- */
.demo-banner {
  background: var(--ink);
  color: #f3e7d6;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  letter-spacing: 0.02em;
}
.demo-banner strong { color: #f0b48f; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 241, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 72px; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.01em; }
.brand em { font-style: italic; color: var(--terracotta); }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent; border-radius: 999px;
  padding: 0.75rem 1.4rem; font: 500 0.95rem var(--sans);
  cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-primary:disabled { background: #cfa48f; cursor: wait; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-small { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.cart-btn { position: relative; }
.cart-count {
  min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; border-radius: 999px;
  background: var(--paper); color: var(--terracotta-dark); font-size: 0.78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero .container { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34rem; margin: 0 0 2rem; }
.hero .eyebrow, .eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; color: var(--terracotta); font-weight: 600; margin-bottom: 1rem; }
.hero-visual { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: var(--cream-2); }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.perks { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 2.5rem; color: var(--ink-soft); font-size: 0.9rem; }
.perks div::before { content: '✦'; color: var(--terracotta); margin-right: 0.5rem; }

/* ---------- Catalogue ---------- */
.section { padding: 3rem 0 5rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.75rem; }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(60,40,20,.06), 0 16px 32px rgba(60,40,20,.10); }
.card-media { display: block; aspect-ratio: 4 / 3; background: var(--cream-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 1.2rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card-title { font-family: var(--serif); font-size: 1.2rem; text-decoration: none; color: var(--ink); }
.card-title:hover { color: var(--terracotta-dark); }
.card-meta { font-size: 0.82rem; color: var(--ink-soft); }
.card-desc { font-size: 0.9rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.8rem; }
.price { font-family: var(--serif); font-size: 1.3rem; }

.skeleton { background: linear-gradient(90deg, var(--cream-2) 25%, #f4ebdf 50%, var(--cream-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); min-height: 340px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Messages ---------- */
.alert { border-radius: 10px; padding: 0.9rem 1.1rem; font-size: 0.95rem; }
.alert-error { background: #fbe9e6; color: var(--danger); border: 1px solid #f2c7c0; }
.alert-warn { background: #fff4e0; color: #8a5a00; border: 1px solid #f1d9a8; }
.alert-ok { background: #ecf3e8; color: #3d5b36; border: 1px solid #cfe0c8; }

/* ---------- Tiroir panier ---------- */
.overlay { position: fixed; inset: 0; background: rgba(46, 38, 32, 0.4); z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); z-index: 50;
  background: var(--paper); box-shadow: -10px 0 40px rgba(0,0,0,.12);
  transform: translateX(100%); transition: transform 0.3s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.5rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer-foot { border-top: 1px solid var(--line); padding: 1.25rem 1.5rem; }
.icon-btn { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft); padding: 0.25rem 0.5rem; }
.icon-btn:hover { color: var(--ink); }

.cart-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 1rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--cream-2); }
.cart-line .name { font-family: var(--serif); font-size: 1.02rem; }
.cart-line .remove { background: none; border: 0; color: var(--ink-soft); font-size: 0.8rem; cursor: pointer; padding: 0; text-decoration: underline; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.total-row .price { font-size: 1.6rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.qty button { background: none; border: 0; width: 2.1rem; height: 2.1rem; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--cream); }
.qty input { width: 2.4rem; text-align: center; border: 0; font: inherit; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Formulaire ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.3rem; }
.field label .req { color: var(--terracotta); }
.field input {
  width: 100%; font: inherit; padding: 0.7rem 0.85rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.field input:focus { outline: 2px solid rgba(184, 92, 56, 0.25); border-color: var(--terracotta); }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0 0.25rem; flex-wrap: wrap; }
.back-link { background: none; border: 0; color: var(--ink-soft); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* ---------- Confirmation ---------- */
.confirm-head { text-align: center; padding: 0.5rem 0 1.25rem; }
.confirm-check { width: 64px; height: 64px; border-radius: 50%; background: #e3eedf; color: var(--sage); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 1rem; }
.steps { list-style: none; padding: 0; margin: 1rem 0; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px dashed var(--line); opacity: 0; transform: translateY(6px); animation: stepIn 0.4s forwards; }
.steps li .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; font-size: 0.8rem; margin-top: 2px; }
.steps li .label { font-weight: 600; }
.steps li .detail { font-size: 0.88rem; color: var(--ink-soft); }
@keyframes stepIn { to { opacity: 1; transform: none; } }

/* ---------- Page produit ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin: 2rem 0 1.5rem; }
.breadcrumb a { color: var(--ink-soft); }
.product { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); padding-bottom: 5rem; align-items: start; }
.gallery-main { border-radius: 20px; overflow: hidden; background: var(--cream-2); aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 0.75rem; margin-top: 0.9rem; flex-wrap: wrap; }
.thumbs button { width: 92px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--cream-2); }
.thumbs button.active { border-color: var(--terracotta); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info .price { font-size: 2rem; margin: 0.3rem 0 1.2rem; }
.product-info .sku { font-size: 0.85rem; color: var(--ink-soft); }
.product-info .desc { white-space: pre-line; color: var(--ink-soft); margin-bottom: 1.8rem; }
.buy-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.specs { margin-top: 2.2rem; background: var(--paper); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow); }
.specs h3 { margin-bottom: 0.7rem; }
.specs dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.5rem; margin: 0; }
.specs dt { color: var(--ink-soft); font-size: 0.92rem; }
.specs dd { margin: 0; font-size: 0.95rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 20px); z-index: 60;
  background: var(--ink); color: #fff; padding: 0.8rem 1.3rem; border-radius: 999px; font-size: 0.92rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--ink-soft); font-size: 0.85rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .container, .product { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .nav .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .brand span { font-size: 1.1rem; }
  .site-header .container { height: 64px; }
}
