/* Mon Panier — Frigo : complément de mise en page du parcours photo unique
 * (trois emplacements). Réutilise les composants canoniques
 * (masters/flows-complete.css : .flow-photo-*, .mp-ui-action) ; ce fichier ne
 * porte que l'écart déclaré de la surface frigo et l'animation de balayage. */

.fp { display: grid; gap: var(--mp-ui-space-3, 12px); }

/* Deux sources distinctes (appareil direct, choix multiples) : pleine largeur, sobres. */
.fp .flow-photo-sources { grid-template-columns: minmax(0, 1fr); }

/* Couches natives (appui réel) : invisibles, posées SOUS LE DOIGT par script
   sur chaque contrôle de l'écran photo — le doigt ouvre la feuille système
   dans le champ lui-même (aucun clic simulé, aucune dérive du menu). Au
   repos : 2px au centre, aucun appui intercepté. Jamais display:none : la
   boîte doit exister pour l'ancrage. */
.fp-native-input {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* La corbeille (coin de l'emplacement) reste AU-DESSUS de la couche native :
   son appui supprime la photo au lieu d'ouvrir le sélecteur. */
.fp .flow-photo-remove { z-index: 2; }

.fp-note {
  margin: 0;
  font-size: var(--mp-ui-label-size, 13px);
  color: var(--mp-ui-text-muted, #617269);
}
.fp-empty { margin: 0; color: var(--mp-ui-text-muted, #617269); }
.fp .flow-photo-error { margin: 0; }
.fp-actions { display: grid; gap: var(--mp-ui-space-2, 8px); }

/* Balayage sobre SUR les photos pendant l'analyse réelle. Aucun nom, aucun
 * pourcentage, aucune boîte de détection : une simple passe de lumière. */
.fp.is-scanning .flow-photo-slot.has-photo .flow-photo-select { position: relative; overflow: hidden; }
.fp.is-scanning .flow-photo-slot.has-photo .flow-photo-select::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 36%,
    rgba(88, 164, 109, 0.30) 50%,
    rgba(255, 255, 255, 0) 64%);
  transform: translateY(-110%);
  animation: fp-scan-sweep 1.7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fp-scan-sweep { to { transform: translateY(110%); } }

@media (prefers-reduced-motion: reduce) {
  .fp.is-scanning .flow-photo-slot.has-photo .flow-photo-select::after {
    animation: none;
    transform: none;
    background: linear-gradient(180deg,
      rgba(88, 164, 109, 0) 30%,
      rgba(88, 164, 109, 0.22) 50%,
      rgba(88, 164, 109, 0) 70%);
  }
}

/* Ajout express : les courants non vus sur la photo, en un appui (revue). */
.fp-quick { margin-top: var(--mp-ui-space-3, 12px); }
.fp-quick--essentials { margin-top: 0; }
.fp-quick-oils { margin-top: var(--mp-ui-space-2, 8px); }
.fp-quick-lead { margin: 0 0 var(--mp-ui-space-2, 8px); font-size: var(--mp-ui-label-size, 13px); color: var(--mp-ui-text-muted, #617269); }
.mp-page[data-screen="frigo-aliments"] .fp-quick-lead { margin: 0 0 var(--mp-ui-space-2, 8px); font: 600 var(--mp-ui-label-size, 13px)/1.4 var(--mp-ui-font-sans, system-ui, sans-serif); letter-spacing: normal; }
.fp-quick-row { display: flex; flex-wrap: wrap; gap: var(--mp-ui-space-2, 8px); }
.fp-quick-chip { min-height: var(--mp-ui-touch, 44px); }

/* Liste des produits : deux colonnes, deux vrais boutons frères.
 * Le nom + crayon reste l'édition ; la croix a sa propre cible de 44 px.
 * Une seule surface, sans superposition ni largeur 100% devant la croix. */
.fp-sectionline { display: flex; align-items: center; justify-content: space-between; gap: var(--mp-ui-space-2, 8px); margin: var(--mp-ui-space-1, 4px) 0 var(--mp-ui-space-2, 8px); }
.fp .fp-section-line { margin: 0; font-family: inherit; font-size: 15px; font-weight: 600; }
.fp-sectionline .mp-ui-action { min-height: var(--mp-ui-touch, 44px); padding: 4px 12px; font-size: 13px; }
.fp-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.fp-product { display: flex; min-width: 0; }
.fp-product-open { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 57px; padding: 10px 11px; text-align: left; background: var(--mp-ui-surface, #ffffff); color: var(--mp-ui-ink, #17281f); border: 1px solid var(--mp-ui-border, #d8e0d4); border-radius: var(--mp-ui-radius-sm, 12px); font: inherit; font-size: 14px; font-weight: 500; line-height: 1.35; }
.fp-product-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.fp-product-open:has(.fp-review-label) { flex-direction: column; align-items: flex-start; justify-content: center; }
.fp-review-label { font-size: var(--mp-ui-label-size, 13px); color: var(--mp-ui-text-muted, #617269); font-weight: 400; }
.fp-review-label--attention { color: var(--mp-ui-warning, #82550e); background: var(--mp-ui-warning-soft, #fbefd8); padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.fp--items .fp-product--removable.fp-product--choices { grid-column: 1 / -1; flex-wrap: wrap; }
.fp-product-choices { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; padding: 0 9px 9px; }
.fp-product-choices .fp-quick-chip { min-height: 44px; padding: 5px 10px; }
.fp-product-mark { display: inline-flex; flex: none; width: 16px; height: 16px; color: var(--mp-ui-text-muted, #617269); }
.fp-product-open:focus-visible { outline: 2px solid var(--mp-ui-green, #58a46d); outline-offset: 2px; }
.fp-product-open:hover { border-color: var(--mp-ui-action-accent, #58a46d); }
/* Portée stricte : les tuiles avec retrait de la revue, pas les photos,
 * l'historique, le dialogue d'édition ni les couches de saisie natives. */
.fp--items .fp-product--removable { box-sizing: border-box; display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0; min-width: 0; margin: 0; padding: 0; border: 1px solid var(--mp-ui-border, #d8e0d4); border-radius: var(--mp-ui-radius-sm, 12px); background: var(--mp-ui-surface, #ffffff); }
.fp--items .fp-product--removable > .fp-product-open { box-sizing: border-box; flex: 1 1 0; width: auto; min-width: 0; min-height: 57px; padding: 8px 4px 8px 9px; border: 0; border-radius: inherit; background: transparent; box-shadow: none; }
.fp--items .fp-product--removable .fp-product-name { display: block; flex: 1 1 auto; min-width: 0; white-space: normal; word-break: normal; overflow-wrap: anywhere; line-height: 1.35; }
.fp--items .fp-product--removable .fp-product-mark { display: grid; place-items: center; flex: 0 0 16px; }
.fp--items .fp-product--removable .fp-product-mark .mp-ui-icon { width: 16px; height: 16px; }
.fp--items .fp-product--removable > .fp-product-remove { box-sizing: border-box; position: static; display: grid; place-items: center; align-self: center; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; max-width: 44px; min-height: 44px; max-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--mp-ui-danger, #b3261e); box-shadow: none; cursor: pointer; }
.fp--items .fp-product-remove > span { display: grid; place-items: center; }
.fp--items .fp-product-remove .mp-ui-icon { width: 16px; height: 16px; }
.fp--items .fp-product-remove:focus-visible { outline: 2px solid var(--mp-ui-danger, #b3261e); outline-offset: -3px; }
.fp--items .fp-product-remove:hover { background: rgb(179 38 30 / 6%); }
/* Dialogue d'édition : classes canoniques du kit, portées par la surface frigo. */
.fp-edit-dialog { padding: 0; }
.fp-edit-dialog [hidden] { display: none !important; }
.fp-history-excluded { text-decoration: line-through; color: var(--mp-ui-text-muted, #617269); }
.fp-edit-error { margin: 0 0 var(--mp-ui-space-2, 8px); font-size: 13px; color: var(--mp-ui-danger, #b3261e); }
.fp-undo { display: flex; align-items: center; gap: var(--mp-ui-space-2, 8px); flex-wrap: wrap; }
.fp-undo .mp-ui-action { min-height: var(--mp-ui-touch, 44px); }

/* V5 — historique : lignes compactes (date · compte · chevron). */
.fp-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fp-history-open { width: 100%; justify-content: flex-start; gap: var(--mp-ui-space-2, 8px); min-height: var(--mp-ui-touch, 44px); }
.fp-history-open small { color: var(--mp-ui-text-muted, #617269); }
.fp-history-open svg { margin-left: auto; }
.fp--history .scan-beta-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fp--history .scan-beta-items li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--mp-ui-border, #d8e0d4); }
.fp-history-items>li>span { min-width: 0; overflow-wrap: anywhere; }
.fp-history-items>li>button { flex-shrink: 0; min-height: 44px; }
.fp--history .scan-beta-items li small { color: var(--mp-ui-text-muted, #617269); }

/* Parcours mobile : une action principale, outils secondaires repliés. */
.fp-native-host { position: relative; isolation: isolate; z-index: 0; min-width: 0; }
.fp .flow-photo-slot { isolation: isolate; }
.fp .flow-photo-remove { top: 4px; right: 4px; bottom: auto; z-index: 3; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fffef9; box-shadow: 0 2px 8px rgb(32 47 37 / 12%); }
.fp .flow-photo-remove svg { width: 18px; height: 18px; }
.fp-picker { padding: 18px; border: 1px solid #ecece3; border-radius: 24px; background: #fffefb; box-shadow: 0 5px 20px rgb(39 54 42 / 4%); }
.fp-capture-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fp-capture-heading h2 { margin: 0; font: 600 17px/1.3 var(--sans, system-ui); }
.fp-photo-count { padding: 5px 10px; border-radius: 30px; color: #326754; background: #edf3ee; font: 600 13px/1.4 var(--sans, system-ui); }
.fp .flow-photo-select { border-radius: 16px; background: #f1f4ee; border-color: #c9d4c6; }
.fp .has-photo .flow-photo-select { border: 0; }
.fp .fp-add-photos { width: 100%; min-height: 48px; border: 1px solid var(--mp-ui-green); border-radius: 14px; background: var(--mp-ui-green); color: var(--mp-ui-on-accent); font-size: 15px; font-weight: 600; }
.fp .fp-add-photos:disabled { opacity: .45; }
.fp-guidance-dialog #fpDetectionMessage { margin: 0 0 var(--mp-ui-space-4); line-height: 1.55; }
.fp-photo-hint { margin: 0; text-align: center; font: 13px/1.5 var(--sans, system-ui); color: #677468; }
.fp-quick { min-width: 0; margin: 0; border: 0; }
.fp-quick > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 4px 2px; cursor: pointer; list-style: none; color: #4d6655; font: 500 14px/1.4 var(--sans, system-ui); }
.fp-quick > summary::-webkit-details-marker { display: none; }
.fp-quick-row { padding-bottom: 12px; }
.fp-actions > .mp-ui-action--accent { min-height: 50px; font-size: 16px; font-weight: 600; border-radius: 16px; }

/* Noms lisibles et cibles de retrait distinctes, sans crayon répété. */
.fp--items .fp-product-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fp--items .fp-product--removable { border-color: #e8eae2; border-radius: 16px; box-shadow: 0 2px 6px rgb(38 49 37 / 3%); }
.fp--items .fp-product--removable > .fp-product-open { min-height: 54px; padding: 12px 14px; }
.fp--items .fp-product--removable .fp-product-name { font-size: 16px; line-height: 1.4; color: #243b2d; }
.fp--items .fp-product--removable > .fp-product-remove { margin-right: 4px; color: #748276; }
.fp--items .fp-product--removable > .fp-product-remove:hover { color: #b3261e; }
.fp-sectionline .mp-ui-action { border: 1px solid #d9e3d6; border-radius: 30px; font-size: 14px; background: #f0f5ed; }
.mp-page[data-screen="frigo-photos"] .mp-page-heading h1,
.mp-page[data-screen="frigo-aliments"] .mp-page-heading h1 { font-size: 32px; line-height: 1.1; }
.mp-page[data-screen="frigo-photos"] .mp-page-heading p,
.mp-page[data-screen="frigo-aliments"] .mp-page-heading p { font-size: 15px; line-height: 1.5; }
.mp-page[data-screen="frigo-photos"] #screenFooter,
.mp-page[data-screen="frigo-aliments"] #screenFooter { padding-top: 12px; padding-bottom: 12px; border-top: 0; }
.fp-quick summary:focus-visible { outline: 2px solid #326754; outline-offset: 2px; border-radius: 8px; }
@media (min-width: 580px) { .fp--items .fp-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 350px) { .fp-picker { padding: 12px; border-radius: 20px; } }

/* Historique au niveau du titre, sans deuxième menu sous les photos. */
.mp-page[data-screen="frigo-photos"] .fp-photo-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 10px; }
.mp-page[data-screen="frigo-photos"] .fp-photo-heading > h1 { grid-column: 1; grid-row: 1; margin: 0; }
.mp-page[data-screen="frigo-photos"] .fp-photo-heading > p { grid-column: 1 / -1; grid-row: 2; margin: 0; }
.mp-page[data-screen="frigo-photos"] .fp-history-action { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; align-self: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid #dbe6dc; border-radius: 24px; background: #edf4ee; color: #326754; font: 600 13px/1.2 var(--sans, system-ui); white-space: nowrap; box-shadow: none; }
.mp-page[data-screen="frigo-photos"] .fp-history-action svg { width: 18px; height: 18px; flex: none; }
.mp-page[data-screen="frigo-photos"] .fp-history-action:hover { background: #e1eee4; }
.mp-page[data-screen="frigo-photos"] .fp-history-action:focus-visible { outline: 2px solid #326754; outline-offset: 3px; }
.mp-page[data-screen="frigo-photos"] .fp-history-action:disabled { opacity: .45; }
.fp-history-resume { justify-content: flex-start; min-height: 48px; gap: 8px; }
.fp-catalogue-search { margin-bottom: 18px; min-width: 0; }
.fp-catalogue-search .mp-ui-input { width: 100%; min-width: 0; box-sizing: border-box; }
.fp-catalogue-results { display: grid; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }
.fp-catalogue-results .mp-ui-action { width: 100%; min-height: 44px; justify-content: flex-start; }
@media (max-width: 374px) {
  .mp-page[data-screen="frigo-photos"] .fp-history-action { width: 44px; padding: 0; }
  .mp-page[data-screen="frigo-photos"] .fp-history-action > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Recipe loading uses the shared button aria-busy indicator, including reduced motion. */
