/* Atelia · aperçu « comme sur Uber Eats »
   ----------------------------------------------------------------------------------------
   Deux mondes dans un seul fichier, et il ne faut pas les mélanger :

   1. LA COUCHE ATELIA (préfixe .apu-couche, .apu-barre…) : le cadre autour du téléphone —
      titre, bascule « Carte actuelle / Carte refaite », boutons de validation, fermeture.
      Elle a le droit de ressembler au reste de la maquette.

   2. LE TÉLÉPHONE (préfixe .ue-) : à l'intérieur, on imite l'application que le client a
      dans la main. Donc : fond blanc, texte noir très gras, coins arrondis de 12 px, boutons
      noirs pleine largeur, onglets de catégories collants. Pas un seul jeton de couleur
      Atelia là-dedans, sinon l'aperçu ne prouve plus rien. Aucune marque, aucun logo tiers :
      les visuels de plats sont dessinés (dégradé + tracé), jamais téléchargés.

   Le téléphone mesure 390 × 780 sur la console et prend tout l'écran sur la surface mobile. */

/* ======================================================================================== */
/* 1. La couche Atelia                                                                      */
/* ======================================================================================== */
.apu-couche {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  background: rgba(14, 16, 22, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  animation: apu-apparait .16s ease-out;
}
@keyframes apu-apparait { from { opacity: 0; } to { opacity: 1; } }

.apu-barre {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: #11141b;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.apu-barre-titre { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.apu-barre-titre b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.apu-barre-sous { font-size: 12px; color: rgba(255, 255, 255, .62); margin-top: 2px; }

/* Bascule actuelle / refaite : deux onglets dans une gélule. */
.apu-bascule {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}
.apu-bascule button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.apu-bascule button:hover { color: #fff; }
.apu-bascule button.is-on { background: #fff; color: #11141b; }

.apu-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apu-btn {
  appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #fff;
  white-space: nowrap;
}
.apu-btn:hover { background: rgba(255, 255, 255, .1); }
.apu-btn-valider { background: #12b76a; border-color: #12b76a; color: #06251a; }
.apu-btn-valider:hover { background: #0fa35e; }
.apu-btn-fermer { min-width: 84px; }

/* Bandeau de comparaison sous la barre (visible sur la carte refaite). */
.apu-note {
  flex: 0 0 auto;
  padding: 8px 18px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .80);
  /* fond opaque : sur la surface mobile la couche passe en blanc, un fond translucide
     rendrait ce bandeau blanc sur blanc — donc illisible */
  background: #1b1f29;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.apu-note b { color: #fff; font-weight: 700; }

.apu-scene {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

/* ======================================================================================== */
/* 2. Le téléphone                                                                          */
/* ======================================================================================== */
.ue-tel {
  width: 390px;
  height: 780px;
  max-height: 100%;
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  color: #000;
  border-radius: 38px;
  border: 9px solid #0b0d12;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
  font-size: 15px;
  line-height: 1.32;
  -webkit-font-smoothing: antialiased;
}
/* Plein écran sur la surface mobile : plus de cadre, plus de coins. */
.apu-couche[data-plein="1"] { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.apu-couche[data-plein="1"] .apu-scene { padding: 0; align-items: stretch; }
.apu-couche[data-plein="1"] .ue-tel {
  width: 100%; height: 100%; max-height: none;
  border: 0; border-radius: 0; box-shadow: none;
}

/* Barre d'état simulée. */
.ue-statut {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px 4px;
  font-size: 14px; font-weight: 700;
}
.ue-statut-icones { display: flex; align-items: center; gap: 5px; }

/* Zone défilante : c'est elle qui porte les trois écrans. */
.ue-vue {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scroll-behavior: smooth;
}
.ue-vue::-webkit-scrollbar { width: 0; height: 0; }

/* --- éléments communs ------------------------------------------------------------------ */
.ue-h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.ue-h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; }
.ue-gris { color: #6b6b6b; }
.ue-pad { padding-left: 16px; padding-right: 16px; }

.ue-rond {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  color: #000;
}
.ue-rond:hover { background: #fff; }
.ue-rond-sombre { background: rgba(0, 0, 0, .55); color: #fff; }
.ue-rond-sombre:hover { background: rgba(0, 0, 0, .7); }

/* Visuel de plat : dégradé + tracé. Jamais une image externe. */
.ue-photo {
  display: block; width: 100%; height: 100%;
  border-radius: 12px; overflow: hidden; background: #ececec;
}
.ue-photo svg { display: block; width: 100%; height: 100%; }
.ue-photo-vide {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 12px;
  background: repeating-linear-gradient(135deg, #f1f1f1 0 8px, #e8e8e8 8px 16px);
  color: #9a9a9a; font-size: 11px; font-weight: 600; text-align: center; padding: 6px;
}

/* --- écran 1 : le fil d'accueil --------------------------------------------------------- */
.ue-accueil-tete {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 10px;
}
.ue-adresse { display: flex; align-items: center; gap: 4px; font-size: 19px; font-weight: 800; }

.ue-puces { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 14px; }
.ue-puces::-webkit-scrollbar { display: none; }
.ue-puce {
  flex: 0 0 auto; border: 0; cursor: default;
  background: #f3f3f3; color: #000;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
}
.ue-puce.is-on { background: #000; color: #fff; }

.ue-section-titre {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 12px;
}

.ue-carte { padding: 0 16px 22px; }
.ue-carte-lien { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.ue-carte-photo { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; }
.ue-carte-coeur { position: absolute; top: 10px; right: 10px; }
.ue-carte-etiq {
  position: absolute; left: 10px; top: 10px;
  background: #fff; color: #000; font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 6px;
}
.ue-carte-nom { font-size: 17px; font-weight: 800; margin: 10px 0 2px; letter-spacing: -.01em; }
.ue-carte-ligne { font-size: 14px; color: #545454; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ue-carte-note { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: #000; }
.ue-carte-badge {
  background: #eaf6ee; color: #167a3d; font-size: 12.5px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px;
}

/* --- écran 2 : la page du restaurant ---------------------------------------------------- */
.ue-couverture { position: relative; width: 100%; height: 170px; overflow: hidden; }
.ue-couverture svg { display: block; width: 100%; height: 100%; }
.ue-couverture-outils {
  position: absolute; inset: 12px 12px auto 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.ue-couverture-droite { display: flex; gap: 8px; }

/* la tête remonte sur la couverture : il lui faut son propre plan, sinon la couverture
   (position: relative) repeint par-dessus et coupe le logo rond en deux */
.ue-resto-tete { position: relative; z-index: 1; text-align: center; padding: 0 16px 8px; margin-top: -34px; }
.ue-logo {
  width: 74px; height: 74px; border-radius: 50%;
  margin: 0 auto 10px; background: #fff;
  border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ue-logo b { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.ue-resto-meta { font-size: 15px; color: #000; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.ue-resto-meta .ue-gris { color: #6b6b6b; }
.ue-resto-lieu { font-size: 14px; color: #6b6b6b; margin-top: 4px; }
.ue-resto-reorder {
  display: inline-block; margin-top: 10px;
  background: #eaf6ee; color: #167a3d;
  font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 8px;
}

/* Segment Livraison / À emporter. */
.ue-segment {
  display: inline-flex; margin: 16px 16px 0;
  padding: 3px; border-radius: 999px; background: #f3f3f3;
}
.ue-segment button {
  border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 600;
  color: #6b6b6b; padding: 9px 22px; border-radius: 999px; cursor: pointer;
}
.ue-segment button.is-on { background: #fff; color: #000; font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

.ue-tuiles {
  display: grid; grid-template-columns: 1fr 1fr;
  margin: 16px; border: 1px solid #e4e4e4; border-radius: 10px; overflow: hidden;
}
.ue-tuile { padding: 14px 10px; text-align: center; }
.ue-tuile + .ue-tuile { border-left: 1px solid #e4e4e4; }
.ue-tuile b { display: block; font-size: 15px; font-weight: 700; }
.ue-tuile span { display: block; font-size: 13.5px; color: #6b6b6b; margin-top: 2px; }

/* Onglets de catégories collants. */
.ue-onglets {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 16px; background: #fff;
  border-bottom: 1px solid #ececec;
}
.ue-onglets::-webkit-scrollbar { display: none; }
.ue-onglet {
  flex: 0 0 auto; border: 0; cursor: pointer;
  background: #f3f3f3; color: #000;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
}
.ue-onglet.is-on { background: #000; color: #fff; }

.ue-cat { padding: 22px 16px 4px; }
.ue-cat-titre { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.ue-cat-compte { font-size: 13.5px; color: #6b6b6b; margin-bottom: 8px; }

/* Ligne de plat. */
.ue-plat {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; text-align: left; border: 0; background: transparent;
  font: inherit; color: inherit; cursor: pointer;
  padding: 14px 0; border-bottom: 1px solid #ececec;
}
.ue-plat:last-child { border-bottom: 0; }
.ue-plat:hover { background: #fafafa; }
.ue-plat-texte { flex: 1 1 auto; min-width: 0; }
.ue-plat-nom { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 2px; }
.ue-plat-prix { font-size: 15px; color: #000; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ue-plat-aime { color: #6b6b6b; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.ue-plat-desc {
  margin-top: 5px; font-size: 14px; color: #6b6b6b;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ue-plat-manque { margin-top: 5px; font-size: 13.5px; color: #b42318; font-style: italic; }
.ue-plat-vignette { flex: 0 0 auto; position: relative; width: 92px; height: 92px; }
.ue-plat-plus {
  position: absolute; right: -6px; bottom: -6px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 600; line-height: 1; color: #000;
}
.ue-etiq-top {
  display: inline-block; margin-bottom: 5px;
  background: #eaf6ee; color: #167a3d;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
/* Pastille « modifié » : uniquement sur la carte refaite, pour voir ce qu'Atelia a touché. */
.ue-etiq-modif {
  display: inline-block; margin-bottom: 5px; margin-right: 6px;
  background: #eef2ff; color: #3538cd;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}

/* --- écran 3 : la fiche d'un plat ------------------------------------------------------- */
.ue-plat-photo { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #f5f5f5; overflow: hidden; }
.ue-plat-photo svg { display: block; width: 100%; height: 100%; }
.ue-plat-photo .ue-photo-vide { border-radius: 0; }
.ue-plat-outils { position: absolute; inset: 12px 12px auto 12px; display: flex; justify-content: space-between; }

.ue-fiche { padding: 20px 16px 8px; }
.ue-fiche h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 10px; }
.ue-fiche-prix { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.ue-fiche-desc { font-size: 15px; color: #4a4a4a; line-height: 1.45; margin-bottom: 14px; }
.ue-fiche-desc.ue-manque { color: #b42318; font-style: italic; }
.ue-fiche-etiqs { display: flex; gap: 8px; flex-wrap: wrap; }
.ue-fiche-etiq {
  background: #f3f3f3; color: #000; font-size: 13.5px; font-weight: 600;
  padding: 7px 11px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px;
}

.ue-sep { height: 8px; background: #f3f3f3; margin: 18px 0 0; }

.ue-groupe { padding: 20px 16px 4px; }
.ue-groupe-titre { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.ue-groupe-regle { font-size: 15px; color: #6b6b6b; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ue-groupe-oblig { color: #157347; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

.ue-choix {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; border: 0; background: transparent; font: inherit; color: inherit;
  cursor: pointer; padding: 15px 0; border-bottom: 1px solid #ececec;
}
.ue-choix:last-child { border-bottom: 0; }
.ue-choix-nom { font-size: 16px; font-weight: 600; }
.ue-choix-sup { font-size: 15px; color: #6b6b6b; margin-left: 8px; font-weight: 400; }
.ue-marque {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #c9c9c9; display: flex; align-items: center; justify-content: center;
}
.ue-marque-carre { border-radius: 6px; }
.ue-marque.is-on { border-color: #000; background: #000; }
.ue-marque.is-on::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.ue-marque-carre.is-on::after {
  content: ''; width: 10px; height: 6px; border-radius: 0; background: transparent;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -2px);
}

.ue-quantite { display: flex; align-items: center; gap: 14px; padding: 22px 16px 10px; }
.ue-quantite-b {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid #d5d5d5;
  background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: #000;
}
.ue-quantite-b:disabled { opacity: .35; cursor: not-allowed; }
.ue-quantite b { font-size: 17px; font-weight: 700; min-width: 20px; text-align: center; }

/* Barre basse : le bouton noir pleine largeur. */
.ue-bas {
  flex: 0 0 auto;
  padding: 12px 16px 18px;
  background: #fff;
  border-top: 1px solid #ececec;
}
.ue-ajouter {
  width: 100%; border: 0; cursor: pointer;
  background: #000; color: #fff;
  font: inherit; font-size: 16px; font-weight: 700;
  padding: 16px; border-radius: 999px;
}
.ue-ajouter:hover { background: #1a1a1a; }
.ue-ajouter-note { display: block; text-align: center; font-size: 12px; color: #8a8a8a; margin-top: 8px; }

/* Barre de navigation basse de l'écran d'accueil. */
.ue-nav {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-around;
  padding: 10px 14px 16px; border-top: 1px solid #ececec; background: #fff;
}
.ue-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: #8a8a8a; }
.ue-nav-item.is-on { color: #000; font-weight: 700; }

/* Message honnête si la carte demandée n'existe pas. */
.ue-vide { padding: 60px 24px; text-align: center; color: #6b6b6b; font-size: 15px; }

/* --- écrans étroits --------------------------------------------------------------------- */
@media (max-width: 760px) {
  .apu-scene { padding: 0; align-items: stretch; }
  .ue-tel { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  /* En étroit, l'en-tête tient en deux rangées : le titre, puis la bascule et les boutons
     côte à côte. Une rangée par bloc mangeait près du tiers de la hauteur du téléphone. */
  .apu-barre { padding: 9px 12px; gap: 8px; }
  .apu-barre-titre { width: 100%; margin-right: 0; }
  .apu-barre-titre b { font-size: 14px; }
  .apu-bascule { flex: 1 1 auto; }
  .apu-bascule button { flex: 1 1 0; padding: 7px 10px; }
  .apu-actions { flex: 0 1 auto; gap: 6px; }
  .apu-btn { text-align: center; padding: 8px 12px; }
  .apu-btn-fermer { min-width: 0; }
  .apu-note { padding: 7px 12px; font-size: 12px; }
}
@media (max-height: 880px) and (min-width: 761px) {
  .ue-tel { height: 100%; }
}

/* S-13 · aperçu compact en lecture, en bas de la fiche latérale du Réseau (aucun bouton). */
.apu-mini { font-family: var(--font); background: var(--surface); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.apu-mini .apu-mini-couv { height: 120px; }
.apu-mini .ue-resto-tete { padding-bottom: 6px; }
.apu-mini .ue-plat { cursor: default; }
.apu-mini .ue-plat:hover { background: transparent; }
.apu-mini .ue-plat-vignette { width: 76px; height: 76px; }
