/* Les couleurs et polices viennent de theme.json (appliquées par menu.js) */
:root {
  --primaire: #5B2A86;
  --secondaire: #E8B23A;
  --fond: #FBF4EA;
  --texte: #2A1B3D;
  --carte: #FFFFFF;
  --sur-primaire: #FFFFFF;
  --police-titres: cursive;
  --police-texte: system-ui, sans-serif;
  --police-arabe: system-ui, sans-serif;
  --radius: 16px;
  --ombre: 0 2px 10px rgba(42, 27, 61, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 15px;
  line-height: 1.4;
}
html[dir="rtl"] body { font-family: var(--police-arabe); }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ---------- En-tête ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 28px 16px 22px;
  overflow: hidden;
  color: var(--primaire);
}
.hero-cover {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .35;
  z-index: 0;
}
.hero > *:not(.hero-cover):not(.lang-btn) { position: relative; z-index: 1; }
.hero-logo {
  width: 112px; height: 112px;
  margin: 8px auto 10px;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(91, 42, 134, .3);
}
.hero-name {
  font-family: var(--police-titres);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  margin: 0;
}
.closed-banner {
  max-width: 460px; margin: 10px auto 0;
  background: #B3261E; color: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px;
}
.hero-table {
  display: inline-block; margin: 0 0 10px;
  background: var(--secondaire); color: var(--primaire);
  border-radius: 999px; padding: 5px 16px; font-weight: 800; font-size: 16px;
}
.table-fixed {
  background: var(--carte); border: 1.5px solid var(--primaire); border-radius: 12px;
  padding: 12px; font-size: 18px; color: var(--primaire);
}
.table-fixed b { font-size: 22px; }
.no-table {
  background: #FFF6DD; border: 1.5px solid var(--secondaire); border-radius: 12px;
  padding: 12px; font-weight: 700; color: var(--texte);
}
.hero-slogan { margin: 2px 0 10px; font-weight: 600; color: var(--primaire); letter-spacing: .3px; }
.hero-welcome {
  max-width: 460px; margin: 0 auto;
  background: rgba(255, 255, 255, .85);
  color: var(--texte);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
}
.lang-btn {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
  background: var(--primaire); color: var(--sur-primaire);
  border: 0; border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: 14px;
}
html[dir="rtl"] .lang-btn { font-family: var(--police-texte); }
html[dir="ltr"] .lang-btn { font-family: var(--police-arabe); }

/* ---------- Catégories ---------- */
.cat-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px;
  background: var(--fond);
  box-shadow: 0 4px 10px -8px rgba(0, 0, 0, .25);
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto;
  border: 1.5px solid var(--primaire);
  background: transparent; color: var(--primaire);
  border-radius: 999px; padding: 7px 14px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.cat-chip.active { background: var(--primaire); color: var(--sur-primaire); }

/* ---------- Produits ---------- */
.menu { padding: 0 16px; max-width: 760px; margin: 0 auto; }
.cat-section { scroll-margin-top: 64px; padding-top: 18px; }
.cat-title {
  font-family: var(--police-titres);
  font-weight: 400;
  color: var(--primaire);
  font-size: 36px;
  margin: 0 0 10px;
}
html[dir="rtl"] .cat-title { font-family: var(--police-arabe); font-weight: 700; font-size: 26px; }

.product {
  display: flex; gap: 12px; align-items: stretch;
  width: 100%;
  text-align: start;
  background: var(--carte);
  border: 0; border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 10px;
  margin-bottom: 10px;
}
.product-photo {
  flex: 0 0 92px; width: 92px; height: 92px;
  border-radius: 12px; object-fit: cover;
  background: var(--fond);
}
.product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-name { font-weight: 700; font-size: 16px; margin: 2px 0 3px; }
.product-desc {
  font-size: 13px; opacity: .7; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.price { font-weight: 700; color: var(--primaire); }
.add-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--secondaire); color: var(--primaire);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; line-height: 1;
}

.spacer { height: 96px; }

/* ---------- Barre panier ---------- */
.cart-bar {
  position: fixed; z-index: 20;
  left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 728px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--primaire); color: var(--sur-primaire);
  border: 0; border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700; font-size: 16px;
  box-shadow: 0 8px 24px rgba(91, 42, 134, .4);
}
.cart-count {
  background: var(--secondaire); color: var(--primaire);
  border-radius: 999px; min-width: 26px; height: 26px; padding: 0 7px;
  display: grid; place-items: center; font-size: 14px;
}
.cart-bar-total { margin-inline-start: auto; }

/* ---------- Fenêtres (bottom sheets) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 10, 30, .5); z-index: 30; }
.sheet {
  position: fixed; z-index: 31;
  left: 0; right: 0; bottom: 0;
  max-width: 760px; margin: 0 auto;
  max-height: 92vh; overflow-y: auto;
  background: var(--fond);
  border-radius: 22px 22px 0 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-photo { width: 100%; height: 220px; object-fit: cover; border-radius: 22px 22px 0 0; }
.sheet-close {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .92);
  font-size: 22px; line-height: 1;
  box-shadow: var(--ombre);
}
.sheet-inner { padding: 16px; }
.sheet-title { margin: 0 0 4px; font-size: 22px; color: var(--primaire); }
.sheet-desc { margin: 0 0 12px; opacity: .75; font-size: 14px; }

.opt-group { margin: 14px 0; }
.opt-group h3 {
  margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--primaire);
}
.opt-group h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .6; }
.opt {
  display: flex; align-items: center; gap: 10px;
  background: var(--carte); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 6px;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.opt:has(input:checked) { border-color: var(--primaire); }
.opt input { accent-color: var(--primaire); width: 18px; height: 18px; margin: 0; }
.opt span:first-of-type { flex: 1; }
.opt .opt-price { font-weight: 600; color: var(--primaire); font-size: 14px; }

.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--carte); border-radius: 999px; padding: 4px; }
.qty button {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--fond); font-size: 20px; font-weight: 700; color: var(--primaire);
}
.qty span { min-width: 26px; text-align: center; font-weight: 700; }

.sheet-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.btn-primary {
  flex: 1;
  background: var(--primaire); color: var(--sur-primaire);
  border: 0; border-radius: 999px;
  padding: 14px 18px; font-weight: 700; font-size: 16px;
}
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Panier ---------- */
.cart-line { display: flex; gap: 10px; align-items: flex-start; background: var(--carte); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-weight: 700; }
.cart-line-opts { font-size: 13px; opacity: .7; }
.cart-line-price { font-weight: 700; color: var(--primaire); white-space: nowrap; }
.cart-line .qty { margin-top: 6px; }
.cart-line .qty button { width: 28px; height: 28px; font-size: 17px; }

.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--primaire); }
.field select, .field textarea {
  width: 100%; font: inherit; color: var(--texte);
  background: var(--carte); border: 1.5px solid rgba(91, 42, 134, .25);
  border-radius: 12px; padding: 12px;
}
.field select { font-size: 18px; font-weight: 700; }
.field textarea { min-height: 70px; resize: vertical; }
.total-row { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; margin: 16px 0 4px; }
.total-row span:last-child { color: var(--primaire); }
.pay-note { font-size: 13px; opacity: .7; margin: 0 0 6px; }
.empty { text-align: center; opacity: .6; padding: 30px 0; }

/* ---------- Commande envoyée ---------- */
.success { text-align: center; padding-top: 28px; }
.success-check {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%;
  background: #2E9E5B; color: #fff; font-size: 42px; font-weight: 800;
  display: grid; place-items: center; animation: pop .35s ease-out;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.success-num { font-size: 17px; margin: 4px 0 6px; }
.success-num b { color: var(--primaire); font-size: 20px; }
.success .total-row { justify-content: center; gap: 12px; }
.success-body { opacity: .8; margin: 8px 0 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--texte); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; max-width: calc(100% - 32px); text-align: center;
}
