:root {
  --fond: #faf7f2;
  --carte: #ffffff;
  --texte: #1c1917;
  --doux: #78716c;
  --accent: #d9480f;
  --bord: #ece7df;
  --header: #1c1917;
  --rayon: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  color: #fff;
  padding: calc(28px + env(safe-area-inset-top)) 16px 26px;
  text-align: center;
  transition: padding 0.25s;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo, .logo-fallback {
  width: 92px; height: 92px; border-radius: 50%;
  object-fit: cover; background: #fff; transition: all 0.25s;
}
.logo-fallback {
  display: grid; place-items: center;
  background: var(--accent); font-size: 40px; font-weight: 800;
}
.logo-fallback[hidden], .logo[hidden] { display: none; }
.header h1 { font-size: 22px; font-weight: 800; letter-spacing: 0.2px; margin-top: 6px; }
.slogan { font-size: 13px; color: #d6d3d1; }

/* Header réduit sur la page produits */
.header.compact { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.header.compact .brand { flex-direction: row; justify-content: center; gap: 10px; }
.header.compact .logo, .header.compact .logo-fallback { width: 38px; height: 38px; font-size: 18px; }
.header.compact h1 { font-size: 17px; margin: 0; }
.header.compact .slogan { display: none; }

.back {
  position: absolute; left: 10px; bottom: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.12); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.back[hidden] { display: none; }

/* ---------- Contenu ---------- */
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 22px 16px; }
.titre { font-size: 20px; font-weight: 800; margin-bottom: 16px; }

/* Catégories */
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.carte-cat {
  background: var(--carte); border-radius: var(--rayon); overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.05);
  transition: transform 0.12s;
}
.carte-cat:active { transform: scale(0.97); }
.cat-visuel, .prod-visuel {
  position: relative; display: grid; place-items: center;
  background: linear-gradient(135deg, #fff1e6, #ffe3d1); overflow: hidden;
}
.cat-visuel { aspect-ratio: 4 / 3; }
.cat-visuel .emoji { font-size: 54px; }
.cat-visuel img, .prod-visuel img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
}
.cat-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.cat-nom { font-weight: 700; font-size: 16px; }
.cat-nb { font-size: 12px; color: var(--doux); }

/* Produits */
.liste { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.produit {
  display: flex; align-items: center; gap: 14px;
  background: var(--carte); border-radius: var(--rayon); padding: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.04);
  animation: apparait 0.25s ease both;
}
.prod-visuel { width: 78px; height: 78px; border-radius: 12px; flex-shrink: 0; }
.prod-visuel .emoji { font-size: 34px; }
.prod-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prod-nom { font-weight: 700; font-size: 15px; }
.prod-desc { font-size: 13px; color: var(--doux); line-height: 1.35; }
.prod-prix { font-weight: 800; color: var(--accent); white-space: nowrap; padding-right: 4px; }

@keyframes apparait { from { opacity: 0; transform: translateY(6px); } }

.footer { text-align: center; color: var(--doux); font-size: 13px; padding: 20px 0 calc(24px + env(safe-area-inset-bottom)); }
