:root {
  --ink: #0f1b2d;
  --ink-2: #4a5568;
  --muted: #8a94a6;
  --line: #e7e3da;
  --bg: #faf8f4;
  --card: #ffffff;
  --gold: #b8924a;
  --gold-soft: #f3ead7;
  --sale: #b3261e;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
button, select, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- En-tête ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(250, 248, 244, .92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1400px; margin: 0 auto; padding: 14px 24px 10px; display: flex; gap: 24px; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo svg { width: 46px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2.4; }
.logo span { font: 600 26px/1 var(--serif); letter-spacing: .02em; }
.logo b { font-weight: 600; }
.search { flex: 1; max-width: 520px; margin-left: auto; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; height: 44px; }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; height: 100%; }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.tabs { max-width: 1400px; margin: 0 auto; padding: 0 24px 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid transparent; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--ink); color: #fff; }

/* ---------- Bandeau ---------- */
.hero { max-width: 1400px; margin: 0 auto; padding: 48px 24px 24px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.hero h1 { margin: 0; font: 600 clamp(32px, 5vw, 56px)/1.05 var(--serif); letter-spacing: -.01em; }
.hero .sub { margin: 14px 0 0; color: var(--ink-2); font-size: 16px; }

/* ---------- Barre d'outils ---------- */
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px 40px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 0 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters select { height: 42px; padding: 0 36px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a94a6' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; appearance: none; cursor: pointer; max-width: 240px; }
.filters select:focus { outline: 0; border-color: var(--gold); }
.result { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Grille ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; text-align: left; padding: 0; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(15, 27, 45, .35); }
.card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pic { position: relative; aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; padding: 18px; }
.pic img { width: 100%; height: 100%; object-fit: contain; transition: opacity .35s; }
.pic img.alt { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); opacity: 0; }
@media (hover: hover) { .card:hover .pic img.alt { opacity: 1; } .card:hover .pic img.alt + img { opacity: 0; } }
.tag { position: absolute; top: 12px; left: 12px; background: var(--sale); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.kind { position: absolute; top: 12px; right: 12px; background: var(--gold-soft); color: #7a5d22; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }
.info { padding: 14px 16px 16px; border-top: 1px solid #f1eee7; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.info .brand { font: 600 20px/1.15 var(--serif); }
.info .model { color: var(--ink-2); font-size: 13px; }
.price { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .now { font-weight: 600; font-size: 18px; }
.price s { color: var(--muted); font-size: 14px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }
#sentinel { height: 1px; }

/* ---------- Pied de page ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 24px 40px; text-align: center; color: var(--ink-2); font-size: 14px; }
.foot .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- Fiche produit ---------- */
dialog { border: 0; padding: 0; border-radius: 20px; width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: #fff; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(15, 27, 45, .5); }
dialog::backdrop { background: rgba(15, 27, 45, .55); backdrop-filter: blur(3px); }
.close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #f3f1ec; font-size: 26px; line-height: 1; cursor: pointer; }
.m-body { display: grid; grid-template-columns: 1.3fr 1fr; }
.m-gallery { padding: 28px; border-right: 1px solid #f1eee7; }
.m-main { aspect-ratio: 4 / 3; display: grid; place-items: center; touch-action: pan-y; }
.m-main img { width: 100%; height: 100%; object-fit: contain; }
.m-thumbs { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.m-thumbs button { width: 84px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; cursor: pointer; }
.m-thumbs button.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.m-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.m-info { padding: 40px 32px 32px; display: flex; flex-direction: column; }
.m-type { margin: 0; color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.m-info h2 { margin: 6px 0 0; font: 600 40px/1.05 var(--serif); }
.m-model { margin: 6px 0 0; color: var(--ink-2); }
.m-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 24px 0; padding: 18px 0; border-top: 1px solid #f1eee7; border-bottom: 1px solid #f1eee7; }
.m-price .now { font-size: 32px; font-weight: 600; }
.m-price s { color: var(--muted); font-size: 18px; }
.badge { background: var(--sale); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.badge:empty { display: none; }
.m-note { margin: auto 0 0; padding-top: 24px; color: var(--muted); font-size: 13px; }

/* ---------- Tablette / mobile ---------- */
@media (max-width: 900px) {
  .m-body { grid-template-columns: 1fr; }
  .m-gallery { border-right: 0; border-bottom: 1px solid #f1eee7; padding: 20px; }
  .m-info { padding: 24px; }
  .m-info h2 { font-size: 32px; }
}
@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; gap: 10px; padding: 12px 16px 8px; }
  .search { max-width: none; flex-basis: 100%; }
  .tabs, .hero, .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 28px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pic { padding: 10px; }
  .pic img.alt { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
  .info { padding: 10px 12px 12px; }
  .info .brand { font-size: 17px; }
  .price .now { font-size: 16px; }
  .filters { width: 100%; }
  .filters select { flex: 1 1 140px; max-width: none; }
}

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #1c2d47; }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 9px; font-size: 14px; }
.btn.danger { background: var(--sale); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.form .link { align-self: center; padding: 4px; }

/* ---------- En-tête : compte + panier ---------- */
.top-actions { display: flex; gap: 6px; flex: none; }
.icon-btn { position: relative; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; max-width: 220px; }
.icon-btn:hover { border-color: var(--gold); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#account-label { overflow: hidden; text-overflow: ellipsis; }
.count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }

/* ---------- Quantité ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; height: 48px; background: #fff; }
.qty button { width: 44px; height: 100%; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink); }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }
.qty.small { height: 34px; border-radius: 9px; }
.qty.small button { width: 32px; font-size: 16px; }
.m-buy { display: flex; gap: 10px; margin-top: 24px; }
.m-buy .btn { flex: 1; }

/* ---------- Message « ajouté » ---------- */
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px -20px rgba(15, 27, 45, .45); }
.toast p { margin: 0 0 12px; font-weight: 500; }
.toast-actions { display: flex; gap: 8px; }
.toast-actions .btn { flex: 1; height: 44px; padding: 0 12px; font-size: 14px; }

/* ---------- Tiroirs (panier, compte) ---------- */
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); border-radius: 0; display: none; flex-direction: column; }
dialog.drawer[open] { display: flex; }
.d-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #f1eee7; }
.d-head h2 { margin: 0; font: 600 28px/1.1 var(--serif); }
.d-head .close { position: static; }
.d-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.d-foot { border-top: 1px solid #f1eee7; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.d-foot .m-note { margin: 0; padding: 0; text-align: center; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.total b { font-size: 22px; }

.line { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f1eee7; }
.line img { width: 76px; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border: 1px solid #f1eee7; border-radius: 8px; }
.line-info { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-2); min-width: 0; }
button.line-info { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-size: 13px; text-align: left; align-items: flex-start; cursor: pointer; }
.line img[data-view] { cursor: pointer; }
button.line-info:hover b, button.line-info:focus-visible b { text-decoration: underline; text-underline-offset: 3px; }
.line-info b { font: 600 17px/1.2 var(--serif); color: var(--ink); }
.line-price { color: var(--ink); font-weight: 600; margin-top: 2px; }
.line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.empty-cart { text-align: center; color: var(--muted); padding: 60px 0; }
.done { text-align: center; padding: 40px 0; }
.done .check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #e6f4ea; color: #1e7b3c; font-size: 32px; display: grid; place-items: center; }
.done h3 { font: 600 26px/1.2 var(--serif); margin: 0 0 8px; }
.done p { color: var(--ink-2); }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input, .field textarea { height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; color: var(--ink); }
.field textarea { height: auto; padding: 10px 14px; resize: vertical; font: inherit; font-size: 16px; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: var(--sale); font-size: 14px; }
.form-msg.ok { background: #e6f4ea; color: #1e7b3c; }
.form-msg.info { background: var(--gold-soft); color: #7a5d22; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.seg { display: flex; background: #f3f1ec; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: none; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }

/* ---------- Compte & commandes ---------- */
.profile { padding-bottom: 16px; border-bottom: 1px solid #f1eee7; }
.profile p { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f3f1ec; color: var(--ink-2); }
.pill.ok, .pill.s-livrée { background: #e6f4ea; color: #1e7b3c; }
.pill.wait, .pill.s-nouvelle { background: var(--gold-soft); color: #7a5d22; }
.pill.s-confirmée { background: #e8eefb; color: #2848a8; }
.pill.no, .pill.s-annulée { background: #fdecea; color: var(--sale); }
.h3 { font: 600 22px/1.2 var(--serif); margin: 20px 0 8px; }
.order { padding: 12px 0; border-bottom: 1px solid #f1eee7; }
.order-head { display: flex; justify-content: space-between; align-items: center; }
.order-items { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.order-confirm { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fdecea; font-size: 14px; }
.order-confirm > p:first-child { margin: 0; font-weight: 600; color: var(--sale); }
.order-confirm .form-msg { margin-top: 8px; background: #fff; }
.order > .form-msg { margin-top: 10px; }
.edit-banner { margin-bottom: 8px; padding: 12px 14px; border-radius: 10px; background: var(--gold-soft); color: #7a5d22; font-size: 14px; }
.edit-banner p { margin: 0 0 6px; }
.edit-banner .muted { color: #7a5d22; opacity: .8; }
#orders + .btn { margin-top: 20px; }

@media (max-width: 640px) {
  .top-actions { margin-left: auto; order: 2; }
  .search { order: 3; }
  .icon-btn { padding: 0 11px; }
  #account-label { display: none; }
  .logo span { font-size: 22px; }
}

/* ---------- Menu homme / femme / enfant ---------- */
.menu-btn { padding: 0; width: 44px; justify-content: center; flex: none; }
.menu-btn svg { stroke-width: 2; }
dialog.drawer.left { margin: 0 auto 0 0; width: min(380px, 100vw); }
#menu .d-body { padding: 8px 0; }
.g { border-bottom: 1px solid #f1eee7; }
.g-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px 20px; border: 0; background: none; cursor: pointer; text-align: left; }
.g-head span { flex: 1; font: 600 24px/1.1 var(--serif); }
.g-head small { color: var(--muted); font-size: 13px; }
.g-head svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2; transition: transform .2s; }
.g.on .g-head span { color: var(--gold); }
.g.open .g-head svg { transform: rotate(90deg); }
.g-body { display: none; padding: 0 20px 14px; }
.g.open .g-body { display: block; }
.g-search { width: 100%; height: 40px; margin-bottom: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.g-search:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.check { display: flex; align-items: center; gap: 12px; padding: 9px 4px; cursor: pointer; border-radius: 8px; }
.check:hover { background: #faf8f4; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; cursor: pointer; }
.check span { flex: 1; }
.check small { color: var(--muted); font-size: 12px; }
.check.all { font-weight: 600; border-bottom: 1px solid #f1eee7; border-radius: 8px 8px 0 0; margin-bottom: 4px; }

.chip { margin-right: auto; display: flex; align-items: center; height: 36px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; overflow: hidden; }
.chip button { height: 100%; border: 0; background: none; color: inherit; cursor: pointer; }
#chip-open { padding: 0 6px 0 14px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chip-clear { padding: 0 12px 0 6px; font-size: 18px; line-height: 1; }
@media (max-width: 420px) { .logo svg { display: none; } }
