/* =========================================================
   Maquette boutique — style moderne, épuré, responsive
   ========================================================= */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #23201d;
  --muted: #8b857e;
  --line: #eae5df;
  --accent: #1e1e1e;
  --accent-soft: #f0ece6;
  --ok: #3f9d6d;
  --low: #d9a441;
  --out: #c05c5c;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(40, 33, 26, 0.08);
  --font-title: "Georgia", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Bandeau démonstration ---------- */
.demo-banner {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 6px 12px;
  text-transform: uppercase;
  opacity: 0.92;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-title);
  font-size: 22px;
  letter-spacing: 0.02em;
}
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.header-nav { display: flex; gap: 20px; font-size: 14px; color: var(--muted); }
.header-nav a.active, .header-nav a:hover { color: var(--ink); }

.cart-button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .15s;
}
.cart-button:hover { border-color: var(--ink); }
.cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 30px;
  margin: 0 0 4px;
}
.page-head p { color: var(--muted); margin: 0; }

/* ---------- Toolbar / toggle ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 26px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar .hint { font-size: 13px; color: var(--muted); max-width: 520px; }

.toggle {
  display: inline-flex;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.toggle button {
  border: 0;
  background: transparent;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  transition: all .15s;
}
.toggle button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ---------- Grille produits ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #eee;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
  backdrop-filter: blur(3px);
}
.badge.ok  { background: rgba(63,157,109,.15); color: #2c7a53; }
.badge.low { background: rgba(217,164,65,.2); color: #9a6f18; }
.badge.out { background: rgba(192,92,92,.18); color: #9c3b3b; }

.badge.variant-tag {
  position: static;
  display: inline-block;
  background: var(--accent-soft);
  color: var(--muted);
  margin-top: 8px;
}

.card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.card-title { font-family: var(--font-title); font-size: 17px; line-height: 1.3; margin: 0; }
.card-variant-line { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
  flex: none;
}
.swatch.lg { width: 34px; height: 34px; }

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
}
.price { font-size: 16px; font-weight: 600; }
.price .from { font-size: 12px; font-weight: 400; color: var(--muted); margin-right: 3px; }

/* count of variants pill (mode grouped) */
.variant-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.variant-pills .swatch { cursor: default; }

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.block { width: 100%; padding: 14px; font-size: 15px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-mini {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
}
.btn-mini:hover:not(:disabled) { border-color: var(--ink); }
.btn-mini:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Fiche produit ---------- */
.pdp {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 46px;
  align-items: start;
}
.gallery-main {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eee;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumbs button {
  width: 66px; height: 82px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; padding: 0; cursor: pointer; background: none;
}
.gallery-thumbs button.active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pdp-info h1 { font-family: var(--font-title); font-weight: 500; font-size: 30px; margin: 6px 0 8px; }
.pdp-cat { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.pdp-price { font-size: 26px; font-weight: 600; margin: 12px 0 4px; }
.pdp-desc { color: #5b544d; margin: 14px 0 22px; }

.selector { margin-bottom: 20px; }
.selector .label { font-size: 13px; font-weight: 600; margin-bottom: 9px; display: flex; gap: 8px; }
.selector .label span { font-weight: 400; color: var(--muted); }

.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatches button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; position: relative; padding: 0;
  outline: 1px solid rgba(0,0,0,.12); outline-offset: -1px;
}
.swatches button.active { border-color: var(--accent); }
.swatches button[disabled] { cursor: not-allowed; opacity: .35; }
.swatches button[disabled]::after {
  content: ""; position: absolute; inset: 45% 10% auto 10%;
  height: 2px; background: rgba(0,0,0,.5); transform: rotate(-45deg);
}

.sizes { display: flex; gap: 10px; flex-wrap: wrap; }
.sizes button {
  min-width: 52px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 14px;
}
.sizes button.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.sizes button[disabled] { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.stock-line { font-size: 14px; margin: 4px 0 20px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.low { background: var(--low); }
.dot.out { background: var(--out); }

.back-link { font-size: 14px; color: var(--muted); display: inline-block; margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }

/* ---------- Mini-panier latéral ---------- */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(30,25,20,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 40;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: 400px; max-width: 100%;
  background: var(--surface);
  box-shadow: -10px 0 40px rgba(0,0,0,.12);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 50;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
  padding: 20px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-head h2 { font-family: var(--font-title); font-weight: 500; font-size: 20px; margin: 0; }
.cart-close { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.cart-close:hover { color: var(--ink); }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 22px; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 60px; font-size: 15px; }

.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item .ci-thumb { width: 60px; height: 74px; border-radius: 8px; overflow: hidden; flex: none; }
.cart-item .ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ci-main { flex: 1; min-width: 0; }
.ci-name { font-size: 14px; font-weight: 600; }
.ci-variant { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 3px 0 8px; }
.ci-controls { display: flex; align-items: center; gap: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; }
.qty button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--ink); }
.qty button:hover { background: var(--accent-soft); }
.qty span { min-width: 26px; text-align: center; font-size: 14px; }
.ci-price { font-size: 14px; font-weight: 600; }
.ci-remove { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; margin-left: auto; }
.ci-remove:hover { color: var(--out); }

.cart-foot { border-top: 1px solid var(--line); padding: 18px 22px 24px; }
.cart-total { display: flex; justify-content: space-between; font-size: 17px; margin-bottom: 14px; }
.cart-total strong { font-weight: 600; }
.cart-note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .pdp { grid-template-columns: 1fr; gap: 26px; }
  .header-nav { display: none; }
  .cart-drawer { width: 100%; }   /* panier plein écran sur mobile */
  .page-head h1 { font-size: 25px; }
}
@media (max-width: 460px) {
  .grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toggle { justify-content: center; }
}
