/* SolMarket : place de marché publique. Mêmes couleurs que la page de paiement. */
:root {
  --nuit-deep: #0F2A5F; --ink: #0F1E3D; --muted: #4A5670; --line: #DCE0E8; --paper: #ffffff; --bg: #FAFAF7;
  --nuit: #0F2A5F; --nuit-dark: #0A1F47; --sol-text: #8A5A00; --sol: #F5B000; --sol-soft: #FFF4D6;
  --ok: #1E7F4F; --ok-soft: #e7f5ec; --bad: #C0392B; --bad-soft: #fdecec;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--nuit); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; }

/* En-tête */
.top { background: var(--nuit-deep); color: #fff; position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.brand span { font-weight: 700; font-size: 17px; padding-left: 10px; border-left: 1px solid #24407A; color: var(--sol); }
.search { flex: 1; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 0 14px; height: 44px; color: var(--muted); max-width: 640px; }
.search svg { width: 20px; height: 20px; flex: none; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; height: 100%; color: var(--ink); background: transparent; }
.cart-btn { margin-left: auto; display: flex; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1px solid #24407A; border-radius: 12px; height: 44px; padding: 0 14px; cursor: pointer; flex: none; }
.cart-btn svg { width: 22px; height: 22px; }
.cart-btn .count { background: var(--sol); color: var(--nuit-deep); border-radius: 99px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12.5px; padding: 0 6px; }
.testband { background: repeating-linear-gradient(-45deg, #F5B000 0 14px, #e3c45a 14px 28px); color: var(--nuit-deep); text-align: center; font-weight: 700; font-size: 13px; padding: 5px 12px; }
@media (max-width: 700px) {
  .bar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .cart-btn span { display: none; }
  .brand img { width: 100px; height: auto; }
}

/* Introduction */
.intro { padding: 32px 0 8px; }
.intro h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.12; margin: 0 0 8px; letter-spacing: -.01em; max-width: 20ch; }
.intro p { margin: 0; color: var(--muted); max-width: 60ch; }
.trust { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; font-weight: 600; }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust svg { width: 18px; height: 18px; color: var(--ok); }

/* Catégories */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: thin; }
.cats button { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 8px 14px; cursor: pointer; font-size: 14.5px; white-space: nowrap; }
.cats button[aria-pressed="true"] { background: var(--nuit-deep); color: #fff; border-color: var(--nuit-deep); }
.cats button span { color: var(--muted); margin-left: 4px; font-size: 13px; }
.cats button[aria-pressed="true"] span { color: #A6B0C3; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.toolbar p { margin: 0; }
.filters { display: flex; gap: 8px; }
.filters select { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 10px; }
.storebar { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.storebar .btn { margin-left: auto; }

/* Grille de produits */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: #cfc8b6; }
.card .img { aspect-ratio: 1; background: #efebe1; display: grid; place-items: center; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .img .ph { font-size: 40px; font-weight: 800; color: #c9c1ad; }
.card .body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .name { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { font-weight: 800; font-size: 18px; }
.card .vend { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.card .vend .nm { display: flex; align-items: center; gap: 4px; min-width: 0; }
.card .vend b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .vend .city { padding-left: 19px; }
.ok-ic { width: 15px; height: 15px; color: var(--ok); flex: none; }
.skel { background: linear-gradient(90deg, #ece7db, #f4f0e7, #ece7db); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 16px; aspect-ratio: .78; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.empty { text-align: center; padding: 48px 16px; }
.empty h2 { margin: 0 0 4px; }
.pager { display: flex; justify-content: center; gap: 8px; margin: 24px 0 8px; }
.notice { margin-top: 18px; border-radius: 14px; padding: 14px 16px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.notice.warn { background: var(--sol-soft); color: #7a5600; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--nuit); color: #fff; border: 2px solid var(--nuit); border-radius: 12px; padding: 11px 18px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--nuit-dark); border-color: var(--nuit-dark); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }

/* Fenêtres */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(920px, calc(100% - 24px)); max-height: calc(100% - 32px); background: var(--paper); color: var(--ink); }
.dlg::backdrop { background: rgba(15,30,61,.55); }
.dlg .x { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; }
.dlg.narrow { width: min(460px, calc(100% - 24px)); padding: 24px; }
.dlg.side { margin: 0 0 0 auto; height: 100%; max-height: 100%; border-radius: 20px 0 0 20px; width: min(460px, 100%); padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.dlg h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; }
.dlg label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 5px; }
.dlg input, .dlg select, .dlg textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.dlg form .btn { margin-top: 16px; width: 100%; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.pd { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .pd { grid-template-columns: 1fr; } }
.pimg { background: #efebe1; min-height: 320px; position: relative; }
.pimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 760px) { .pimg { min-height: 0; aspect-ratio: 1; } }
.pinfo { padding: 24px 22px; display: flex; flex-direction: column; gap: 6px; }
.pinfo .cat { margin: 0; color: var(--muted); font-size: 13.5px; }
.pinfo .price { font-size: 26px; font-weight: 800; margin: 0; }
.pinfo .desc { white-space: pre-line; margin: 4px 0 6px; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty label { margin: 0 !important; }
.qty input { width: 90px !important; }
.seller { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14.5px; }
.seller .who { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.seller .logo { width: 40px; height: 40px; border-radius: 10px; background: var(--nuit); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.seller .logo img { width: 100%; height: 100%; object-fit: cover; }
.seller dl { margin: 8px 0 0; display: grid; gap: 8px; }
.seller dt { font-weight: 700; font-size: 13.5px; }
.seller dd { margin: 0; color: var(--muted); white-space: pre-line; }
.verified { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 13px; font-weight: 600; }

/* Panier */
.group { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 14px; }
.group h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.line { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.line:first-of-type { border-top: 0; }
.line .th { width: 52px; height: 52px; border-radius: 10px; background: #efebe1; overflow: hidden; }
.line .th img { width: 100%; height: 100%; object-fit: cover; }
.line .nm { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.line .q { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.line .q button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.line .amt { font-weight: 700; white-space: nowrap; }
.total { display: flex; justify-content: space-between; font-weight: 800; font-size: 17px; margin: 10px 0; }
.ship label { margin-top: 8px; }
.cart-empty { text-align: center; padding: 40px 0; color: var(--muted); }

.foot { margin-top: 48px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 6px; max-width: 70ch; }

/* ---------- v15 : boutons d'en-tête ---------- */
.top-btn { display: flex; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1px solid #24407A; border-radius: 12px; height: 44px; padding: 0 14px; cursor: pointer; flex: none; white-space: nowrap; }
.top-btn svg { width: 20px; height: 20px; }
.top-btn.gold { background: var(--sol); color: var(--nuit-deep); border-color: var(--sol); font-weight: 700; }
.top-btn .count, .cart-btn .count { background: var(--nuit); color: #fff; }
#acct-btn { margin-left: auto; }
#acct-btn + .cart-btn { margin-left: 0; }
.top-btn .count { border-radius: 99px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12.5px; padding: 0 6px; }
@media (max-width: 1000px) { #acct-label { display: none; } }
@media (max-width: 700px) { .top-btn.gold { order: 4; flex: 1; justify-content: center; height: 40px; } }

/* ---------- Cartes : prix de gros ---------- */
.card .moq { font-size: 12.5px; color: var(--muted); }
.card .price small { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Fiche : paliers ---------- */
.tiers:empty { display: none; }
.tiers .moq { margin: 4px 0 8px; font-weight: 700; }
.tiers table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14.5px; }
.tiers td { padding: 8px 12px; border-top: 1px solid var(--line); }
.tiers tr:first-child td { border-top: 0; }
.tiers tr.on { background: var(--sol-soft); font-weight: 700; }
.tiers td:last-child { text-align: right; }
.ptotal { font-weight: 700; margin: 2px 0; }
.pbtns { display: grid; gap: 8px; margin-top: 4px; }

/* ---------- Page fournisseur ---------- */
.supplier { margin: 24px 0 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.supplier .head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.supplier .logo { width: 72px; height: 72px; border-radius: 16px; background: var(--nuit); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; overflow: hidden; flex: none; }
.supplier .logo img { width: 100%; height: 100%; object-fit: cover; }
.supplier h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.supplier .head .btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0 4px; }
.facts div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.supplier .about { white-space: pre-line; max-width: 75ch; }

/* ---------- Compte acheteur ---------- */
.tabs { display: flex; gap: 6px; margin: 12px 0 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px; cursor: pointer; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--nuit-deep); color: #fff; border-color: var(--nuit-deep); }
.tabs .count { background: var(--nuit); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 12px; margin-left: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rfq { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.rfq h3 { margin: 0; font-size: 16px; }
.rfq .meta { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.quote { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.quote .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.quote .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.quote .acts .btn { padding: 7px 12px; font-size: 14px; }
.tag { display: inline-block; border-radius: 99px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; background: var(--sol-soft); color: #7a5600; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.off { background: #eee; color: var(--muted); }
.convs button { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.convs .top { display: flex; justify-content: space-between; gap: 8px; }
.convs .last { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; max-height: 50vh; overflow-y: auto; }
.thread .m { max-width: 85%; }
.thread .m.mine { align-self: flex-end; text-align: right; }
.thread .b { display: inline-block; text-align: left; background: #f1eee6; border-radius: 14px; padding: 9px 12px; white-space: pre-line; }
.thread .m.mine .b { background: var(--nuit-deep); color: #fff; }
.thread .w { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.safe { background: var(--sol-soft); color: #5e4300; border-radius: 10px; padding: 9px 12px; font-size: 13px; }

.card .unit { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
/* SolDelivery : choix du mode et code de remise (mêmes règles que la page de paiement) */
.dlv { margin: 14px 0 4px; }
.dlv-title { font-weight: 700; margin: 0 0 8px; }
.dlv-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.dlv-opt:has(input:checked) { border-color: var(--nuit); background: #fdf2f4; }
.dlv-txt { flex: 1; display: flex; flex-direction: column; }
.dlv-txt small { color: var(--muted); }
.dlv-fee { font-weight: 700; white-space: nowrap; }
.dlv-code { margin-top: 16px; border: 2px dashed var(--sol-text); border-radius: 14px; padding: 14px; text-align: center; background: var(--sol-soft); }
.dlv-code p { margin: 0 0 6px; }
.dlv-code .code { font-size: 34px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.dlv-code .small { font-size: 13px; color: var(--muted); }
.notice .dlv-code { color: var(--ink); font-weight: 400; }
/* Choix de livraison dans le panier : les règles génériques des champs du panneau ne s'appliquent pas aux boutons radio. */
.dlg .dlv-opt { display: flex; margin: 0 0 8px; font-weight: 400; }
.dlg .dlv-opt input { width: auto; flex: none; padding: 0; margin: 0; border: 0; accent-color: var(--nuit); }
