:root {
  --olive: #4f6228;
  --olive-dark: #3a4a1c;
  --olive-soft: #e7ecd8;
  --cream: #fbf8f1;
  --paper: #ffffff;
  --brown: #8a5a2b;
  --fez: #c8202f;
  --ink: #2a2a22;
  --muted: #6d6b5f;
  --line: #e6e1d3;
  --wa: #25d366;
  --wa-dark: #1da851;
  --fb: #1877f2;
  --ms: #0084ff;
  --ig: #d62976;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 50, 20, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.15; margin: 0 0 .5em; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251, 248, 241, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: Fraunces, serif; font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--olive-dark); }
.brand-logo { width: 48px; height: 48px; border-radius: 50%; background: #fff; object-fit: contain; border: 2px solid var(--fez); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-size: .95rem; color: var(--brown); }
.ar { font-family: Amiri, "Traditional Arabic", "Noto Naskh Arabic", serif; font-weight: 700; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--olive); }
.cart-btn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.badge { background: var(--olive); color: #fff; border-radius: 999px; min-width: 22px; padding: 0 6px; font-size: .8rem; text-align: center; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--olive-dark), var(--olive) 70%, #6b7f35); color: #fff; }
.hero-in { padding: 44px 16px 52px; max-width: 1120px; text-align: center; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero-cta { justify-content: center; }
.banner { background: #fff; border-bottom: 4px solid var(--fez); }
.banner img { display: block; width: 100%; max-width: 1600px; height: auto; margin: 0 auto; }
.hero h1 .ar { color: #e5c878; margin-left: 10px; font-size: 1.05em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; opacity: .8; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.lead { font-size: 1.15rem; max-width: 560px; opacity: .92; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; color: #fff; transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn-wa { background: var(--wa); }
.btn-fb { background: var(--fb); }
.btn-ms { background: var(--ms); }
.btn-ig { background: var(--ig); }
.btn-ghost { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .4); }
.btn-olive { background: var(--olive); }
.btn.full { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; padding: 6px; }

/* Sections */
.section { padding: 56px 16px; }
.section.alt { background: var(--olive-soft); }
.section h2 { font-size: 1.9rem; color: var(--olive-dark); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
#search { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; min-width: 240px; background: var(--paper); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 24px; }
.chip { border: 1px solid var(--line); background: var(--paper); padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem; }
.chip.active { background: var(--olive); color: #fff; border-color: var(--olive); }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card-img { aspect-ratio: 4 / 3; background: var(--olive-soft); display: grid; place-items: center; font-size: 4rem; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
/* Produit indisponible : photo grisée + grande bande rouge en diagonale + fiche atténuée */
.card-img { overflow: hidden; }
.card.unavailable { opacity: .92; }
.card.unavailable .card-img img, .card.unavailable .card-img > span[aria-hidden] { filter: grayscale(1) brightness(.75); }
.card.unavailable .card-body > :not(.card-actions):not(.price) { opacity: .55; }
.card.unavailable .price .on-demand { color: #b3261e; }
.card.unavailable h3 { text-decoration: line-through; text-decoration-color: #b3261e; text-decoration-thickness: 2px; }
.sold-out {
  position: absolute; left: 50%; top: 50%; width: 160%;
  transform: translate(-50%, -50%) rotate(-24deg);
  background: rgba(179, 38, 30, .92); color: #fff; text-align: center;
  font-weight: 800; font-size: 1.35rem; letter-spacing: .18em; text-transform: uppercase;
  padding: 10px 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  border-top: 2px solid rgba(255, 255, 255, .7); border-bottom: 2px solid rgba(255, 255, 255, .7);
}
.card.unavailable .btn { opacity: .45; pointer-events: none; }
.card-actions .btn[hidden] { display: none; }
.card-img .tag { position: absolute; top: 10px; left: 10px; background: #b3261e; color: #fff; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brown); }
.card h3 { font-size: 1.1rem; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.price { font-weight: 700; font-size: 1.15rem; color: var(--olive-dark); margin-top: auto; padding-top: 8px; }
.price small { font-weight: 500; color: var(--muted); font-size: .85rem; }
.price .on-demand { font-weight: 600; color: var(--brown); font-size: .95rem; }
.card .card-ar { font-family: Amiri, "Traditional Arabic", serif; font-weight: 700; font-size: 1.15rem; color: var(--brown); text-align: right; margin-top: -2px; }
.line-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.card-actions { display: flex; gap: 8px; margin-top: 6px; }
.card-actions .btn { padding: 9px 12px; font-size: .9rem; flex: 1; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 20px; }
.step { background: var(--paper); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.step span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--olive); color: #fff; font-weight: 700; margin-bottom: 10px; }
.step h3 { font-size: 1.15rem; }
.step p { margin: 0; color: var(--muted); }

/* Contact */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.contact-card p { margin: 0 0 14px; }
.map-link { color: var(--olive); font-weight: 600; }
.socials { display: flex; flex-direction: column; gap: 10px; justify-content: center; }

.footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .9rem; }
.footer-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-link { color: var(--muted); }

.fab-wa { position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%; background: var(--wa); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 15; }

/* Barre de commande */
.order-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(620px, calc(100% - 24px)); background: var(--olive-dark); color: #fff; border-radius: 18px; padding: 8px 8px 8px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); z-index: 16; animation: barIn .25s ease; }
.order-bar[hidden] { display: none; }
.order-bar-info { flex: 1; display: flex; flex-direction: column; align-items: flex-start; background: none; border: 0; color: #fff; font: inherit; cursor: pointer; text-align: left; line-height: 1.25; padding: 0; }
.order-bar-info span { font-size: .85rem; opacity: .85; }
.order-bar-info strong { font-size: 1.15rem; }
.order-bar .btn { padding: 12px 18px; }
.order-bar .short { display: none; }
@media (max-width: 480px) {
  .order-bar .long { display: none; }
  .order-bar .short { display: inline; }
}
@keyframes barIn { from { transform: translate(-50%, 30px); opacity: 0; } }
body.has-cart { padding-bottom: 90px; }
body.has-cart .fab-wa, body.cart-open .order-bar { display: none; }
body.has-cart .toast { bottom: 100px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: .88rem; cursor: pointer; background: var(--cream); }
.mode label small { width: 100%; padding-left: 22px; color: var(--muted); font-size: .78rem; }
.mode label:has(input:checked) { border-color: var(--olive); background: var(--olive-soft); font-weight: 600; }
.mode label[hidden] { display: none; }
.sum-row { display: flex; justify-content: space-between; font-size: .92rem; color: var(--muted); }
.sum-row[hidden], #deliveryFields[hidden] { display: none; }
#deliveryFields { display: flex; flex-direction: column; gap: 10px; }
.field input.invalid { border-color: #b3261e; background: #fdf1f0; }
.form-note { margin: 0; font-size: .78rem; color: var(--muted); }
.delivery-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff4e0; color: #7a4d00; font-size: .88rem; }
.delivery-note[hidden] { display: none; }

/* Fenêtre « Quelle quantité ? » */
.qty-dialog { border: 0; border-radius: 18px; padding: 0; width: min(400px, calc(100% - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--ink); background: var(--paper); }
.qty-dialog::backdrop { background: rgba(20, 20, 10, .5); }
.qty-dialog form { padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.qty-close { position: absolute; top: 8px; right: 8px; }
.qty-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.qty-img { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--olive-soft); display: grid; place-items: center; font-size: 2.2rem; flex-shrink: 0; }
.qty-img img { width: 100%; height: 100%; object-fit: cover; }
.qty-head h3 { margin: 0; font-size: 1.1rem; }
.qty-ar { margin: 0; font-family: Amiri, "Traditional Arabic", serif; font-weight: 700; color: var(--brown); text-align: left; }
.qty-price { margin: 2px 0 0; font-weight: 700; color: var(--olive-dark); }
.qty-label { margin: 4px 0 0; font-weight: 600; }
.qty-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qty-choice { padding: 14px 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--cream); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; color: var(--ink); }
.qty-choice:hover { border-color: var(--olive); }
.qty-choice.active { border-color: var(--olive); background: var(--olive); color: #fff; }
.qty-custom { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.qty-custom span { display: flex; align-items: center; gap: 8px; }
.qty-custom input { flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1rem; color: var(--ink); }
.qty-custom b { color: var(--ink); }
.qty-error { margin: 0; min-height: 1em; color: #b3261e; font-size: .85rem; }
.qty-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; padding-top: 4px; border-top: 1px solid var(--line); }
.qty-total strong { font-size: 1.3rem; color: var(--olive-dark); }

/* Drawer */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--cream); z-index: 31; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
body.cart-open .overlay { opacity: 1; pointer-events: auto; }
body.cart-open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.4rem; }
.icon-btn { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 6px 10px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); max-height: 72%; overflow-y: auto; }
.drawer-body { min-height: 90px; }
.total-row { display: flex; justify-content: space-between; font-size: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.field input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); }
.line { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-emoji { font-size: 1.8rem; }
.line-info { flex: 1; min-width: 0; }
.line-info strong { display: block; }
.line-info span { font-size: .85rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 1rem; }
.qty b { min-width: 58px; text-align: center; font-size: .9rem; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .2s; pointer-events: none; z-index: 40; font-size: .9rem; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 640px) {
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
  .cart-label { display: none; }
  .hero-in { padding: 28px 16px 36px; }
  #search { min-width: 0; width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-actions { flex-direction: column; }
  .card-img { font-size: 3rem; }
  .sold-out { font-size: .95rem; letter-spacing: .1em; padding: 7px 0; }
}
