/* Hatyb — styles des composants.
 * Couleurs : variables --md-* de theme.css (générées depuis AppTheme de l'app).
 * Mesures reprises de l'app (Material 3 + surcharges de lib/shared/app_theme.dart
 * et des widgets merchant_card.dart / directory_screen.dart / filter_sheet.dart). */

/* ---------- Polices (mêmes que l'app : Roboto + MaterialIcons de Flutter) ---------- */
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url("../fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url("../fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url("../fonts/roboto-700.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 800 900; font-display: swap; src: url("../fonts/roboto-900.woff2") format("woff2"); }
@font-face { font-family: "MaterialIcons"; font-weight: 400; font-display: block; src: url("../fonts/material-icons.woff2") format("woff2"); }

/* ---------- Échelle typographique Material 3 (Flutter 2021) + surcharges AppTheme ---------- */
:root {
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --content-max: 1200px;
  --appbar-bg: var(--md-surface);
  --ease: cubic-bezier(.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 150px; }
body {
  margin: 0;
  font: 400 14px/20px var(--font);
  letter-spacing: .25px;
  color: var(--md-on-surface);
  background: var(--md-surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.title-large  { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.3px; }
.title-medium { font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; }
/* Texte secondaire : onSurfaceVariant (≥ 4,5:1). « outline » (4,2:1, comme l'app) est réservé aux bordures et icônes. */
.muted { color: var(--md-on-surface-variant); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 12px; background: var(--md-primary); color: var(--md-on-primary); }
.skip-link:focus { top: 8px; }
.no-js .js-only, [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }

/* Icônes : glyphes MaterialIcons (points de code de Flutter Icons.*). */
.mi {
  font-family: "MaterialIcons"; font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased; flex: none;
}
.mi--star { color: #ffc107; font-size: 16px; vertical-align: -3px; }
.mi--inline { font-size: 15px; vertical-align: -3px; }

/* ---------- Barre d'application (AppBar) ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--appbar-bg);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.appbar.is-scrolled { box-shadow: 0 1px 2px rgba(0, 0, 0, .12); background: color-mix(in srgb, var(--md-surface) 92%, var(--md-primary)); }
.appbar__row, .searchbar { max-width: var(--content-max); margin: 0 auto; }
.appbar__row { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 0 12px 0 var(--gutter); }
.appbar__title {
  font-size: 20px; line-height: 28px; font-weight: 800; letter-spacing: -.3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__logo { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; flex: none; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__title { font-size: 20px; line-height: 28px; font-weight: 800; letter-spacing: -.3px; }
.brand__subtitle { font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--md-on-surface-variant); }

/* Recherche : champ en pilule (rayon 28), rempli, sans bordure ; bordure primaire 1,6 px au focus. */
.searchbar { display: flex; align-items: center; gap: 8px; padding: 0 12px 10px var(--gutter); }
.search-field {
  flex: 1; display: flex; align-items: center; min-height: 48px; border-radius: 28px;
  background: color-mix(in srgb, var(--md-surface-container-highest) 60%, transparent);
  border: 1.6px solid transparent; padding: 0 4px 0 12px;
}
.search-field:focus-within { border-color: var(--md-primary); }
.search-field__icon { color: var(--md-on-surface-variant); margin-right: 12px; }
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 16px; line-height: 24px; letter-spacing: .5px; padding: 12px 0;
}
.search-field input::placeholder { color: var(--md-on-surface-variant); }
.search-field input::-webkit-search-cancel-button { display: none; }

/* ---------- Boutons ---------- */
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--md-on-surface-variant); flex: none;
}
.icon-btn:hover { background: color-mix(in srgb, var(--md-on-surface-variant) 8%, transparent); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .mi { font-size: 20px; }
.tonal-btn {
  position: relative; min-width: 40px; height: 40px; border-radius: 20px; border: 0; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px;
  background: var(--md-secondary-container); color: var(--md-on-secondary-container);
}
.tonal-btn:hover { background: color-mix(in srgb, var(--md-secondary-container) 92%, var(--md-on-secondary-container)); }
.tonal-btn:disabled { opacity: .38; cursor: default; }
.tonal-btn--sm { min-width: 32px; height: 32px; padding: 0 4px; }
.tonal-btn--sm .mi { font-size: 20px; }
.tonal-btn--text { padding: 0 24px; font-weight: 500; letter-spacing: .1px; }
.tonal-btn.has-badge::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--md-error);
}
.filled-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border: 0; border-radius: 12px; cursor: pointer; font-weight: 500; letter-spacing: .1px;
  background: var(--md-primary); color: var(--md-on-primary);
}
.filled-btn:hover { background: color-mix(in srgb, var(--md-primary) 92%, var(--md-on-primary)); }
.filled-btn--block { width: 100%; }
.text-btn {
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 20px; background: transparent; cursor: pointer;
  color: var(--md-primary); font-weight: 500; letter-spacing: .1px;
}
.text-btn:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }

/* ---------- Puces (chips) : stade, bordure outline-variant (chipTheme de l'app) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px; border-radius: 16px;
  border: 1px solid var(--md-outline-variant); background: transparent; white-space: nowrap; cursor: pointer;
  font-weight: 500; letter-spacing: .1px; color: var(--md-on-surface-variant);
}
.chip:hover { background: color-mix(in srgb, var(--md-on-surface-variant) 8%, transparent); }
.chip--action { padding-left: 8px; color: var(--md-on-surface); }
.chip__icon { font-size: 18px; color: var(--md-primary); }
.chip--filter input { position: absolute; opacity: 0; pointer-events: none; }
.chip--filter:has(input:checked) { background: var(--md-secondary-container); border-color: transparent; color: var(--md-on-secondary-container); padding-left: 8px; }
.chip--filter:has(input:checked)::before { content: "\2713"; font-weight: 700; width: 18px; text-align: center; }
.chip--filter:has(input:focus-visible) { outline: 2px solid var(--md-primary); outline-offset: 2px; }

.assist-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px 0 8px; border-radius: 8px;
  border: 1px solid var(--md-outline-variant); background: transparent; cursor: pointer; font-weight: 500; letter-spacing: .1px;
}
.assist-chip .mi { font-size: 18px; color: var(--md-primary); }
.assist-chip--on { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; cursor: default; }
/* « Je veux » : envie choisie mise en avant, flèche de menu déroulant. */
.assist-chip--selected { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.assist-chip__caret { margin-left: -2px; font-size: 12px; opacity: .7; }
.list__item[aria-current="true"] { font-weight: 600; }
.list__item[aria-current="true"] > .mi:last-child { color: var(--md-primary); }

/* ---------- Mise en page ---------- */
main { display: block; max-width: var(--content-max); margin: 0 auto; padding-bottom: 28px; outline: none; }
.geo-bar { display: flex; align-items: center; gap: 4px; padding: 8px var(--gutter) 0; min-height: 8px; }
.geo-bar:empty { display: none; }
.inline-form { display: inline; margin: 0; }

.chip-nav {
  position: sticky; top: 122px; z-index: 10; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 12px; background: var(--appbar-bg);
}
.chip-nav::-webkit-scrollbar { display: none; }

/* ---------- Sections catégorie + carrousels ---------- */
.cat-section { padding-top: 18px; scroll-margin-top: 180px; }
.cat-section__head { display: flex; align-items: center; gap: 10px; padding: 0 8px 8px var(--gutter); }
.cat-section__badge {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center;
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.cat-section__badge .mi { font-size: 20px; }
.cat-section__badge img { width: 100%; height: 100%; object-fit: cover; }
.cat-section__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cat-section__title { font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-section__more { font-size: 12px; line-height: 16px; letter-spacing: .4px; font-weight: 600; color: var(--md-primary); align-self: flex-start; }
.cat-section__more:hover { text-decoration: underline; }
.carousel-arrows { display: flex; gap: 4px; }

.carousel {
  display: flex; gap: 18px; overflow-x: auto; padding: 0 var(--gutter) 8px; scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > li { flex: none; scroll-snap-align: start; }

/* Carte carrousel : largeur 82 % de l'écran sur téléphone, 340 px au-delà de 600 px ; image = 42 % de la largeur. */
.ccard { display: flex; flex-direction: column; width: 82vw; border-radius: 14px; }
@media (min-width: 600px) { .ccard { width: 340px; } }
.ccard__media {
  position: relative; display: block; aspect-ratio: 100 / 42; border-radius: 14px; overflow: hidden;
  background: var(--md-surface-container-highest);
}
.ccard__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.ccard:hover .ccard__media > img { transform: scale(1.03); }
.ccard__offer { position: absolute; top: 10px; left: 10px; }
.ccard__logo { position: absolute; left: 10px; bottom: 10px; }
.ccard__name {
  margin-top: 8px; font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: .15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ccard__tags { display: flex; margin-top: 6px; }
.rating-line { font-size: 14px; line-height: 20px; letter-spacing: .25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rating-line strong { font-weight: 600; }
.rating-line .sep { padding: 0 6px; }

.tag {
  display: inline-block; padding: 3px 6px; border-radius: 4px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px;
  color: var(--md-on-surface-variant); background: color-mix(in srgb, var(--md-outline) 12%, transparent);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag--primary { color: var(--md-primary); background: color-mix(in srgb, var(--md-primary) 12%, transparent); }
/* Organisme de certification halal (AVS, Achahada…) — même vert que l'app. */
/* Badge de certification : vert de l'app (#2e7d32) assombri en clair et éclairci en sombre (contraste ≥ 4,5:1). */
:root { --certified: #1b5e20; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --certified: #81c784; } }
:root[data-theme="dark"] { --certified: #81c784; }
.tag--certified { color: var(--certified); background: color-mix(in srgb, var(--certified) 12%, transparent); margin-left: 6px; }
.mi--certified { color: #2e7d32; }
.pill {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 20px;
  font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .5px;
}
.pill .mi { font-size: 13px; }
.pill--offer { background: #d32f2f; color: #fff; }
.pill--primary { background: var(--md-primary); color: var(--md-on-primary); }
.pill--dark { background: rgba(0, 0, 0, .55); color: #fff; }
.pill .mi--star { color: #ffc107; vertical-align: 0; }

.logo {
  display: block; overflow: hidden; flex: none; background: var(--md-surface); border: 1px solid var(--md-outline-variant);
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo--40 { width: 40px; height: 40px; border-radius: 10px; }
.logo--44 { width: 44px; height: 44px; border-radius: 11px; }
.logo--64 { width: 64px; height: 64px; border-radius: 16px; }
.img-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 28px; line-height: 1;
  background: var(--md-surface-container-highest);
}

/* ---------- Carte pleine largeur (MerchantCard) ---------- */
.card-list { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 4px 12px 0; }
.card-list--top { padding-top: 12px; }
@media (min-width: 760px) { .card-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; padding: 4px var(--gutter) 0; } }
.results-count { padding: 6px var(--gutter) 6px; font-size: 12px; line-height: 16px; letter-spacing: .4px; }
.mcard {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--md-radius);
  background: var(--md-surface-container-low);
  border: 1px solid color-mix(in srgb, var(--md-outline-variant) 60%, transparent);
  transition: background-color .2s var(--ease);
}
.mcard:hover { background: color-mix(in srgb, var(--md-surface-container-low) 94%, var(--md-on-surface)); }
.mcard__cover { position: relative; display: block; height: 132px; background: var(--md-surface-container-highest); }
.mcard__cover > img { width: 100%; height: 100%; object-fit: cover; }
.mcard__shade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, rgba(0, 0, 0, .6) 100%); }
.mcard__online { position: absolute; left: 8px; bottom: 8px; }
.mcard__rating { position: absolute; right: 8px; bottom: 8px; }
.mcard__body { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px 14px; }
.mcard__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mcard__name { font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard__sub { margin-top: 2px; font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--md-on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; line-height: 16px; letter-spacing: .4px; }
.mcard__meta .mi { color: var(--md-outline); font-size: 17px; vertical-align: -4px; }
.mcard__meta .mi--inline { font-size: 15px; vertical-align: -3px; }

/* ---------- États vide / erreur ---------- */
.state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 120px 32px 24px; text-align: center; }
.state--page { padding-top: 96px; }
.state__icon { font-size: 56px; color: var(--md-on-surface-variant); }
.state__title { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.3px; }

/* ---------- Fiche (lot 1 : identité) ---------- */
.merchant-head__cover { height: 180px; background: var(--md-surface-container-highest); overflow: hidden; }
.merchant-head__cover img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) { .merchant-head__cover { height: 260px; margin: 12px var(--gutter) 0; border-radius: var(--md-radius); } }
.merchant-head__id { display: flex; align-items: flex-end; gap: 14px; padding: 0 var(--gutter); margin-top: -32px; position: relative; }
.merchant-head__sub { color: var(--md-on-surface-variant); margin-bottom: 6px; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 20px var(--gutter) 0; padding: 12px; border-radius: 10px;
  background: var(--md-surface-container-highest);
}
.notice .mi { color: var(--md-primary); }

/* ---------- Panneau Filtres : feuille du bas (mobile), boîte centrée (≥ 600 px) ---------- */
.sheet {
  margin: auto auto 0; width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; padding: 0;
  border: 0; border-radius: 24px 24px 0 0; color: var(--md-on-surface);
  background: var(--md-surface-container-low); box-shadow: 0 -2px 12px rgba(0, 0, 0, .15);
}
.sheet::backdrop { background: rgba(0, 0, 0, .32); }
.sheet::before { content: ""; display: block; width: 32px; height: 4px; margin: 16px auto 4px; border-radius: 2px; background: var(--md-on-surface-variant); opacity: .4; }
@media (min-width: 600px) {
  .sheet { margin: auto; max-width: 480px; border-radius: 28px; }
  .sheet::before { display: none; }
}
.sheet__body { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet__head { display: flex; align-items: center; gap: 4px; }
.sheet__title { flex: 1; font-size: 18px; font-weight: 700; }
.field-group { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label { font-weight: 600; padding: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.outlined { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--md-on-surface-variant); }

/* Champs : remplis, sans bordure, rayon 12, bordure primaire au focus (inputDecorationTheme). */
.input {
  width: 100%; min-height: 48px; padding: 12px; border-radius: 12px; border: 1.6px solid transparent;
  background: color-mix(in srgb, var(--md-surface-container-highest) 60%, transparent);
  font-size: 16px; line-height: 24px; color: var(--md-on-surface);
}
.input:focus { outline: none; border-color: var(--md-primary); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

/* Interrupteur Material 3 (52 × 32). */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; font-size: 16px; }
.switch {
  appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: 16px; cursor: pointer;
  background: var(--md-surface-container-highest); border: 2px solid var(--md-outline); transition: background-color .2s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 50%; left: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--md-outline); transform: translateY(-50%); transition: all .2s var(--ease);
}
.switch:checked { background: var(--md-primary); border-color: var(--md-primary); }
.switch:checked::after { left: 22px; width: 24px; height: 24px; background: var(--md-on-primary); }

/* ---------- Fiche : onglets (TabBar — indicateur sous le libellé, titleSmall) ---------- */
.mi--amber { color: #ffc107; }
.small { font-size: 12px; line-height: 16px; letter-spacing: .4px; }
.pre { white-space: pre-line; }
.break { overflow-wrap: anywhere; }
.tabs {
  position: sticky; top: 64px; z-index: 15; display: flex; background: var(--appbar-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--md-outline-variant) 50%, transparent);
}
.tabs__tab {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px;
  font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: .1px; color: var(--md-on-surface-variant);
}
.tabs__tab[aria-selected="true"] { color: var(--md-primary); background: linear-gradient(var(--md-primary), var(--md-primary)) no-repeat center bottom / 64px 3px; border-radius: 0; }
.tabs__tab:hover { background-color: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }
.tab-panel { outline: none; }
.state--panel { padding-top: 64px; gap: 6px; }
.state--panel .title-medium { margin-top: 6px; }
.state__icon--outline { color: var(--md-outline); }

/* ---------- Fiche : profil (ProfileTab) ---------- */
.profile { max-width: 840px; margin: 0 auto; padding-bottom: 28px; }
.profile__header { position: relative; height: calc(170px + 38px); }
.profile__cover {
  position: absolute; inset: 0 0 38px; overflow: hidden;
  background: linear-gradient(135deg, var(--md-primary), var(--md-tertiary));
}
@media (min-width: 840px) { .profile__cover { border-radius: 0 0 var(--md-radius) var(--md-radius); } }
.profile__cover img { width: 100%; height: 100%; object-fit: cover; }
.profile__cover-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .4)); }
.profile__logo {
  position: absolute; left: 16px; bottom: 0; width: 76px; height: 76px; border-radius: 20px; overflow: hidden;
  background: var(--md-surface); border: 3px solid var(--md-surface); box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}
.profile__logo img { width: 100%; height: 100%; object-fit: cover; }
.profile__qr {
  position: absolute; right: 16px; bottom: 0; width: 56px; height: 56px; padding: 4px; cursor: zoom-in;
  background: #fff; border-radius: 8px; border: 1px solid var(--md-outline-variant);
}
.profile__qr svg { display: block; width: 100%; height: 100%; }
.profile__id { padding: 12px 16px 0; }
.info-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; }
.info-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 20px;
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px;
  background: var(--md-surface-container-highest); color: var(--md-on-surface-variant);
}
.info-chip .mi { font-size: 15px; }
.info-chip--on { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.quick-actions { display: flex; padding: 16px 12px 4px; }
.quick-action {
  flex: 1 1 0; min-width: 0; margin: 0 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; border: 0; border-radius: 14px; cursor: pointer; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px;
  background: color-mix(in srgb, var(--md-secondary-container) 60%, transparent); color: var(--md-on-secondary-container);
}
.quick-action:hover { background: var(--md-secondary-container); }
.quick-action > span:not(.visually-hidden) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-card {
  margin: 12px 16px 0; padding-bottom: 12px; border-radius: var(--md-radius);
  background: var(--md-surface-container-low); border: 1px solid color-mix(in srgb, var(--md-outline-variant) 60%, transparent);
}
.info-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px 0; user-select: text; }
.info-row > .mi { font-size: 18px; color: var(--md-outline); margin-top: 1px; }
.info-row address { font-style: normal; }
.profile__heading { padding: 20px 16px 6px; }
.profile__about { padding: 0 16px; line-height: 1.4; }
.divider { border: 0; height: 1px; background: color-mix(in srgb, var(--md-outline-variant) 60%, transparent); }
.divider--36 { margin: 18px 0; }
.divider--32 { margin: 16px 0; }
.reviews { padding: 0 16px; display: flex; flex-direction: column; gap: 4px; }
.reviews__title { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; margin-bottom: 4px; }
.reviews__title .mi { font-size: 20px; color: var(--md-outline); }

/* Avis Google : cartes 240 × 168, fond surface-container-highest, rayon 12. */
.greviews { padding-top: 0; scroll-margin-top: 120px; }
.greviews__head { display: flex; align-items: center; gap: 10px; padding: 0 8px 10px 16px; }
.greviews__head .reviews__title { margin: 0; }
.greviews__rating { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; line-height: 16px; flex: 1; }
.greviews__rating .mi { font-size: 16px; }
.greviews__list { gap: 10px; }
.greview {
  width: 240px; height: 168px; padding: 12px; border-radius: 12px; display: flex; flex-direction: column;
  background: var(--md-surface-container-highest);
}
.greview__author { display: flex; align-items: center; gap: 8px; }
.greview__avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none; }
.greview__avatar img { width: 100%; height: 100%; object-fit: cover; }
.img-fallback--sm { font-size: 16px; }
.greview__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.greview__stars { display: flex; margin: 6px 0 4px; color: #ffc107; }
.greview__stars .mi { font-size: 14px; }
.greview__text {
  flex: 1; font-size: 12px; line-height: 16px; letter-spacing: .4px; overflow: hidden;
  /* 4 lignes : la hauteur disponible dans la carte de 168 px (l'app en demande 5 mais n'en affiche que 4,75). */
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}
.greview__time { font-size: 11px; line-height: 16px; letter-spacing: .5px; font-weight: 500; color: var(--md-on-surface-variant); }

/* ---------- Boîte de dialogue QR (showQrDialog) ---------- */
.dialog {
  margin: auto; width: min(340px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 28px; text-align: center;
  display: none; flex-direction: column; align-items: center; gap: 12px;
  background: var(--md-surface-container-high); color: var(--md-on-surface); box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.dialog:popover-open { display: flex; }
.dialog::backdrop { background: rgba(0, 0, 0, .32); }
.dialog__title { font-size: 16px; line-height: 24px; font-weight: 700; }
.dialog__qr { margin-top: 4px; padding: 12px; background: #fff; }
.dialog__qr svg { display: block; width: 220px; height: 220px; }
.dialog__subtitle { font-size: 12px; line-height: 16px; letter-spacing: .4px; }

/* ---------- Message éphémère (SnackBar flottante) ---------- */
.snackbar {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: min(560px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 12px;
  background: var(--md-inverse-surface); color: var(--md-on-inverse-surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
}

/* ---------- Catalogue (catalog_tab.dart) ---------- */
.closed-banner {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--md-error-container); color: var(--md-on-error-container);
}
.closed-banner .mi { font-size: 18px; }
/* Bandeau, recherche et puces restent visibles au défilement (Column + Expanded de l'app),
 * juste sous les onglets (barre 64 px + onglets 48 px + bordure). */
.catalog__bar { position: sticky; top: 113px; z-index: 12; background: var(--appbar-bg); }
.catalog-search { padding: 8px 12px 4px; }
.search-field--dense { min-height: 40px; border-radius: 24px; }
.search-field--dense input { padding: 8px 0; }
.catalog-chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 12px; min-height: 44px; align-items: center;
}
.catalog-chips::-webkit-scrollbar { display: none; }
.catalog-chips .chip { flex: none; }
.chip__dot { width: 10px; height: 10px; flex: none; }
.catalog .divider { margin: 0; }
.catalog__rows { padding: 4px 0 24px; }

/* Rangée : titre titleMedium gras (marges 16/16/8/4, hauteur 40), puis cartes espacées de 14. */
/* Saut par puce : la rangée s'aligne sous la barre collante (scroll-padding 150 px + 60 px ≈ 113 + 97). */
.prow { padding-top: 16px; scroll-margin-top: 60px; }
.prow__head { min-height: 40px; padding: 0 8px 4px 16px; }
.prow__title { flex: 1; min-width: 0; font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow__track { gap: 14px; padding: 4px 16px 8px; align-items: flex-start; min-height: calc(172px + 12px); }
/* Hauteur de rangée = carte la plus haute : vedette (largeur × 0,9 + 74) sinon détaillée (172). */
.prow__track--featured { min-height: calc(170px * .9 + 74px + 12px); }
@media (min-width: 600px) { .prow__track--featured { min-height: calc(220px * .9 + 74px + 12px); } }

.ptile { position: relative; display: flex; }
.ptile__name { margin: 0; font-size: 16px; line-height: 1.15; letter-spacing: .5px; }
.ptile__open {
  all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Toute la carte ouvre la fiche produit ; favori et « + » restent au-dessus. */
.ptile__open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.ptile__open:focus-visible { outline: none; }
.ptile:has(.ptile__open:focus-visible) { outline: 2px solid var(--md-primary); outline-offset: 2px; }

.ptile--featured { flex-direction: column; width: 170px; height: calc(170px * .9 + 74px); border-radius: 14px; }
@media (min-width: 600px) { .ptile--featured { width: 220px; height: calc(220px * .9 + 74px); } }
.ptile--featured .ptile__media { height: calc(170px * .9); border-radius: 14px; overflow: hidden; flex: none; }
@media (min-width: 600px) { .ptile--featured .ptile__media { height: calc(220px * .9); } }
.ptile--featured .ptile__name { margin-top: 6px; font-weight: 600; }
.ptile--featured .pstats { margin-top: 2px; }

.ptile--detailed {
  width: clamp(280px, 85vw, 400px); height: 172px; overflow: hidden; border-radius: var(--md-radius);
  background: var(--md-surface); border: 1px solid color-mix(in srgb, var(--md-outline-variant) 60%, transparent);
}
.ptile--detailed .ptile__text { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 10px 12px 16px; }
.ptile--detailed .ptile__name { font-weight: 700; }
.ptile--detailed .pstats { margin-top: 4px; }
.ptile--detailed .ptile__media { width: 150px; flex: none; }
.ptile__desc {
  margin-top: 6px; color: var(--md-on-surface-variant); line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.ptile__desc--sizes { -webkit-line-clamp: 2; line-height: 20px; }

/* Image entière (contain) sur fond surface-container-highest à 45 %, marge basse pour le bouton « + ». */
.ptile__media { position: relative; }
.ptile__img {
  position: absolute; inset: 0; padding: 10px 10px 14px;
  background: color-mix(in srgb, var(--md-surface-container-highest) 45%, transparent);
}
.ptile__img img { width: 100%; height: 100%; object-fit: contain; }
.ptile__img .img-fallback { background: transparent; }
.ptile__badges { position: absolute; top: 8px; left: 8px; right: 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; z-index: 2; pointer-events: none; }
.pbadge {
  max-width: 100%; padding: 3px 6px; border-radius: 4px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .5px;
}
.pbadge--rank { background: #0e8345; }
.pbadge--promo { background: var(--md-error); }
.ptile__fav, .ptile__add { position: absolute; z-index: 2; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.ptile__fav { top: 6px; right: 6px; width: 30px; height: 30px; background: rgba(255, 255, 255, .92); color: rgba(0, 0, 0, .87); }
.ptile__fav .mi { font-size: 16px; }
.ptile__add { right: 8px; bottom: 8px; width: 42px; height: 42px; background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 1px 8px rgba(0, 0, 0, .12); }
.ptile__add .mi { font-size: 26px; }
.ptile__add:hover, .ptile__fav:hover { filter: brightness(.94); }

/* « 9,90 € · ★ 4,6 (41) · 🔥 120 vendus » sur une ligne. */
.pstats { margin: 0; font-size: 14px; line-height: 20px; letter-spacing: .25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstats__muted { color: var(--md-on-surface-variant); }
.pstats__sep { padding: 0 6px; }
.pstats__price { font-weight: 600; color: var(--md-on-surface); }
.pstats__price.is-promo { color: var(--md-error); }
s.pstats__muted { margin-right: 4px; }
.state__action { margin-top: 10px; }

/* ---------- Fiche produit et composition (feuilles du bas) ---------- */
.psheet[open] { display: flex; flex-direction: column; overflow: hidden; }
.psheet { max-height: 90vh; }
.psheet--compose { max-height: 85vh; }
.psheet--menu { max-height: 88vh; }
.psheet__scroll { overflow-y: auto; overscroll-behavior: contain; }
.psheet__detail { display: flex; flex-direction: column; padding: 4px 20px 24px; }
.psheet__photo { height: 160px; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--md-surface-container-highest) 50%, transparent); }
.psheet__photo img { width: 100%; height: 100%; object-fit: contain; }
.psheet__title { margin-top: 14px; font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.3px; }
.psheet__prices { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.psheet__price { font-size: 16px; line-height: 24px; font-weight: 700; }
.psheet__price.is-promo { color: var(--md-error); }
.psheet__desc { margin-top: 14px; white-space: pre-line; }
.psheet__hint { margin-top: 14px; padding: 10px; border-radius: 8px; background: var(--md-surface-container-highest); font-style: italic; }
.psheet__actions { display: flex; gap: 10px; margin-top: 20px; }
.psheet__actions > * { flex: 1; }
.outlined-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 24px;
  border: 1px solid var(--md-outline); border-radius: 12px; background: transparent; cursor: pointer;
  color: var(--md-primary); font-weight: 500; letter-spacing: .1px;
}
.outlined-btn:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.outlined-btn .mi, .filled-btn .mi { font-size: 18px; }
.filled-btn:disabled { background: color-mix(in srgb, var(--md-on-surface) 12%, transparent); color: color-mix(in srgb, var(--md-on-surface) 38%, transparent); cursor: default; }

.compose__head { display: flex; align-items: center; gap: 12px; padding: 0 20px 8px; }
.compose__thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex: none; background: var(--md-surface-container-highest); }
.compose__thumb img { width: 100%; height: 100%; object-fit: cover; }
.compose__thumb .img-fallback { font-size: 22px; }
.compose__title { flex: 1; min-width: 0; font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.3px; }
.compose__price { font-weight: 700; }
.compose__body { flex: 1; min-height: 0; padding: 20px; }
.compose__section-title { font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; }
.compose__sub { font-size: 12px; line-height: 16px; letter-spacing: .4px; }
.compose__group { margin: 10px 0 4px; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; }
.compose__block + .compose__block { margin-top: 16px; }
.compose__choice-title { padding: 14px 0 4px; font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; }
.compose__comp-step { padding: 4px 0 0 16px; }
.compose__comp-title { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; }
.compose__foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); }
.compose__foot .filled-btn { margin-left: auto; }
.compose__loading { padding: 24px; text-align: center; color: var(--md-on-surface-variant); }
.chips--wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* CheckboxListTile dense : case, libellé, prix en fin de ligne. */
.check-row { display: flex; align-items: center; gap: 16px; min-height: 48px; cursor: pointer; }
.check-row--indent { padding-left: 16px; }
.check-row__label { flex: 1; min-width: 0; }
.check-row__label.is-off { text-decoration: line-through; }
.check-row__trail { color: var(--md-on-surface-variant); }
.check-row input[type="checkbox"] {
  appearance: none; flex: none; width: 18px; height: 18px; margin: 0 3px; border: 2px solid var(--md-on-surface-variant); border-radius: 2px;
  display: grid; place-items: center; cursor: pointer;
}
.check-row input[type="checkbox"]:checked { background: var(--md-primary); border-color: var(--md-primary); }
.check-row input[type="checkbox"]:checked::after { content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid var(--md-on-primary); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }
.included-row { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.included-row > .mi { color: #4caf50; }
.qty { display: flex; align-items: center; }
.qty__value { min-width: 16px; text-align: center; font-size: 16px; line-height: 24px; font-weight: 700; }
.icon-btn:disabled { opacity: .38; cursor: default; }
/* ChoiceChip : sélectionnée = secondary-container + coche. */
.choice-chip { position: relative; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip:has(input:checked) { background: var(--md-secondary-container); border-color: transparent; color: var(--md-on-secondary-container); padding-left: 8px; }
.choice-chip:has(input:checked)::before { content: "\2713"; font-weight: 700; width: 18px; text-align: center; }
.choice-chip:has(input:focus-visible) { outline: 2px solid var(--md-primary); outline-offset: 2px; }

/* ---------- Barre : icône compte (AppBar actions) ---------- */
.appbar__spacer { flex: 1; min-width: 0; }
.appbar__account { margin-left: auto; }

/* ---------- Cartes à lien étendu (le cœur favori reste cliquable au-dessus) ---------- */
.mcard, .ccard { position: relative; }
.mcard__link, .ccard__link { color: inherit; }
.mcard__link::after, .ccard__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.mcard__link:focus-visible, .ccard__link:focus-visible { outline: none; }
.mcard:has(.mcard__link:focus-visible), .ccard:has(.ccard__link:focus-visible) { outline: 2px solid var(--md-primary); outline-offset: 2px; }
.ccard:hover .ccard__media > img { transform: scale(1.03); }
.ccard__title { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.ccard__title .ccard__name { flex: 1; min-width: 0; margin-top: 0; }

/* ---------- Bouton favori (♥) — variantes de l'app ---------- */
.fav { margin: 0; z-index: 2; }
.fav__btn { border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; background: transparent; color: var(--md-outline); }
.fav__btn.is-on { color: #ff5252; }
.fav__btn:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }
/* _FavoriteButton : rond blanc 34 px sur la couverture, icône 18. */
.fav--cover { position: absolute; top: 6px; right: 6px; }
.fav--cover .fav__btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: rgba(0, 0, 0, .87); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.fav--cover .fav__btn.is-on, .fav--tile .fav__btn.is-on { color: #ff5252; }
.fav--cover .mi { font-size: 18px; }
/* Carte produit : rond blanc 30 px, icône 16. */
.fav--tile { position: absolute; top: 6px; right: 6px; }
.fav--tile .fav__btn { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: rgba(0, 0, 0, .87); }
.fav--tile .mi { font-size: 16px; }
/* Carte de carrousel : IconButton compact à côté du nom. */
.fav--inline { position: relative; flex: none; }
.fav--inline .fav__btn { width: 32px; height: 28px; border-radius: 14px; }
/* Barre de la fiche : à côté du nom. */
.fav--title { flex: none; }
.fav--title .fav__btn { width: 36px; height: 36px; border-radius: 50%; color: var(--md-on-surface-variant); }
.fav--title .fav__btn.is-on { color: #ff5252; }
.fav--title .fav__btn:hover, .fav--inline .fav__btn:hover, .fav--list .fav__btn:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
/* Liste « Mes favoris » : cœur rouge plein en fin de ligne. */
.fav--list .fav__btn { width: 40px; height: 40px; border-radius: 50%; color: #f44336; }
.fav--list .fav__btn.is-on { color: #f44336; }
.psheet__fav.is-on .mi { color: #ff5252; }

/* ---------- Connexion / inscription (LoginScreen : colonne de 420 px centrée) ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; }
.auth__logo { align-self: center; }
.auth__logo .mi { font-size: 64px; }
.auth__reason { margin-top: 16px; text-align: center; font-weight: 500; }
.auth__hint { margin-top: 8px; text-align: center; }
.auth__google { margin-top: 28px; display: flex; justify-content: center; min-height: 44px; }
.auth__google-btn { width: 100%; display: flex; justify-content: center; }
.auth__or { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--md-on-surface-variant); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--md-outline-variant) 60%, transparent); }
.segmented { display: flex; margin-top: 16px; border: 1px solid var(--md-outline); border-radius: 20px; overflow: hidden; }
.auth__logo + .auth__reason + .auth__hint + .segmented { margin-top: 28px; }
.segmented__item { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 12px; font-weight: 500; letter-spacing: .1px; }
.segmented__item + .segmented__item { border-left: 1px solid var(--md-outline); }
.segmented__item.is-on { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.segmented__item.is-on::before { content: "\2713"; font-weight: 700; }
.segmented__item:not(.is-on):hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.auth__form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth__form .row-2 { gap: 10px; }
.auth__form .tonal-btn { margin-top: 6px; }
.tonal-btn--block { width: 100%; min-height: 48px; border-radius: 12px; font-weight: 500; letter-spacing: .1px; }
/* Champ dense avec bordure (OutlineInputBorder), libellé au-dessus de la saisie. */
.tfield__box {
  display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 0 4px 0 12px; border-radius: 4px; cursor: text;
  border: 1px solid var(--md-outline); background: transparent;
}
.tfield__box:focus-within { border: 2px solid var(--md-primary); padding-left: 11px; }
.tfield--error .tfield__box { border-color: var(--md-error); }
.tfield__icon { color: var(--md-on-surface-variant); margin-right: 8px; }
.tfield__inner { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 0; }
.tfield__label { font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--md-on-surface-variant); }
.tfield__box:focus-within .tfield__label { color: var(--md-primary); }
.tfield--error .tfield__label { color: var(--md-error); }
.tfield__input { width: 100%; border: 0; outline: 0; background: transparent; padding: 0; font-size: 16px; line-height: 24px; letter-spacing: .5px; color: var(--md-on-surface); }
.tfield__msg { margin: 4px 16px 0; font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--md-on-surface-variant); }
.tfield__msg--error { color: var(--md-error); }
.auth__dev-sep { margin: 24px 0 8px; }
.auth__dev { display: flex; flex-direction: column; gap: 10px; }
.auth__dev > p { text-align: center; }

/* ---------- Mon compte (AccountScreen) ---------- */
.account { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; }
.account__avatar {
  align-self: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.account__avatar .mi { font-size: 32px; }
.account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.account__name { margin-top: 12px; text-align: center; font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; }
.account__email { text-align: center; }
.account__qr { align-self: center; margin-top: 16px; }
.account__list:first-of-type { margin-top: 24px; }
.list { margin: 0; padding: 0; list-style: none; }
.list form { margin: 0; }
.list__item {
  width: 100%; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 16px; border: 0; background: transparent;
  text-align: left; cursor: pointer; color: var(--md-on-surface); font-size: 16px; line-height: 24px; letter-spacing: .5px;
}
.list__item > .mi { color: var(--md-on-surface-variant); }
a.list__item:hover, button.list__item:hover { background: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }
.list__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list__sub { font-size: 14px; line-height: 20px; letter-spacing: .25px; color: var(--md-on-surface-variant); }
.list__item--danger, .list__item--danger > .mi { color: var(--md-error); }
.list__item--fav { position: relative; cursor: default; }
.list__link { color: inherit; }
.list__link::after { content: ""; position: absolute; inset: 0; }
.list__item--fav:hover { background: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }
.favs__logo { border-radius: 6px; }
.dialog--alert { text-align: left; align-items: stretch; width: min(400px, calc(100vw - 32px)); }
.dialog__text { color: var(--md-on-surface-variant); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 0 0; }
.filled-btn--danger { background: var(--md-error); color: var(--md-on-error); min-height: 40px; border-radius: 20px; }
.filled-btn--danger:hover { background: color-mix(in srgb, var(--md-error) 90%, var(--md-on-error)); }

/* ---------- Mes favoris (FavoritesScreen) ---------- */
.favs { padding-bottom: 24px; }
.favs__title { padding: 16px 16px 4px; font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: .1px; }
.favs__empty { padding: 24px; margin-top: 30vh; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Panier (cart_screen.dart, my_carts_screen.dart, _CartSummaryBar) ---------- */
.appbar__cart { position: relative; }
.badge {
  position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--md-error); color: var(--md-on-error); font-size: 11px; line-height: 16px; font-weight: 500; text-align: center;
}
.appbar__title--start { padding-left: 8px; }
/* Barre du bas fixe (bottomNavigationBar). */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--md-surface);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--md-outline-variant) 60%, transparent);
}
.cart, .carts, .orders { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; }
.cart { padding-bottom: 88px; }
.has-bottom-bar .snackbar { bottom: calc(84px + env(safe-area-inset-bottom)); }
.cart__lines { flex: 1; padding-bottom: 8px; }
.cart__empty { margin: 30vh 24px 0; text-align: center; }
.cart__totals { flex: 1; display: flex; flex-direction: column; }
.cart__total { font-size: 22px; line-height: 28px; font-weight: 700; }
.cart__bar .filled-btn { min-height: 40px; }
.cart-line { cursor: default; gap: 12px; padding-right: 4px; }
.cart-line__img { flex: none; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--md-surface-container-highest); }
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line__summary {
  font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--md-on-surface-variant);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-line .qty .mi { font-size: 22px; }
.cart-line__remove .mi { color: var(--md-on-surface-variant); }
.cart-total-small { font-size: 14px; line-height: 20px; font-weight: 700; }
.cart-bar {
  position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.cart-bar__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-bar:hover { background: color-mix(in srgb, var(--md-primary-container) 92%, var(--md-on-primary-container)); }
.has-cart-bar .snackbar { bottom: calc(68px + env(safe-area-inset-bottom)); }
.catalog--no-order .ptile__add { display: none; }

/* ---------- Récapitulatif (checkout_screen.dart) ---------- */
.checkout { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; padding-bottom: 72px; }
.checkout__body { flex: 1; display: flex; flex-direction: column; padding: 16px; }
.checkout__merchant { font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: .15px; margin-bottom: 12px; }
.checkout__lines { margin: 0; padding: 0; list-style: none; }
.checkout__item { padding: 3px 0; }
.checkout__line { display: flex; gap: 8px; padding: 3px 0; }
.checkout__item .checkout__line { padding: 0; }
.checkout__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout__summary { padding-left: 24px; font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--md-on-surface-variant); }
.checkout__empty { padding: 8px 0; color: var(--md-on-surface-variant); }
.checkout__divider { margin: 12px 0; }
.checkout__total { display: flex; justify-content: space-between; font-size: 16px; line-height: 24px; letter-spacing: .15px; }
.checkout__group { margin-top: 24px; gap: 8px; }
.checkout__title { font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: .1px; padding: 0; margin-bottom: 8px; }
.checkout__row { display: flex; gap: 8px; }
.checkout__row > * { flex: 1; min-width: 0; }
.checkout__row > .checkout__town { flex: 2; }
.checkout__error { color: var(--md-error); }
.checkout textarea.tfield__input { resize: vertical; font: inherit; font-size: 16px; }
.checkout__info, .checkout__alert {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px; border-radius: 10px;
  background: var(--md-surface-container-highest);
}
.checkout__info .mi { color: var(--md-primary); }
.checkout__alert { margin-top: 14px; background: var(--md-error-container); color: var(--md-on-error-container); }
.checkout__bar .filled-btn { min-height: 40px; }

/* ---------- Confirmation et Mes commandes (orders_screen.dart) ---------- */
.state__icon--48 { font-size: 48px; }
.confirm { gap: 8px; }
.confirm__icon { font-size: 64px; color: var(--md-primary); margin-bottom: 8px; }
.confirm__qr { margin: 12px 0; }
.order { cursor: default; }
button.order { cursor: pointer; }
.order__trail { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.order__amount { font-size: 14px; line-height: 20px; font-weight: 700; }
.order__status { display: flex; align-items: center; gap: 4px; }
.order__status .mi { font-size: 16px; }
.order__qr { color: var(--md-outline); }
.order__ok { color: #4caf50; }
.order__ko { color: var(--md-error); }
.order__pending { color: var(--md-tertiary, #7d5260); }
/* Paiement en ligne (confirmation de commande) */
.pay-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0; padding: 16px; border-radius: 16px; background: var(--md-surface-container-highest); max-width: 420px; text-align: center; }
.pay-box__title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin: 0; }
.pay-box__title--ok { color: #2e7d32; margin-top: 12px; }
.pay-box__title--ko { color: var(--md-error); margin-top: 12px; }

/* ---------- Scanner (qr_scanner_screen.dart) ---------- */
.scanner { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.scanner__view { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 70vh; border-radius: var(--md-radius); overflow: hidden; background: #000; }
.scanner__video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Cadre de visée : carré centré, le reste assombri. */
.scanner__frame {
  position: absolute; left: 50%; top: 50%; width: min(64%, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 3px solid #fff; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
}
.scanner__status { text-align: center; color: var(--md-on-surface-variant); }
.scanner__photo { position: relative; cursor: pointer; }
.scanner__photo:focus-within { outline: 2px solid var(--md-primary); outline-offset: 2px; }

/* ---------- Pied de page et pages légales (lot 7, propres au web) ---------- */
.site-footer {
  max-width: var(--content-max); margin: 0 auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px;
  font-size: 12px; line-height: 16px; color: var(--md-on-surface-variant);
}
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; padding: 6px 2px; }
.has-bottom-bar .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.legal { max-width: 760px; margin: 0 auto; padding: 8px 16px 16px; font-size: 14px; line-height: 21px; }
.legal__title { margin: 8px 0 4px; font-size: 22px; line-height: 28px; font-weight: 500; }
.legal h3 { margin: 20px 0 6px; font-size: 16px; line-height: 24px; font-weight: 500; }
.legal p, .legal ul { margin: 0 0 8px; }
.legal ul { padding-left: 20px; list-style: disc; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--md-primary); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* ---------- Bouton jour/nuit (propre au site) ----------
   Seul le bouton qui inverse le thème effectif est affiché : choix du visiteur
   (<html data-theme>), sinon thème du système. */
.theme-toggle { display: contents; }
:root[data-theme="light"] .theme-toggle__to-light,
:root[data-theme="dark"] .theme-toggle__to-dark { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .theme-toggle__to-light { display: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-toggle__to-dark { display: none; } }
.theme-toggle__link {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px;
}
.theme-toggle__link .mi { font-size: 16px; }
