:root { --accent:#7A1F3D; --accent-dark:#5f1730; --tint:#f7ecef; --bg:#fff; --line:#eee; --muted:#777; }
* { box-sizing:border-box; }
body { margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif; background:#f6f6f6; color:#222; }
button { font-family:inherit; }
#app { max-width:640px; margin:0 auto; background:var(--bg); min-height:100vh; }

/* Zone 1 */
#searchbar { position:sticky; top:0; z-index:12; height:56px; margin-bottom:-56px; padding:9px 12px; transition:background .25s, box-shadow .25s; }
#searchbar { display:flex; align-items:center; gap:8px; }
#search { flex:1; min-width:0; width:auto; }
#searchbar.solid { background:var(--bg); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.top { position:relative; height:176px; padding-top:56px; display:flex; align-items:center; justify-content:center; background:#2a1a20 url(background.jpg) center 58%/cover no-repeat; }
.logo { position:relative; display:flex; justify-content:center; align-items:center; padding:0 12px; }
.logo img { max-height:84px; max-width:75%; object-fit:contain; filter:drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.logo span { font-family:Forte,'Lobster',cursive; font-size:46px; font-weight:400; letter-spacing:1px; color:#7A1F3D; text-shadow:0 0 12px #fff,0 0 6px #fff,0 0 3px #fff; }

/* Zone 2 : recherche + catégories (figées) */
.stick { position:sticky; top:56px; z-index:10; background:var(--bg); padding:0 10px 6px; border-bottom:1px solid var(--line); box-shadow:0 2px 6px rgba(0,0,0,.06); }
#search { width:100%; height:38px; padding:0 16px; border:1px solid #e2e2e2; border-radius:24px; font-size:16px; background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.18); outline:none; }
#search:focus { border-color:var(--accent); }
.tabs-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:4px 6px; padding-top:8px; }
.tab { display:flex; flex-direction:column; align-items:center; gap:3px; background:none; border:0; padding:3px 2px; cursor:pointer; color:#444; font-size:10.5px; line-height:1.15; text-align:center; border-radius:12px; }
.tab img, .tab .plus { width:46px; height:46px; border-radius:13px; object-fit:cover; background:var(--tint); border:2px solid transparent; }
.tab .plus { display:flex; align-items:center; justify-content:center; color:var(--accent); font-size:26px; font-weight:300; }
.tab .l { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.3em; }
.tab.active { color:var(--accent); font-weight:600; }
.tab.active img { border-color:var(--accent); }
.cats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px 10px; padding:18px 14px 60px; }
.cats-grid .tab { font-size:13px; }
.cats-grid .tab img { width:min(26vw,96px); height:min(26vw,96px); border-radius:20px; }

/* Grilles et cartes produit */
.grid2 { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; padding:10px; }
.card { display:flex; flex-direction:column; text-decoration:none; color:inherit; background:#fff; border:1px solid var(--line); border-radius:8px; overflow:hidden; font:inherit; text-align:left; padding:0; cursor:pointer; }
.card img { width:100%; aspect-ratio:1/1; object-fit:cover; background:#eee; display:block; }
.card .n { padding:5px 8px 0; font-size:14px; line-height:1.25; height:2.7em; overflow:hidden; }
.card .p { padding:2px 8px 8px; font-size:15px; font-weight:700; color:var(--accent); }
.card .p .from { display:block; font-size:12px; font-weight:400; color:var(--muted); }
.card .p s { color:var(--muted); font-weight:400; font-size:11px; margin-left:4px; }
.empty { grid-column:1/-1; text-align:center; color:var(--muted); padding:28px 12px; font-size:14px; }
.empty.big { padding:80px 12px; font-size:16px; }
#sentinel { height:1px; }

/* Barre de chargement */
#loadbar { position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.88); transition:opacity .4s; }
#loadbar.done { opacity:0; pointer-events:none; }
.lb-box { width:min(86vw,420px); text-align:center; }
.lb-text { font-size:15px; color:var(--muted); margin-bottom:14px; }
.lb-track { height:16px; background:#e9e9e9; border-radius:8px; overflow:hidden; }
#loadfill { height:100%; width:0; background:var(--accent); border-radius:8px; transition:width .3s ease-out; }
#loadpct { margin-top:10px; font-size:20px; font-weight:700; color:var(--accent); }
.card.skel { min-height:120px; aspect-ratio:1/1.25; border:0; background:linear-gradient(90deg,#eee 25%,#f7f7f7 50%,#eee 75%); background-size:200% 100%; animation:shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position:200% 0; } to { background-position:-200% 0; } }

/* Pages plein écran */
.overlay { position:fixed; inset:0; z-index:50; background:var(--bg); overflow-y:auto; max-width:640px; margin:0 auto; }
.detail { z-index:60; }
.cartpage { z-index:55; }
.checkoutpage { z-index:90; }
.ov-head { position:sticky; top:0; display:flex; align-items:center; gap:10px; padding:10px 12px; background:var(--bg); border-bottom:1px solid var(--line); z-index:5; }
.ov-head button { border:0; background:#f0f0f0; width:36px; height:36px; border-radius:50%; font-size:18px; cursor:pointer; flex:0 0 auto; }
.ov-head h2 { margin:0; font-size:17px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Page produit : galerie glissante */
.gal { position:relative; background:#f3f3f3; }
.slides { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.slides::-webkit-scrollbar { display:none; }
.slides img { flex:0 0 100%; width:100%; aspect-ratio:1/1; object-fit:contain; scroll-snap-align:center; scroll-snap-stop:always; display:block; }
.nav { position:absolute; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; border-radius:50%; background:rgba(255,255,255,.85); font-size:22px; line-height:1; cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.2); }
.nav.prev { left:8px; } .nav.next { right:8px; }
.count { position:absolute; right:10px; bottom:10px; background:rgba(0,0,0,.55); color:#fff; font-size:12px; padding:3px 9px; border-radius:12px; }
.thumbs { display:flex; gap:6px; overflow-x:auto; padding:8px 10px 0; }
.thumbs img { width:62px; height:62px; object-fit:cover; border-radius:6px; border:2px solid transparent; cursor:pointer; flex:0 0 auto; opacity:.7; }
.thumbs img.on { border-color:var(--accent); opacity:1; }
.dinfo { padding:12px 14px 90px; }
.dinfo h1 { font-size:20px; margin:0 0 6px; }
.dprice { font-size:22px; font-weight:700; color:var(--accent); margin-bottom:12px; }
.dprice s { color:var(--muted); font-weight:400; font-size:14px; margin-left:8px; }
.opt { display:block; font-size:13px; color:var(--muted); margin-bottom:10px; }
.opt select { display:block; width:100%; margin-top:4px; padding:10px; font-size:16px; border:1px solid #ddd; border-radius:8px; background:#fff; }
.stock { color:#c0392b; font-weight:600; margin-bottom:8px; }
.buy { display:block; width:100%; text-align:center; background:var(--accent); color:#fff; border:0; text-decoration:none; padding:13px; border-radius:10px; font-weight:600; font-size:16px; margin:8px 0; cursor:pointer; }
.buy:hover { background:var(--accent-dark); }
.buy:disabled { background:#bbb; cursor:not-allowed; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:8px 0 16px; }
.btn2 { background:#fff; color:var(--accent); border:1.5px solid var(--accent); padding:11px; border-radius:10px; font-weight:600; font-size:15px; cursor:pointer; }
.row3 { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:8px 0 16px; }
.ibtn { display:flex; flex-direction:column; align-items:center; gap:5px; background:none; color:var(--accent); border:0; padding:8px 4px; font-weight:600; font-size:13px; cursor:pointer; }
.ibtn svg { width:24px; height:24px; fill:currentColor; }
.ibtn.wa svg { fill:#25D366; }
.sv { position:relative; }
.sv .x { position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%; border:0; background:rgba(255,255,255,.92); box-shadow:0 1px 4px rgba(0,0,0,.3); font-size:13px; cursor:pointer; }
.btn2.wide { display:block; width:100%; margin:8px 0; }
.btn2:hover { background:var(--tint); }
.link { background:none; border:0; color:var(--muted); text-decoration:underline; font-size:13px; cursor:pointer; display:block; margin:8px auto 0; }
.desc { font-size:14px; line-height:1.5; }
.desc p { margin:0 0 10px; }

/* Panier */
.ci { display:flex; gap:10px; padding:12px; border-bottom:1px solid var(--line); align-items:flex-start; }
.ci img { width:74px; height:74px; object-fit:cover; border-radius:8px; background:#eee; flex:0 0 auto; }
.cm { flex:1; min-width:0; }
.cn { font-size:14px; font-weight:600; }
.cl { font-size:12px; color:var(--muted); margin-top:2px; }
.cp { font-size:14px; font-weight:700; color:var(--accent); margin:4px 0; }
.qty { display:inline-flex; align-items:center; border:1px solid #ddd; border-radius:8px; overflow:hidden; }
.qty button { width:34px; height:32px; border:0; background:#f6f6f6; font-size:18px; cursor:pointer; }
.qty span { min-width:34px; text-align:center; font-weight:600; }
.rm { border:0; background:none; font-size:18px; color:#999; cursor:pointer; padding:4px 6px; }
.cart-foot { padding:14px 14px 60px; }
.tot { display:flex; justify-content:space-between; font-size:18px; margin-bottom:8px; }
.tot strong { color:var(--accent); }

/* Formulaire de commande */
.form { padding:12px 14px 60px; }
.form h3 { margin:14px 0 8px; font-size:16px; color:var(--accent); }
.form label { display:block; font-size:13px; color:var(--muted); margin-bottom:10px; }
.form input, .form textarea { display:block; width:100%; margin-top:4px; padding:10px; font-size:16px; font-family:inherit; border:1px solid #ddd; border-radius:8px; }
.form input:focus, .form textarea:focus { outline:none; border-color:var(--accent); }
.sum { font-size:13px; border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
.sum div { display:flex; justify-content:space-between; gap:10px; padding:3px 0; }
.sum .t { border-top:1px solid var(--line); margin-top:4px; padding-top:7px; font-weight:700; font-size:15px; }
.hint { font-size:12px; color:var(--muted); text-align:center; margin-top:10px; }

/* Bouton panier flottant + message */
#fab { position:fixed; z-index:70; bottom:calc(16px + env(safe-area-inset-bottom)); right:max(16px, calc(50vw - 304px)); width:56px; height:56px; border-radius:50%; border:0; background:#F57C00; color:#fff; font-size:24px; box-shadow:0 3px 10px rgba(0,0,0,.3); cursor:pointer; }
#fab[hidden] { display:none; }
#fabCount { position:absolute; top:-4px; right:-4px; min-width:22px; height:22px; padding:0 5px; border-radius:11px; background:#fff; color:#F57C00; border:2px solid #F57C00; font-size:12px; font-weight:700; line-height:18px; }
#fabCount[hidden] { display:none; }
#toast { position:fixed; z-index:300; left:50%; bottom:90px; transform:translateX(-50%) translateY(20px); background:#222; color:#fff; padding:10px 18px; border-radius:20px; font-size:14px; opacity:0; pointer-events:none; transition:.3s; }
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* Bottom navigation */
#app { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
.overlay.hasnav { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
#bottomnav { position:fixed; z-index:100; left:0; right:0; bottom:0; max-width:640px; margin:0 auto; display:flex; background:#fff; border-top:1px solid var(--line); box-shadow:0 -2px 8px rgba(0,0,0,.07); padding-bottom:env(safe-area-inset-bottom); }
#bottomnav button { flex:1; position:relative; display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 0 7px; background:none; border:0; color:#777; font-size:11px; cursor:pointer; }
#bottomnav svg { width:24px; height:24px; fill:currentColor; }
#bottomnav button.on { color:var(--accent); font-weight:600; }
#bottomnav i { position:absolute; top:3px; left:calc(50% + 6px); min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:#F57C00; color:#fff; font-size:10px; font-weight:700; font-style:normal; line-height:17px; text-align:center; }
#bottomnav i[hidden] { display:none; }

/* Every page leaves room for the bottom bar; search results start below the search bar */
.overlay { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
#overlay { top:56px; }

/* Points */
.dpts { display:flex; align-items:center; gap:6px; background:#fff4e5; color:#b45f00; border-radius:8px; padding:7px 10px; font-size:13px; margin:-4px 0 12px; }
.dpts svg { width:18px; height:18px; fill:#F57C00; flex:0 0 auto; }
.ptsbox { background:#fff4e5; border-radius:10px; padding:10px 12px; margin-bottom:12px; display:flex; flex-direction:column; gap:8px; font-size:14px; }
.mut { color:var(--muted); font-size:12px; }
.usep { border:0; background:#F57C00; color:#fff; padding:10px; border-radius:8px; font-weight:600; font-size:14px; cursor:pointer; }
.usep.on { background:#2e7d32; }
.subline { display:flex; justify-content:space-between; font-size:14px; color:var(--muted); margin-bottom:4px; }
.earn { font-size:13px; color:#b45f00; margin:-2px 0 10px; }

/* Account page */
.mehead { display:flex; align-items:center; gap:12px; padding:16px 14px 8px; }
.avatar { width:54px; height:54px; border-radius:50%; background:var(--accent); color:#fff; font-size:24px; font-weight:700; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.mname { font-size:18px; font-weight:700; }
.pcard { margin:8px 14px 14px; padding:16px; border-radius:14px; color:#fff; background:linear-gradient(135deg,var(--accent),#a8325a); }
.pcard .pl { font-size:13px; opacity:.85; }
.pcard .pn { display:flex; align-items:center; gap:8px; font-size:40px; font-weight:800; line-height:1.2; }
.pcard .pn svg { width:32px; height:32px; fill:#ffc266; }
.pcard .pv { font-size:14px; margin-top:2px; }
.pcard .pr { font-size:12px; opacity:.8; margin-top:8px; }
.mlist { margin:0 14px; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.mrow { display:flex; align-items:center; gap:12px; width:100%; padding:14px; background:#fff; border:0; border-bottom:1px solid var(--line); font-size:15px; cursor:pointer; text-align:left; }
.mrow:last-child { border-bottom:0; }
.mrow svg { width:22px; height:22px; fill:var(--accent); flex:0 0 auto; }
.mrow .ml { flex:1; }
.mrow .mr { color:var(--muted); font-size:13px; }
.mrow .chev { color:#bbb; font-size:20px; }
.dot { font-style:normal; background:#F57C00; color:#fff; font-size:11px; font-weight:700; min-width:18px; height:18px; line-height:18px; border-radius:9px; display:inline-block; text-align:center; padding:0 5px; }
.ord, .msg { margin:10px 14px 0; padding:12px; border:1px solid var(--line); border-radius:10px; font-size:14px; }
.oh, .mh { display:flex; justify-content:space-between; gap:10px; margin-bottom:4px; }
.msg .mh b { color:var(--accent); }
.msgfoot { padding:14px; }

/* Olive green main buttons, cart actions, payment page */
.buy.olive { background:#556B2F; }
.buy.olive:hover { background:#445625; }
.buy.olive:disabled { background:#aab59a; }
.buy.sm { padding:9px 14px; font-size:14px; width:auto; display:inline-block; margin:0; }
.row2i { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:6px 0 4px; }
.bank { border:1px solid #c9d3b6; background:#f4f7ec; border-radius:10px; padding:12px; font-size:14px; line-height:1.5; }
.bank p { margin:0 0 8px; }
.bank .bl { display:flex; justify-content:space-between; gap:10px; padding:5px 0; border-top:1px solid #dfe6d0; }
.bank .bl span:first-child { color:var(--muted); }
.bank .bl b { text-align:right; }
.copy { border:0; background:none; color:#556B2F; font-weight:700; text-decoration:underline; font-size:13px; cursor:pointer; margin-left:6px; }
.rbtn { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:13px; border:2px dashed #556B2F; border-radius:10px; background:#fff; color:#556B2F; font-weight:600; font-size:15px; cursor:pointer; }
.rbtn svg { width:22px; height:22px; fill:currentColor; }
.rcpt { display:block; max-width:100%; max-height:380px; margin:10px auto 0; border-radius:10px; border:1px solid var(--line); }
.okpage { text-align:center; padding:28px 18px 60px; }
.okicon { width:64px; height:64px; border-radius:50%; background:#556B2F; color:#fff; font-size:36px; line-height:64px; margin:0 auto 12px; }
.okpage h3 { margin:0 0 8px; font-size:20px; color:#556B2F; }
.okpage p { margin:0 0 14px; font-size:15px; line-height:1.5; }
.sc-actions { display:flex; align-items:center; justify-content:space-between; margin-top:10px; }
.thumbr { width:46px; height:46px; object-fit:cover; border-radius:6px; border:1px solid var(--line); }
.ord .orow { display:flex; gap:10px; align-items:center; }
.status { display:inline-block; margin-top:4px; background:#fff4e5; color:#b45f00; border-radius:10px; padding:2px 8px; font-size:12px; font-weight:600; }

[hidden] { display:none !important; }

/* Editable fields with a pencil */
.fw { position:relative; display:block; }
.fw input, .fw textarea { padding-right:44px !important; }
.fld input[readonly], .fld textarea[readonly] { background:#f6f6f6; color:#333; }
.pen { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; border-radius:50%; background:none; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.pen svg { width:18px; height:18px; fill:var(--muted); }
.pen.on svg { fill:var(--accent); }

/* Summary rows alternate white / light grey */
.sum { padding:0; overflow:hidden; }
.sum .r { padding:8px 10px; background:#fff; }
.sum .r:nth-child(even) { background:rgba(122,31,61,.06); }
.sum .t { margin-top:0; padding:10px; border-top:1px solid var(--line); background:#fff; }

/* Business card on the account page */
.vcard { position:relative; display:flex; align-items:center; gap:14px; margin:14px 14px 4px; padding:16px; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.vpen { position:absolute; top:8px; right:8px; width:36px; height:36px; border:0; border-radius:50%; background:var(--tint); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.vpen svg { width:19px; height:19px; fill:var(--accent); }
.vphoto { position:relative; flex:0 0 auto; width:76px; height:76px; border-radius:50%; border:0; padding:0; background:var(--accent); color:#fff; font-size:32px; font-weight:700; cursor:pointer; }
.vphoto img { width:100%; height:100%; border-radius:50%; object-fit:cover; display:block; }
.vphoto > span { display:flex; width:100%; height:100%; align-items:center; justify-content:center; }
.vphoto .cam { position:absolute; right:-2px; bottom:-2px; width:26px; height:26px; border-radius:50%; background:#fff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; box-shadow:0 1px 4px rgba(0,0,0,.2); }
.vphoto .cam svg { width:15px; height:15px; fill:var(--accent); }
.vinfo { min-width:0; padding-right:34px; }
.vl { font-size:13px; margin-top:3px; word-break:break-word; }
.vl span { color:var(--muted); margin-right:6px; }

/* Rounding shown as a reduction, in orange */
.sum .r.orange, .subline.orange { color:#d96c00; font-weight:600; }

/* Categories zone: burgundy, 92% opaque (8% transparent) + slight blur so the products scrolling behind never hurt reading */
.stick { background:rgba(122,31,61,.92); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); border-bottom:0; }
.stick .tab { color:#fff; }
.stick .tab img, .stick .tab .plus { background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.35); }
.stick .tab .plus { color:#fff; }
.stick .tab.active { color:#fff; font-weight:700; }
.stick .tab.active img { border-color:#fff; }

/* Recap: description on top, price below it, right-aligned */
.sum .r.item { display:block; }
.sum .r.item .ds { display:block; text-align:left; }
.sum .r.item .pr { display:block; text-align:right; font-weight:600; margin-top:3px; }

/* City / country side by side; non-clickable photo on the checkout card */
.two { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
div.vphoto { cursor:default; display:flex; align-items:center; justify-content:center; }
