/* =========================================================================
   MoMA Coffee — feuille de style principale
   Mobile-first, sans framework, conçue pour un menu consulté au comptoir.
   ========================================================================= */

/* --- Polices auto-hébergées (aucune requête externe, meilleure perf/RGPD) --- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Couleurs de marque (extraites du logo MoMA Coffee) */
  --color-primary: #8c1010;
  --color-primary-dark: #6e0d0d;
  --color-primary-light: #f3dede;

  /* Neutres chaleureux (interprétation web du gris du menu papier) */
  --color-ink: #2c2622;
  --color-body: #4a4038;
  --color-muted: #726351; /* contraste 5.4:1 sur --color-bg, conforme WCAG AA */

  /* Fonds */
  --color-bg: #fbf6ef;
  --color-surface: #f4ece1;
  --color-border: #e3d5c4;

  /* Footer (contraste sombre, chaleureux) */
  --color-footer-bg: #2b0a0a;
  --color-footer-text: #f4ece1;
  --color-footer-muted: #c9a9a4;

  /* Typo */
  --font-heading: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Rayons / ombres */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(44, 38, 34, 0.06);
  --shadow-md: 0 8px 24px rgba(44, 38, 34, 0.08);

  /* Largeur max de contenu */
  --content-width: 720px;

  /* Hauteur de la barre de nav catégories (utilisée pour le scroll-margin) */
  --nav-height: 56px;
  --header-height: 64px;
}

/* --- Reset léger --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font-family: inherit;
}

/* --- Accessibilité -------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--color-primary-dark);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Header ---------------------------------------------------------------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__logo {
  height: 50px;
  width: auto;
}

@media (min-width: 480px) {
  .brand__logo {
    height: 60px;
  }
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.lang-switch__link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.lang-switch__link:hover,
.lang-switch__link:focus-visible {
  background: var(--color-primary);
  color: #fff;
}

.lang-switch__link.is-active {
  background: var(--color-primary);
  color: #fff;
}

/* --- Barre de navigation des catégories (sticky, scroll horizontal) ------- */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.category-nav__scroller {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 16px;
  -webkit-overflow-scrolling: touch;
}
.category-nav__scroller::-webkit-scrollbar {
  display: none;
}

.category-nav__link {
  flex: 0 0 auto;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-body);
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 16px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  scroll-snap-align: start;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-nav__link:hover {
  border-color: var(--color-primary);
}

.category-nav__link.is-active {
  background: var(--color-primary);
  color: #fff;
}

/* --- Intro / description du café ------------------------------------------ */
.intro {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 20px 4px;
}

.intro__text {
  font-size: 14.5px;
  color: var(--color-muted);
  line-height: 1.6;
}

.intro__text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intro__toggle {
  margin-top: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-primary);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  min-height: 32px;
}

/* --- Contenu du menu -------------------------------------------------------- */
.menu {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 8px 16px 40px;
}

.category {
  scroll-margin-top: calc(var(--nav-height) + 12px);
  padding-top: 28px;
}

.category__header {
  border-bottom: 2px solid var(--color-ink);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.category__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--color-ink);
  text-transform: uppercase;
}

.category__note {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--color-primary);
  font-weight: 600;
}

.category__empty {
  padding: 14px 0 6px;
  color: var(--color-muted);
  font-size: 14.5px;
  font-style: italic;
}

.product {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
}

.category__list > .product:last-child {
  border-bottom: none;
}

.product__info {
  min-width: 0;
}

.product__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  color: var(--color-ink);
}

.product__badge {
  font-family: var(--font-heading);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--color-primary);
}

.product__description {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--color-muted);
  line-height: 1.45;
}

.product__allergens {
  margin-top: 3px;
  font-size: 11px;
  color: var(--color-muted);
  opacity: 0.75;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.product__allergens-label {
  font-weight: 600;
}

.product__prices {
  flex: 0 0 auto;
  text-align: right;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-ink);
  white-space: nowrap;
}

.product__price-line {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.product__price-label {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-muted);
  font-size: 13px;
}

/* --- Bouton retour en haut -------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md);
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
}
.back-to-top.is-visible {
  display: flex;
}

/* --- Footer ------------------------------------------------------------------ */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 40px 20px 28px;
}

.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.site-footer__brand {
  height: 50px;
  width: auto;
}

.site-footer__block {
  font-size: 14px;
  line-height: 1.7;
}

.site-footer__block a {
  text-decoration: underline;
  text-decoration-color: rgba(244, 236, 225, 0.4);
}
.site-footer__block a:hover {
  text-decoration-color: var(--color-footer-text);
}

.site-footer__heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-footer-muted);
  margin-bottom: 8px;
}
.site-footer__heading--spaced {
  margin-top: 16px;
}

.site-footer__blurb {
  margin-top: 14px;
  color: var(--color-footer-muted);
  max-width: 32ch;
}

.site-footer__socials {
  display: flex;
  gap: 14px;
}

.site-footer__socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(244, 236, 225, 0.1);
}
.site-footer__socials a:hover {
  background: rgba(244, 236, 225, 0.2);
}

.site-footer__bottom {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 236, 225, 0.15);
  font-size: 12.5px;
  color: var(--color-footer-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

/* --- Popup d'annonce (rappel paiement, fermeture exceptionnelle...) --------- */
/* Rendu masqué côté PHP (attribut `hidden`) ; affiché par assets/js/menu.js
   au chargement de la page. Générique : le contenu vient de
   restaurant.announcement dans data/menu.json, réutilisable pour n'importe
   quel message court (voir /admin). */
.announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(44, 38, 34, 0.55);
}

/* Sans cette règle, l'attribut HTML `hidden` posé par PHP puis reposé par
   assets/js/menu.js (à la fermeture) n'a aucun effet visuel : une règle
   d'auteur sur un sélecteur de classe (`.announcement-overlay`) prime
   toujours sur la règle par défaut du navigateur `[hidden] { display:
   none }`, donc le popup restait affiché à l'écran (et continuait à
   bloquer les clics) même une fois fermé. */
.announcement-overlay[hidden] {
  display: none;
}

.announcement-modal {
  position: relative;
  max-width: 380px;
  width: 100%;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 32px 24px 24px;
  text-align: center;
}

.announcement-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  line-height: 1;
  font-size: 22px;
  color: var(--color-muted);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.announcement-modal__close:hover,
.announcement-modal__close:focus-visible {
  background: var(--color-surface);
  color: var(--color-ink);
}

.announcement-modal__message {
  color: var(--color-ink);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.announcement-modal__message:last-of-type {
  margin-bottom: 20px;
}

/* Étiquette de langue (FR/EN/NL), affichée seulement quand le message est
   rempli dans plusieurs langues — sinon la ligne unique reste comme avant. */
.announcement-modal__lang {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin-right: 6px;
}

.announcement-modal__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 12px 0;
}

.announcement-modal__ok {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  cursor: pointer;
}

.announcement-modal__ok:hover,
.announcement-modal__ok:focus-visible {
  background: var(--color-primary-dark);
}

/* Empêche le défilement de l'arrière-plan tant que le popup est ouvert. */
body.has-announcement-open {
  overflow: hidden;
}

/* --- Utilitaires responsives ------------------------------------------------- */
@media (min-width: 768px) {
  .category__title {
    font-size: 24px;
  }
  .product__name {
    font-size: 17px;
  }
}
