/* ==========================================================
   BénirestoJ-M.K — Feuille de style
   Police titres : Ubuntu / Police texte : Montserrat
   Accent de marque : #E07A5F (Terracotta)
   ========================================================== */

:root{
  --accent: #E07A5F;
  --accent-dark: #C6603F;
  --radius: 16px;
  --font-title: "Ubuntu", sans-serif;
  --font-body: "Montserrat", sans-serif;
}

/* ---------- Thème NOIR (défaut, économie batterie) ---------- */
body[data-theme="noir"]{
  --bg: #121212;
  --bg-elevated: #1c1c1c;
  --text: #f5f5f5;
  --text-muted: #a8a8a8;
  --border: #2c2c2c;
}

/* ---------- Thème BLANC ---------- */
body[data-theme="blanc"]{
  --bg: #ffffff;
  --bg-elevated: #f7f5f3;
  --text: #161616;
  --text-muted: #6b6b6b;
  --border: #e4e0da;
}

/* ---------- Thème BLEU (couleurs du logo) ---------- */
body[data-theme="bleu"]{
  --bg: #0b3d91;
  --bg-elevated: #0f4bb0;
  --text: #ffffff;
  --text-muted: #cfe0ff;
  --border: #1a56b8;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3{ font-family: var(--font-title); margin:0; }

.hidden{ display:none !important; }

/* ---------------- HEADER ---------------- */
.header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 18px;
  position: sticky; top:0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header__brand{ display:flex; align-items:center; gap:10px; }
.header__logo{ width:42px; height:42px; border-radius:50%; object-fit:cover; }
.header__title{ display:flex; flex-direction:column; line-height:1.15; }
.header__name{ font-family: var(--font-title); font-weight:700; font-size:16px; }
.header__zone{ font-size:11px; color: var(--text-muted); }
.header__actions{ display:flex; align-items:center; gap:8px; }

.badge{
  font-size:12px; padding:6px 10px; border-radius: 999px;
  background: var(--bg-elevated); border:1px solid var(--border);
}

.theme-btn{
  width:38px; height:38px; border-radius:50%;
  border:1px solid var(--border); background: var(--bg-elevated);
  cursor:pointer; font-size:16px; color: var(--text);
}

/* ---------------- Theme panel ---------------- */
.theme-panel{
  position: sticky; top:70px; z-index:29;
  background: var(--bg-elevated);
  border-bottom:1px solid var(--border);
  padding:10px 18px; display:flex; align-items:center; gap:12px;
}
.theme-panel__label{ font-size:12px; color: var(--text-muted); margin:0; }
.theme-panel__options{ display:flex; gap:10px; }
.theme-swatch{
  width:26px; height:26px; border-radius:50%; cursor:pointer;
  border:2px solid var(--border);
}
.theme-swatch--blanc{ background:#ffffff; }
.theme-swatch--noir{ background:#121212; }
.theme-swatch--bleu{ background:#0b3d91; }

/* ---------------- MENU FEED ---------------- */
.menu{ max-width: 720px; margin: 0 auto; padding: 18px 16px 100px; }
.menu__intro{ padding: 10px 4px 18px; }
.menu__intro h1{ font-size: 24px; }
.menu__intro p{ color: var(--text-muted); margin:6px 0 0; font-size:14px; }

.menu__feed{ display:flex; flex-direction:column; gap:16px; }

.plat-card{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  display:flex; flex-direction:column;
}
.plat-card__photo{
  width:100%; aspect-ratio: 16/9; object-fit:cover; background: var(--border);
}
.plat-card__body{ padding: 14px 16px; display:flex; flex-direction:column; gap:6px; }
.plat-card__top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.plat-card__nom{ font-family: var(--font-title); font-weight:700; font-size:17px; }
.plat-card__prix{ color: var(--accent); font-weight:700; white-space:nowrap; }
.plat-card__desc{ color: var(--text-muted); font-size:13px; margin:0; }

.plat-card--indisponible{ opacity:.55; filter: grayscale(60%); }
.plat-card--indisponible .btn--add{ pointer-events:none; background: var(--border); color: var(--text-muted); }

.btn{
  font-family: var(--font-body); font-weight:600; font-size:14px;
  border:none; border-radius: 10px; padding: 11px 16px; cursor:pointer;
}
.btn--primary{ background: var(--accent); color:#fff; }
.btn--primary:hover{ background: var(--accent-dark); }
.btn--ghost{ background: transparent; border:1px solid var(--border); color: var(--text); }
.btn--add{ align-self:flex-start; margin-top:6px; }

.skeleton-card{
  height:180px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-elevated), var(--border), var(--bg-elevated));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer{ 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* ---------------- CART FAB ---------------- */
.cart-fab{
  position: fixed; right:18px; bottom:18px; z-index:40;
  background: var(--accent); color:#fff; border:none; border-radius: 999px;
  padding: 14px 18px; display:flex; align-items:center; gap:8px;
  font-family: var(--font-title); font-weight:700; font-size:15px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor:pointer;
}
#cartCount{
  background: rgba(255,255,255,.25); border-radius:999px;
  padding: 2px 8px; font-size:13px;
}

/* ---------------- OVERLAY / PANELS ---------------- */
.overlay{
  position: fixed; inset:0; z-index:50;
  background: rgba(0,0,0,.55);
  display:flex; align-items:flex-end; justify-content:center;
}
@media (min-width: 640px){
  .overlay{ align-items:center; }
}

.cart-panel, .confirm-panel, .admin-login-panel{
  background: var(--bg); color: var(--text);
  width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 20px; max-height: 92vh; overflow-y:auto;
  border: 1px solid var(--border);
}
@media (min-width: 640px){
  .cart-panel, .confirm-panel, .admin-login-panel{ border-radius: 20px; }
}

.cart-panel__head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.icon-btn{ background:none; border:none; color: var(--text); font-size:18px; cursor:pointer; }

.cart-panel__items{ display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.cart-item{ display:flex; justify-content:space-between; align-items:center; font-size:14px; }
.cart-item__qty{ display:flex; align-items:center; gap:8px; }
.qty-btn{
  width:26px; height:26px; border-radius:50%; border:1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); cursor:pointer;
}

.cart-panel__total{
  display:flex; justify-content:space-between; font-family: var(--font-title);
  font-weight:700; font-size:18px; padding: 12px 0; border-top:1px solid var(--border);
  margin-bottom: 14px;
}

.order-form{ display:flex; flex-direction:column; gap:14px; }
.field{ display:flex; flex-direction:column; gap:6px; font-size:13px; }
.field input, .field select{
  padding: 11px 12px; border-radius:10px; border:1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-family: var(--font-body); font-size:14px;
}
.field-group{ border:1px solid var(--border); border-radius:10px; padding:10px 12px; }
.field-group legend{ padding:0 6px; font-size:12px; color: var(--text-muted); }
.radio{ display:flex; align-items:center; gap:8px; font-size:14px; padding:6px 0; }

.confirm-panel{ text-align:center; }
.confirm-panel__icon{ font-size:44px; margin-bottom:8px; }
.confirm-panel p{ color: var(--text-muted); margin: 8px 0 18px; }

/* ---------------- FOOTER / ADMIN SECRET ---------------- */
.footer{
  text-align:center; color: var(--text-muted); font-size:12px; padding: 26px 16px 40px;
}
.admin-trigger{ cursor: default; user-select:none; }

.error{ color:#e05f5f; font-size:13px; }

.admin-login-panel__actions{ display:flex; gap:10px; margin-top:6px; }
.admin-login-panel__actions .btn{ flex:1; }

/* ---------------- ADMIN BACK-OFFICE ---------------- */
.admin-main{ max-width: 900px; margin:0 auto; padding: 20px 16px 60px; }
.admin-stats{ display:grid; grid-template-columns: repeat(2,1fr); gap:12px; margin-bottom:26px; }
@media (min-width:640px){ .admin-stats{ grid-template-columns: repeat(4,1fr); } }
.stat-card{
  background: var(--bg-elevated); border:1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display:flex; flex-direction:column; gap:6px;
}
.stat-card__label{ font-size:11px; color: var(--text-muted); }
.stat-card__value{ font-family: var(--font-title); font-weight:700; font-size:19px; color: var(--accent); }

.admin-menu, .admin-orders{ margin-bottom: 30px; }
.admin-plats{ display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.admin-plat-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: var(--bg-elevated); border:1px solid var(--border); border-radius:12px; padding:12px 14px;
}
.admin-plat-row__info{ display:flex; flex-direction:column; }
.admin-plat-row__nom{ font-weight:600; font-size:14px; }
.admin-plat-row__prix{ font-size:12px; color: var(--text-muted); }
.admin-plat-row__actions{ display:flex; align-items:center; gap:10px; }

.toggle{
  width:44px; height:24px; border-radius:999px; background: var(--border); position:relative;
  border:none; cursor:pointer;
}
.toggle--on{ background: #4caf6a; }
.toggle::after{
  content:""; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%;
  background:#fff; transition: left .2s ease;
}
.toggle--on::after{ left:22px; }

.edit-btn{ background:none; border:none; font-size:16px; cursor:pointer; color: var(--text); }

.admin-orders__list{ display:flex; flex-direction:column; gap:10px; }
.order-row{
  background: var(--bg-elevated); border:1px solid var(--border); border-radius:12px; padding:12px 14px;
  font-size:13px; display:flex; justify-content:space-between; gap:10px;
}
.order-row__status{
  font-size:11px; padding:3px 8px; border-radius:999px; background: var(--border); align-self:flex-start;
}
