@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Nunito:wght@400;600;700;800&family=Playfair+Display:ital,wght@0,700;1,400;1,700&family=Raleway:wght@400;600;700&display=swap');

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2b2620;
  --muted: #8a7f70;
  --accent: #b5793a;
  --accent-dark: #8c5a26;
  --line: #e9e1d5;
  --danger: #c0392b;
  --ok: #2e7d52;
  --shadow: 0 6px 24px rgba(60, 45, 25, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a { color: var(--accent-dark); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.25rem; margin: 0; }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.topbar .actions { display: flex; gap: 10px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  font-size: 0.95rem; text-decoration: none; transition: all .15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--danger); border-color: #eccac5; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 18px; }
.card h3 { margin: 0 0 6px; }
.card .muted { color: var(--muted); font-size: 0.9rem; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

/* ---- Focal Point Picker ---- */
.fp-drop {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 90px; border: 2px dashed var(--line);
  border-radius: 12px; cursor: pointer; color: var(--muted);
  font-size: 0.95rem; transition: border-color .2s, background .2s;
  background: rgba(0,0,0,.02);
}
.fp-drop:hover, .fp-drop.drag-over { border-color: var(--accent); background: rgba(181,121,58,.06); }
#fp-picker { margin-top: 2px; }
#fp-card-view { margin-bottom: 10px; }
#fp-card-frame {
  position: relative; overflow: hidden; border-radius: 10px;
  border: 2px solid var(--accent); cursor: grab; user-select: none;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
#fp-card-frame:active { cursor: grabbing; }
#fp-card-img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; pointer-events: none;
  transition: object-position .05s linear;
}
#fp-dot {
  position: absolute; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(255,255,255,.9);
  border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,.3);
  transform: translate(-50%,-50%); pointer-events: none;
  transition: left .05s, top .05s;
}
#fp-full-view { margin-bottom: 10px; }
#fp-full-wrap {
  position: relative; width: 100%; border-radius: 8px; overflow: hidden;
  background: #111; cursor: crosshair;
}
#fp-full-img { display: block; width: 100%; height: auto; opacity: 0.6; pointer-events: none; }
#fp-crop-rect {
  position: absolute; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  pointer-events: none; border-radius: 4px;
  transition: all .05s linear;
}
#fp-coords-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px;
}
#fp-coords-label { font-size: 0.82rem; color: var(--muted); flex: 1; }
.btn-sm {
  padding: 4px 12px; border-radius: 8px; font-size: 0.82rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  white-space: nowrap; display: inline-block;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.fp-hint { margin: 4px 0 0; font-size: 0.76rem; color: var(--muted); text-align: center; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(30, 22, 12, 0.45);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-off { background: #f3e3e1; color: var(--danger); }
.badge-on { background: #e2f1e9; color: var(--ok); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100;
}
.toast.show { opacity: 1; }

/* ----- Admin editor ----- */
.cat-block { margin-bottom: 26px; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--line); margin-bottom: 14px; }
.cat-head h2 { margin: 0; font-size: 1.15rem; }
.dish-row {
  display: flex; gap: 14px; align-items: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 10px;
}
.dish-row .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--line); flex: none; }
.dish-row .thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; }
.dish-row .info { flex: 1; min-width: 0; }
.dish-row .info strong { display: block; }
.dish-row .info p { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; }
.dish-row .price { font-weight: 700; color: var(--accent-dark); white-space: nowrap; }

/* ----- Carte display (tablette) ----- */
.carte-page { max-width: 980px; margin: 0 auto; padding: 30px 24px 60px; }
.carte-header { text-align: center; margin-bottom: 36px; }
.carte-header h1 { font-size: 2.4rem; margin: 0 0 8px; letter-spacing: 0.5px; }
.carte-header p { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
.carte-cat { margin-bottom: 44px; }
.carte-cat > h2 {
  font-size: 1.5rem; color: var(--accent-dark); margin: 0 0 18px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block;
}
.dishes { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.dish-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.dish-card .photo { width: 100%; height: 180px; flex: none; display: block; object-fit: cover; background: #e9e1d5; }
.dish-card .photo.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 2.5rem; height: 80px; }
.dish-card .content { flex: 1; padding: 12px 16px 14px; display: flex; flex-direction: column; overflow: hidden; }
.dish-card .content .line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.dish-card .content h3 { margin: 0; font-size: 1rem; }
.dish-card .content .price { font-weight: 700; color: var(--accent-dark); white-space: nowrap; font-size: 0.95rem; }
.dish-card .content p { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.dish-card.unavailable { opacity: 0.55; }

/* Cartes cliquables + popup de détail */
.dish-card.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.dish-card.clickable:hover,
.dish-card.clickable:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(60, 45, 25, 0.16);
  border-color: var(--accent);
  outline: none;
}
.dish-card .detail-hint {
  display: inline-block; margin-top: 8px; font-size: 0.82rem; font-weight: 600;
  color: var(--accent-dark); opacity: 0; transition: opacity .12s ease;
}
.dish-card.clickable:hover .detail-hint,
.dish-card.clickable:focus-visible .detail-hint { opacity: 1; }

.modal.dish-detail { position: relative; max-width: 560px; padding: 0; overflow: hidden; }
.dish-detail .dish-detail-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); color: var(--ink);
  display: grid; place-items: center; line-height: 1; box-shadow: var(--shadow);
}
.dish-detail .detail-photo {
  width: 100%; height: 260px; object-fit: cover; background: var(--line); display: block;
}
.dish-detail .detail-photo.zoomable {
  cursor: zoom-in; transition: opacity .15s;
}
.dish-detail .detail-photo.zoomable:hover { opacity: 0.92; }
.dish-detail .detail-photo.placeholder { display: grid; place-items: center; font-size: 3.5rem; color: var(--muted); }

/* Lightbox */
.photo-lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.92); align-items: center; justify-content: center;
  padding: 20px;
}
.photo-lightbox.open { display: flex; }
.photo-lightbox img {
  max-width: 100%; max-height: 90vh; border-radius: 10px;
  box-shadow: 0 8px 60px rgba(0,0,0,.7);
  object-fit: contain; animation: lb-in .18s ease;
}
@keyframes lb-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.lightbox-close {
  position: fixed; top: 18px; right: 22px; background: rgba(255,255,255,.15);
  border: none; color: #fff; font-size: 2rem; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  line-height: 1; transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.dish-detail .detail-content { padding: 22px 24px 28px; }
.dish-detail .detail-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 10px;
}
.dish-detail .detail-head h2 { margin: 0; font-size: 1.5rem; }
.dish-detail .detail-price { font-weight: 700; font-size: 1.35rem; color: var(--accent-dark); white-space: nowrap; }
.dish-detail .detail-desc { margin: 14px 0 0; font-size: 1.02rem; line-height: 1.6; }
.dish-detail .detail-desc.muted-text { color: var(--muted); font-style: italic; }

@media (max-width: 600px) {
  .carte-header h1 { font-size: 1.9rem; }
  .dishes { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .dish-card .photo { height: 140px; }
  .dish-detail .detail-photo { height: 200px; }
}

/* ============================================================
   MOBILE RESPONSIVE — toutes pages
   ============================================================ */

/* Cibles tactiles minimum 44px */
.btn, a.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.btn-sm {
  min-height: 40px;
}

@media (max-width: 640px) {

  /* Topbar */
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 1.05rem; }
  .topbar .actions { gap: 6px; }

  /* Container */
  .container { padding: 14px; }

  /* Grille cartes → 1 colonne */
  .cards { grid-template-columns: 1fr; }

  /* Boutons */
  .btn { padding: 10px 16px; font-size: 0.95rem; }
  .btn-sm { padding: 9px 14px; font-size: 0.88rem; }

  /* Inputs — empêche le zoom iOS */
  .field input, .field textarea, .field select {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 50px;
  }

  /* Ligne 2 colonnes → 1 */
  .row { flex-direction: column; gap: 0; }
  .row > * { min-width: 100%; }

  /* Modal → drawer bas de page */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 18px 18px 0 0;
    max-width: 100%;
    max-height: 92vh;
  }
  .modal-footer { padding: 12px 16px; }

  /* Dish rows dans l'éditeur */
  .dish-row {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 10px;
  }
  .dish-row .thumb { width: 56px; height: 56px; }
  .dish-row .info { min-width: 0; flex: 1 1 60%; }
  .dish-row .price { flex: 0 0 auto; }
  .dish-row .card-actions {
    flex: 0 0 100%;
    margin: 4px 0 0 !important;
    flex-wrap: wrap;
  }

  /* Cat-head : empile si besoin */
  .cat-head { flex-wrap: wrap; gap: 8px; }
  .cat-head .card-actions { flex-wrap: wrap; }

  /* Carte publique — toolbar */
  .carte-toolbar {
    padding: 10px 14px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .search-box { max-width: 100%; min-width: 0; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }

  /* Cat-nav */
  .cat-nav { padding: 8px 14px; top: 56px; }

  /* Carte — page */
  .carte-page { padding: 20px 14px 80px; }

  /* Toast */
  .toast {
    max-width: calc(100vw - 28px);
    white-space: normal;
    text-align: center;
    bottom: 14px;
  }

  /* Breadcrumb */
  .breadcrumb { font-size: 0.78rem; }

  /* Badges de carte */
  .card-actions { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .topbar h1 { display: none; }
  .dishes { grid-template-columns: 1fr; }
  .dish-card .photo { height: 160px; }
}

/* ===== Améliorations : labels, recherche, filtres, nav ===== */
.tag-badge {
  display: inline-block; padding: 2px 9px; margin: 0; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; background: #f3ecdf;
  color: var(--accent-dark); border: 1px solid var(--line); white-space: nowrap;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

.carte-toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 14px 24px; background: var(--toolbar-bg, rgba(250, 247, 242, 0.96));
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.6; }
.search-box input {
  width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--line);
  border-radius: 999px; font: inherit; background: #fff; color: var(--ink);
}
.search-box input:focus { outline: none; border-color: var(--accent); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 0.85rem;
  transition: all .12s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.cat-nav {
  position: sticky; top: 65px; z-index: 19;
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.cat-nav a {
  flex: none; padding: 6px 14px; border-radius: 999px; text-decoration: none;
  color: var(--accent-dark); background: var(--bg); border: 1px solid var(--line);
  font-size: 0.88rem; font-weight: 600; transition: all .12s ease;
}
.cat-nav a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.cat-nav a.disabled { opacity: 0.35; pointer-events: none; }

.back-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  text-decoration: none; font-size: 1.3rem; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .2s ease;
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Cases à cocher labels dans l'admin */
.tag-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  font-size: 0.85rem; font-weight: 500; user-select: none;
}
.tag-check input { margin: 0; }
.tag-check:has(input:checked) { background: #f3ecdf; border-color: var(--accent); color: var(--accent-dark); }

/* ---- Breadcrumb admin ---- */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 0.82rem; margin-bottom: 14px; color: var(--muted);
}
.bc-link { color: var(--accent-dark); text-decoration: none; }
.bc-link:hover { text-decoration: underline; }
.bc-sep { margin: 0 2px; opacity: .45; }
.bc-current { font-weight: 600; color: var(--ink); }

/* ---- Restaurant card (index.html) ---- */
.resto-card { transition: box-shadow .15s ease, transform .12s ease; }
.resto-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.12); transform: translateY(-2px); }

/* ================================================================
   THÈMES — appliqués via body.theme-{nom}
   ================================================================ */

/* ------ 1. CLASSIC (défaut) — chaud, bistrot français ---------- */
/* Variables déjà définies dans :root. Pas de surcharge nécessaire. */

/* ------ 2. NOIR — élégant, gastronomique, or & noir ------------ */
body.theme-noir {
  --bg: #111111;
  --surface: #1c1c1c;
  --ink: #f0e8d0;
  --muted: #7a7060;
  --accent: #c9a84c;
  --accent-dark: #a8863a;
  --line: #2e2e2e;
  --ok: #4caf7a;
  --shadow: 0 6px 28px rgba(0,0,0,.55);
  --toolbar-bg: rgba(17,17,17,.94);
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at center, rgba(201,168,76,0.12) 0%, rgba(17,17,17,0.0) 52%),
    linear-gradient(to bottom, rgba(8, 8, 8, 0.55), rgba(14, 14, 14, 0.65) 48%, rgba(17, 17, 17, 0.72)),
    url("/img/cedar-bg.svg");
  background-size: 100% 100%, 100% 100%, 1200px 900px;
  background-position: center, center, bottom center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed;
  color: var(--ink);
}
body.theme-noir .topbar {
  background: #0a0a0a; border-bottom-color: var(--line);
}
body.theme-noir .cat-nav { background: #141414; }
body.theme-noir .dish-card, body.theme-noir .modal { background: var(--surface); }
body.theme-noir .carte-header h1 {
  font-size: 3rem; font-weight: 300; letter-spacing: 3px; text-transform: uppercase;
}
body.theme-noir .carte-header p { font-style: italic; font-size: 1.1rem; }
body.theme-noir .carte-cat > h2 {
  font-style: italic; font-weight: 400; letter-spacing: 1px;
  border-bottom-color: var(--accent);
}
body.theme-noir .dish-card { border-color: #2a2a2a; }
body.theme-noir .dish-card.clickable:hover {
  box-shadow: 0 12px 36px rgba(201,168,76,.22);
  border-color: var(--accent);
}
body.theme-noir .tag-badge { background: #2a2418; border-color: #3a3020; color: var(--accent); }
body.theme-noir .chip { background: #1c1c1c; border-color: var(--line); color: var(--ink); }
body.theme-noir .chip.active { background: var(--accent); border-color: var(--accent); color: #111; }
body.theme-noir .search-box input { background: #1c1c1c; color: var(--ink); border-color: var(--line); }
body.theme-noir .back-top { background: var(--accent); color: #111; }
body.theme-noir .detail-price { color: var(--accent); }
body.theme-noir .dish-detail .detail-head h2 { font-style: italic; }

@media (max-width: 900px) {
  body.theme-noir {
    background-attachment: scroll, scroll, scroll;
    background-size: 100% 100%, 100% 100%, 860px 620px;
    background-position: center, center, bottom center;
  }
}

/* ------ 3. FRAÎCHE — vert nature, aéré, moderne --------------- */
body.theme-fraiche {
  --bg: #f0faf4;
  --surface: #ffffff;
  --ink: #142e20;
  --muted: #4d8060;
  --accent: #2a7a48;
  --accent-dark: #1c5a33;
  --line: #c0e8ce;
  --ok: #2a7a48;
  --shadow: 0 4px 20px rgba(42,122,72,.09);
  --toolbar-bg: rgba(240,250,244,.95);
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
body.theme-fraiche .carte-header h1 {
  font-size: 2.6rem; font-weight: 800; letter-spacing: -1px;
}
body.theme-fraiche .carte-cat > h2 { font-weight: 800; border-radius: 4px; }
body.theme-fraiche .dish-card { border-radius: 18px; border-color: var(--line); }
body.theme-fraiche .dish-card.clickable:hover {
  box-shadow: 0 10px 32px rgba(42,122,72,.16);
  border-color: var(--accent);
}
body.theme-fraiche .tag-badge { background: #e0f4e8; border-color: var(--line); color: var(--accent-dark); }
body.theme-fraiche .chip.active { background: var(--accent); border-color: var(--accent); }
body.theme-fraiche .back-top { border-radius: 14px; }

/* ------ 4. ARDOISE — marine & corail, brasserie moderne -------- */
body.theme-ardoise {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1a2c40;
  --muted: #607080;
  --accent: #e05a4a;
  --accent-dark: #b03a2e;
  --line: #d8e2ee;
  --ok: #2a8060;
  --shadow: 0 4px 20px rgba(26,44,64,.10);
  --toolbar-bg: rgba(244,246,249,.96);
  font-family: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
body.theme-ardoise .topbar {
  background: #1a2c40; border-bottom: 1px solid #243650;
}
body.theme-ardoise .topbar h1 { color: #f0f4f8; }
body.theme-ardoise .topbar .brand .logo { background: linear-gradient(135deg, #e05a4a, #b03a2e); }
body.theme-ardoise .topbar .actions .btn { color: #d0dce8; border-color: #2e4060; }
body.theme-ardoise .topbar .actions .btn-primary { color: #fff; }
body.theme-ardoise .carte-header h1 {
  font-size: 2.5rem; font-weight: 700; letter-spacing: -0.5px; text-transform: uppercase;
}
body.theme-ardoise .carte-cat > h2 { font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; font-size: 1.2rem; }
body.theme-ardoise .dish-card { border-color: var(--line); border-radius: 10px; }
body.theme-ardoise .dish-card.clickable:hover {
  box-shadow: 0 10px 28px rgba(224,90,74,.18);
  border-color: var(--accent);
}
body.theme-ardoise .tag-badge { background: #ffe9e6; border-color: #f5cec9; color: var(--accent-dark); }
body.theme-ardoise .chip.active { background: var(--accent); border-color: var(--accent); }

/* ------ 5. SAKURA — doux, romantique, japonisant --------------- */
body.theme-sakura {
  --bg: #fdf4f7;
  --surface: #ffffff;
  --ink: #2e1a28;
  --muted: #9a7088;
  --accent: #c0527a;
  --accent-dark: #8c3558;
  --line: #f0d4e4;
  --ok: #4a8060;
  --shadow: 0 4px 22px rgba(192,82,122,.10);
  --toolbar-bg: rgba(253,244,247,.95);
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg opacity='0.07'%3E%3Cellipse cx='80' cy='55' rx='14' ry='26' fill='%23c0527a' transform='rotate(0 80 90)'/%3E%3Cellipse cx='80' cy='55' rx='14' ry='26' fill='%23c0527a' transform='rotate(72 80 90)'/%3E%3Cellipse cx='80' cy='55' rx='14' ry='26' fill='%23c0527a' transform='rotate(144 80 90)'/%3E%3Cellipse cx='80' cy='55' rx='14' ry='26' fill='%23c0527a' transform='rotate(216 80 90)'/%3E%3Cellipse cx='80' cy='55' rx='14' ry='26' fill='%23c0527a' transform='rotate(288 80 90)'/%3E%3Ccircle cx='80' cy='90' r='12' fill='%23f4a0b8'/%3E%3Cellipse cx='290' cy='240' rx='13' ry='25' fill='%23c0527a' transform='rotate(15 290 275)'/%3E%3Cellipse cx='290' cy='240' rx='13' ry='25' fill='%23c0527a' transform='rotate(87 290 275)'/%3E%3Cellipse cx='290' cy='240' rx='13' ry='25' fill='%23c0527a' transform='rotate(159 290 275)'/%3E%3Cellipse cx='290' cy='240' rx='13' ry='25' fill='%23c0527a' transform='rotate(231 290 275)'/%3E%3Cellipse cx='290' cy='240' rx='13' ry='25' fill='%23c0527a' transform='rotate(303 290 275)'/%3E%3Ccircle cx='290' cy='275' r='11' fill='%23f4a0b8'/%3E%3Cellipse cx='260' cy='65' rx='7' ry='12' fill='%23d4547c' transform='rotate(0 260 82)'/%3E%3Cellipse cx='260' cy='65' rx='7' ry='12' fill='%23d4547c' transform='rotate(60 260 82)'/%3E%3Cellipse cx='260' cy='65' rx='7' ry='12' fill='%23d4547c' transform='rotate(120 260 82)'/%3E%3Cellipse cx='260' cy='65' rx='7' ry='12' fill='%23d4547c' transform='rotate(180 260 82)'/%3E%3Cellipse cx='260' cy='65' rx='7' ry='12' fill='%23d4547c' transform='rotate(240 260 82)'/%3E%3Cellipse cx='260' cy='65' rx='7' ry='12' fill='%23d4547c' transform='rotate(300 260 82)'/%3E%3Cellipse cx='260' cy='71' rx='5' ry='9' fill='%23c0527a' transform='rotate(30 260 82)'/%3E%3Cellipse cx='260' cy='71' rx='5' ry='9' fill='%23c0527a' transform='rotate(90 260 82)'/%3E%3Cellipse cx='260' cy='71' rx='5' ry='9' fill='%23c0527a' transform='rotate(150 260 82)'/%3E%3Cellipse cx='260' cy='71' rx='5' ry='9' fill='%23c0527a' transform='rotate(210 260 82)'/%3E%3Cellipse cx='260' cy='71' rx='5' ry='9' fill='%23c0527a' transform='rotate(270 260 82)'/%3E%3Cellipse cx='260' cy='71' rx='5' ry='9' fill='%23c0527a' transform='rotate(330 260 82)'/%3E%3Ccircle cx='260' cy='82' r='6' fill='%23e8809a'/%3E%3Cellipse cx='100' cy='295' rx='6' ry='11' fill='%23d4547c' transform='rotate(0 100 312)'/%3E%3Cellipse cx='100' cy='295' rx='6' ry='11' fill='%23d4547c' transform='rotate(60 100 312)'/%3E%3Cellipse cx='100' cy='295' rx='6' ry='11' fill='%23d4547c' transform='rotate(120 100 312)'/%3E%3Cellipse cx='100' cy='295' rx='6' ry='11' fill='%23d4547c' transform='rotate(180 100 312)'/%3E%3Cellipse cx='100' cy='295' rx='6' ry='11' fill='%23d4547c' transform='rotate(240 100 312)'/%3E%3Cellipse cx='100' cy='295' rx='6' ry='11' fill='%23d4547c' transform='rotate(300 100 312)'/%3E%3Cellipse cx='100' cy='301' rx='4' ry='8' fill='%23c0527a' transform='rotate(30 100 312)'/%3E%3Cellipse cx='100' cy='301' rx='4' ry='8' fill='%23c0527a' transform='rotate(90 100 312)'/%3E%3Cellipse cx='100' cy='301' rx='4' ry='8' fill='%23c0527a' transform='rotate(150 100 312)'/%3E%3Cellipse cx='100' cy='301' rx='4' ry='8' fill='%23c0527a' transform='rotate(210 100 312)'/%3E%3Cellipse cx='100' cy='301' rx='4' ry='8' fill='%23c0527a' transform='rotate(270 100 312)'/%3E%3Cellipse cx='100' cy='301' rx='4' ry='8' fill='%23c0527a' transform='rotate(330 100 312)'/%3E%3Ccircle cx='100' cy='312' r='5' fill='%23e8809a'/%3E%3Cellipse cx='175' cy='185' rx='6' ry='13' fill='%23d4789a' transform='rotate(40 175 185)' opacity='0.5'/%3E%3Cellipse cx='355' cy='155' rx='5' ry='10' fill='%23c0527a' transform='rotate(-20 355 155)' opacity='0.4'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  color: var(--ink);
}
body.theme-sakura .topbar { border-bottom-color: var(--line); }
body.theme-sakura .carte-header h1 {
  font-size: 2.7rem; font-weight: 700; font-style: italic; letter-spacing: 0.5px;
}
body.theme-sakura .carte-header p { font-style: italic; }
body.theme-sakura .carte-cat > h2 { font-style: italic; font-weight: 400; font-size: 1.6rem; }
body.theme-sakura .dish-card { border-radius: 18px; border-color: var(--line); }
body.theme-sakura .dish-card.clickable:hover {
  box-shadow: 0 10px 32px rgba(192,82,122,.18);
  border-color: var(--accent);
}
body.theme-sakura .tag-badge { background: #fce8f0; border-color: var(--line); color: var(--accent-dark); }
body.theme-sakura .chip.active { background: var(--accent); border-color: var(--accent); }
body.theme-sakura .detail-head h2 { font-style: italic; }
body.theme-sakura .back-top { border-radius: 12px; }

/* ---- Sélecteur de thème dans l'admin ---- */
.theme-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
}
.theme-opt { position: relative; cursor: pointer; }
.theme-opt input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-opt .swatch {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 8px; border: 2px solid var(--line); border-radius: 12px;
  transition: all .12s ease; user-select: none; text-align: center;
}
.theme-opt input:checked + .swatch {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,121,58,.25);
}
.theme-opt .swatch:hover { border-color: var(--accent); }
.theme-opt .swatch-dots {
  display: flex; gap: 5px; justify-content: center;
}
.theme-opt .swatch-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08);
}
.theme-opt .swatch-name {
  font-size: 0.82rem; font-weight: 600; color: var(--ink);
}
.theme-opt .swatch-font {
  font-size: 0.76rem; color: var(--muted);
}

/* ---- Multi-photo gallery ---- */
.photo-wrap {
  position: relative;
  flex: 0 0 70%;
  align-self: stretch;
  overflow: hidden;
}
.photo-count-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  pointer-events: none;
}

/* Detail popup gallery */
.detail-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #111;
}
.detail-gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
  cursor: zoom-in;
}
.detail-gallery-img.active { opacity: 1; }

.detail-gallery-nav {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.gal-prev, .gal-next {
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.gal-prev:hover, .gal-next:hover { background: rgba(0,0,0,.8); }
.gal-dots { display: flex; gap: 5px; align-items: center; }
.gal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.gal-dot.active {
  background: #fff;
  transform: scale(1.3);
}
