/* lakay.css : identité Lakay (spec docs/superpowers/specs/2026-10-14-lakay-redesign-design.md).
   Chargée APRÈS style.css sur les pages client. PR 1 : tokens, base, composants partagés,
   en-tête, menu mobile, pied de page, mouvement. Les pages migrent ici une par une (PR 2 à 7). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque-latin-wght.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --lk-font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --lk-bg: #EEF3F1;
  --lk-surface: #FBFDFC;
  --lk-surface-2: #E3EBE7;
  --lk-deep: #0F2A24;
  --lk-on-deep: #EEF3F1;
  --lk-ink: #0F2A24;
  --lk-ink-2: #3D5A52;
  --lk-line: #D5E1DC;
  --lk-accent: #DA0A1B;
  --lk-on-accent: #FFFFFF;
  --lk-brand-ink: #121D2B;
  --lk-ok: #1F7A55;
  --lk-err: #B42318;
  --lk-warn: #9A6200;
  --lk-shadow: 0 12px 32px -16px rgb(15 42 36 / 0.28);
  --lk-r-pill: 999px;
  --lk-r-card: 24px;
  --lk-r-field: 14px;
  --lk-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --lk-dur-fast: 150ms;
  --lk-dur: 250ms;
  --lk-dur-slow: 450ms;
  --lk-header-h: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --lk-bg: #0B1C18;
  --lk-surface: #13291F;
  --lk-surface-2: #1A3329;
  --lk-deep: #E7F0EC;
  --lk-on-deep: #0B1C18;
  --lk-ink: #E7F0EC;
  --lk-ink-2: #A9BDB5;
  --lk-line: #22403A;
  --lk-accent: #FF5A63;
  --lk-on-accent: #0B1C18;
  --lk-brand-ink: #E7F0EC;
  --lk-ok: #5FD3A1;
  --lk-err: #FF8A80;
  --lk-warn: #F5C26B;
  --lk-shadow: 0 12px 32px -16px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

/* ─── Base ─────────────────────────────────────────────── */
body { font-family: var(--lk-font); background: var(--lk-bg); color: var(--lk-ink); font-size: 1rem; line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--lk-font); color: var(--lk-ink); letter-spacing: -0.02em; }
h1 { font-weight: 800; letter-spacing: -0.03em; }
:focus-visible { outline: 3px solid var(--lk-accent); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--lk-accent) 22%, transparent); }
.tnum { font-variant-numeric: tabular-nums; }
.skip-link { background: var(--lk-deep); color: var(--lk-on-deep); border-radius: var(--lk-r-pill); }

/* Logo rouge et noir : version claire / nuit (spec D15) */
.logo-night { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-night { display: inline-block; }

/* ─── Composants partagés (classes historiques restylées) ─── */
.btn {
  border-radius: var(--lk-r-pill);
  font-family: var(--lk-font);
  font-weight: 700;
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  transition: transform var(--lk-dur-fast) var(--lk-ease-out), box-shadow var(--lk-dur) var(--lk-ease-out), background-color var(--lk-dur) var(--lk-ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--lk-accent); color: var(--lk-on-accent); border-color: transparent; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--lk-accent) 88%, #000); color: var(--lk-on-accent); }
.btn-secondary { background: transparent; color: var(--lk-ink); border-color: transparent; box-shadow: inset 0 0 0 1.5px var(--lk-ink); }
.btn-secondary:hover { background: var(--lk-surface-2); color: var(--lk-ink); }
.btn-ghost { background: transparent; color: var(--lk-ink-2); }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--lk-accent) 70%, transparent); }
}
.form-input, .form-select, .form-textarea {
  font-family: var(--lk-font);
  font-size: 1rem;
  color: var(--lk-ink);
  background: var(--lk-surface);
  border: 1.5px solid var(--lk-line);
  border-radius: var(--lk-r-field);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--lk-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lk-accent) 20%, transparent);
}
.form-label { font-weight: 600; color: var(--lk-ink); }
.card, .order-card, .feature-card, .step-card, .service-card, .auth-card { border-radius: var(--lk-r-card); }
.badge { border-radius: var(--lk-r-pill); }
/* Cartes de la page commande (grille) : sans ça, un libellé créole long élargit la colonne au-delà de l'écran. */
.order-form-card, .order-summary-card { min-width: 0; }

/* ─── En-tête ──────────────────────────────────────────── */
.lk-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--lk-bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--lk-line);
}
@supports not (backdrop-filter: blur(1px)) { .lk-header { background: var(--lk-bg); } }
.lk-nav { max-width: 1200px; margin: 0 auto; height: var(--lk-header-h); padding: 0 16px; display: flex; align-items: center; gap: 24px; }
.lk-brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; flex: none; }
.lk-mark { height: 32px; width: auto; }
.lk-word { height: 18px; width: auto; }
.lk-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.lk-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--lk-r-pill);
  color: var(--lk-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.lk-links a:hover { background: var(--lk-surface-2); }
.lk-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lk-actions .btn { white-space: nowrap; }
.lk-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--lk-r-pill);
  border: 0;
  background: transparent;
  color: var(--lk-ink);
  cursor: pointer;
  position: relative;
}
.lk-icon-btn:hover { background: var(--lk-surface-2); color: var(--lk-ink); }
.lk-icon-btn svg { width: 20px; height: 20px; }
.lk-header .lang-switch { border-color: var(--lk-line); }
.lk-header .lang-option, .lk-sheet .lang-option { min-height: 32px; display: inline-flex; align-items: center; color: var(--lk-ink-2); }
.lk-sheet .lang-option { min-height: 44px; min-width: 44px; justify-content: center; }
.lk-header .lang-option.is-active, .lk-sheet .lang-option.is-active { background: var(--lk-deep); color: var(--lk-on-deep); }
.lk-header .cart-badge { background: var(--lk-accent); color: var(--lk-on-accent); }
/* style.css impose display:inline-flex, qui écrasait [hidden] : panier vide → « 0 » affiché */
.cart-badge[hidden] { display: none; }
#mobileMenuToggle { display: none; }
/* Le français a besoin de 1 103 px sur une ligne (mesuré) : en dessous de 1 150 px, menu. */
@media (max-width: 1149px) {
  .lk-nav { gap: 8px; }
  .lk-links, .lk-header .lang-switch { display: none; }
  .lk-header #navAuthGuest, .lk-header #navAuthUser { display: none !important; }
  #mobileMenuToggle { display: inline-grid; }
}
/* Sous 360 px : la marque (366 px avec les icônes) passe au monogramme seul,
   et les onglets de commande (mot le plus long > 1fr) s'empilent. */
@media (max-width: 359px) {
  .lk-header .lk-word { display: none; }
  .order-type-tabs { grid-template-columns: 1fr; }
}

/* ─── Menu mobile : <dialog> natif (Échap, focus, fond gérés par le navigateur) ─── */
.lk-sheet {
  margin: auto 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 85dvh;
  border: 0;
  padding: 0;
  border-radius: var(--lk-r-card) var(--lk-r-card) 0 0;
  background: var(--lk-surface);
  color: var(--lk-ink);
  box-shadow: var(--lk-shadow);
  transform: translateY(100%);
  transition: transform 200ms ease-in, overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.lk-sheet[open] { transform: none; transition-duration: 320ms; transition-timing-function: var(--lk-ease-out); }
@starting-style { .lk-sheet[open] { transform: translateY(100%); } }
.lk-sheet::backdrop { background: rgb(11 28 24 / 0.45); }
.lk-sheet-inner { padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 4px; }
.lk-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.lk-sheet-links { list-style: none; margin: 0; padding: 0; display: grid; }
.lk-sheet-links a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 8px;
  border-radius: var(--lk-r-field);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--lk-ink);
  text-decoration: none;
}
.lk-sheet-links a:hover { background: var(--lk-surface-2); }
.lk-sheet .lang-switch { margin: 8px 0; justify-self: start; }
.lk-sheet-auth { display: grid; gap: 8px; margin-top: 8px; }
.lk-sheet-auth .btn { width: 100%; justify-content: center; }
.lk-sheet-user { display: none; }
html[data-auth="user"] .lk-sheet-guest { display: none; }
html[data-auth="user"] .lk-sheet-user { display: grid; }

/* ─── Pied de page ─────────────────────────────────────── */
.lk-footer { background: var(--lk-surface-2); color: var(--lk-ink-2); margin-top: 64px; padding: 48px 0 24px; }
.lk-footer-grid { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .lk-footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.lk-footer h4 { font-size: 0.875rem; color: var(--lk-ink); margin: 0 0 8px; }
.lk-footer ul { list-style: none; margin: 0; padding: 0; display: grid; }
.lk-footer a { color: var(--lk-ink-2); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.lk-footer a:hover { color: var(--lk-accent); }
.lk-footer p { margin: 12px 0 0; max-width: 36ch; }
.lk-footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 16px 16px 0;
  border-top: 1px solid var(--lk-line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.875rem;
}

/* ─── Pilules des services populaires (remplace le coverflow) ─── */
.lk-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.lk-pills::-webkit-scrollbar { display: none; }
.lk-pill {
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 16px 6px 6px;
  border-radius: var(--lk-r-pill);
  background: var(--lk-surface);
  border: 1px solid var(--lk-line);
  color: var(--lk-ink);
  font-weight: 600;
  text-decoration: none;
}
/* Pastille blanche : les logos noirs (TikTok, Apple…) restent lisibles en nuit */
.lk-pill img { width: 30px; height: 30px; padding: 4px; border-radius: 50%; background: #FFFFFF; }
@media (min-width: 900px) { .lk-pills { flex-wrap: wrap; justify-content: center; overflow: visible; } }

/* ─── Mouvement (spec §5) ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--lk-dur-slow) var(--lk-ease-out), transform var(--lk-dur-slow) var(--lk-ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 60ms; }
.reveal:nth-child(3) { transition-delay: 120ms; }
.reveal:nth-child(4) { transition-delay: 180ms; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
