/* ==========================================================================
   Plan de table — repères des invités (octobre 2026)
   Une icône par information, identique sur la place, la légende, les pastilles
   de table et la fiche : enfant, ado, allergie, végétarien, végétalien, autre régime.
   ========================================================================== */

/* --- Pastilles posées sur les places --- */
#wpz-plan-de-table .wpz-pt-seat.has-guest.seat-allergy::after,
#wpz-plan-de-table .wpz-pt-seat.has-guest.seat-enfant::before { content: none; display: none; }
#wpz-plan-de-table .wpz-pt-seat-badges { position: absolute; inset: 0; pointer-events: none; }
.wpz-pt-seat-badge {
  position: absolute; width: 20px; height: 20px; border-radius: 999px;
  display: grid; place-items: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(29, 24, 25, .22);
  color: #fff; line-height: 0;
}
.wpz-pt-seat-badge svg { width: 12px; height: 12px; }
#wpz-plan-de-table .wpz-pt-seat-badges .wpz-pt-seat-badge--child,
#wpz-plan-de-table .wpz-pt-seat-badges .wpz-pt-seat-badge--ado { top: -5px; left: -5px; }
#wpz-plan-de-table .wpz-pt-seat-badges .wpz-pt-seat-badge--allergy { top: -5px; right: -5px; }
#wpz-plan-de-table .wpz-pt-seat-badges .wpz-pt-seat-badge--veg,
#wpz-plan-de-table .wpz-pt-seat-badges .wpz-pt-seat-badge--vegan,
#wpz-plan-de-table .wpz-pt-seat-badges .wpz-pt-seat-badge--special { bottom: -5px; right: -5px; }
.wpz-pt-seat-badge--child   { background: #C08A2E; }
.wpz-pt-seat-badge--ado     { background: #fff; color: #9A6B1F; border-color: #C08A2E; }
.wpz-pt-seat-badge--allergy { background: #C53030; }
.wpz-pt-seat-badge--veg     { background: #5C7E62; }
.wpz-pt-seat-badge--vegan   { background: #3F5E45; }
.wpz-pt-seat-badge--special { background: #4A4144; }
/* « × » pour libérer la place : en bas à gauche, pour ne pas cacher l'allergie */
#wpz-plan-de-table .wpz-pt-seat-remove { top: auto; bottom: -6px; right: auto; left: -6px; z-index: 2; }

/* --- Toucher « 2 enfants » : les places concernées s'illuminent, les autres s'effacent --- */
#wpz-plan-de-table .wpz-pt-seat.is-flagged { z-index: 3; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #C08A2E, 0 8px 18px rgba(192, 138, 46, .35); animation: wpz-pt-flag .9s ease-in-out 3; }
#wpz-plan-de-table .wpz-pt-table:has(.wpz-pt-seat.is-flagged) .wpz-pt-seat.has-guest:not(.is-flagged) { opacity: .32; transition: opacity .2s; }
@keyframes wpz-pt-flag { 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { #wpz-plan-de-table .wpz-pt-seat.is-flagged { animation: none; } }

/* --- Pastilles des tables : cliquables, avec icône --- */
#wpz-plan-de-table button.wpz-pt-table-stat { font: inherit; font-size: .74rem; font-weight: 600; line-height: 1.2; min-height: 26px; padding: 3px 10px 3px 7px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
#wpz-plan-de-table button.wpz-pt-table-stat:hover { box-shadow: 0 2px 8px rgba(29, 24, 25, .1); }
#wpz-plan-de-table button.wpz-pt-table-stat:active { transform: scale(.96); }
#wpz-plan-de-table button.wpz-pt-table-stat:focus-visible { outline: 2px solid var(--wpt-brand); outline-offset: 2px; }
#wpz-plan-de-table .wpz-pt-table-stat svg { width: 14px; height: 14px; flex: none; }
#wpz-plan-de-table .wpz-pt-table-stat--child { background: #FBF3E4; color: #8A5E17; border-color: rgba(192, 138, 46, .35); }
#wpz-plan-de-table .wpz-pt-table-stat--ado { background: #fff; color: #8A5E17; border-color: rgba(192, 138, 46, .45); }
#wpz-plan-de-table .wpz-pt-table-stat--allergy { background: #FDEEEE; color: #A32626; border-color: rgba(197, 48, 48, .28); }
#wpz-plan-de-table .wpz-pt-table-stat--regime { background: var(--wpt-sage-soft); color: #3F5E45; border-color: var(--wpt-sage-border); }
#wpz-plan-de-table .wpz-pt-inspector-stats > button.wpz-pt-table-stat { border-radius: var(--wpt-radius-full); }

/* --- Légende : mêmes places, mêmes pastilles --- */
#wpz-plan-de-table .wpz-pt-legend-list { gap: 9px; }
#wpz-plan-de-table .wpz-pt-legend-list li { gap: 12px; line-height: 1.3; }
.wpz-pt-legend-seat { position: relative; flex: none; width: 26px; height: 26px; border-radius: 999px; background: linear-gradient(135deg, #B5637A 0%, #9A4F65 100%); }
.wpz-pt-legend-seat.is-veg { background: linear-gradient(135deg, #7A9D80 0%, #5C7E62 100%); }
.wpz-pt-legend-seat.is-vegan { background: #5C7E62; }
.wpz-pt-legend-seat.is-special { background: linear-gradient(135deg, #C9A87C 0%, #A88656 100%); }
.wpz-pt-legend-seat.is-empty { background: #fff; border: 1.5px dashed #E2D3CB; }
.wpz-pt-legend-seat .wpz-pt-seat-badge { top: -6px; right: -8px; width: 18px; height: 18px; }
.wpz-pt-legend-seat .wpz-pt-seat-badge svg { width: 11px; height: 11px; }
#wpz-plan-de-table .wpz-pt-legend-list li.wpz-pt-legend-tip { display: block; margin-top: 4px; padding: 9px 11px; border-radius: 10px; background: var(--wpt-brand-soft); color: var(--wpt-soft); font-size: .78rem; line-height: 1.4; }

/* --- Inspecteur : boutons qui tiennent dans la colonne (avant : « Forme », « Dupliquer » coupés) --- */
#wpz-plan-de-table .wpz-pt-inspector-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#wpz-plan-de-table .wpz-pt-inspector-actions > button { min-width: 0; white-space: normal; line-height: 1.2; justify-content: flex-start; text-align: left; padding-left: 10px; padding-right: 10px; }
#wpz-plan-de-table .wpz-pt-inspector-actions > button svg { width: 16px; height: 16px; flex: none; }
#wpz-plan-de-table .wpz-pt-inspector-actions .wpz-pt-toggle-kids { grid-column: 1 / -1; }
#wpz-plan-de-table .wpz-pt-card--inspector, #wpz-plan-de-table .wpz-pt-card--inspector * { min-width: 0; }
#wpz-plan-de-table .wpz-pt-card-title { overflow-wrap: anywhere; }

/* --- Compteur de places (tables rondes) --- */
#wpz-plan-de-table .wpz-pt-seat-stepper { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; padding: 8px 10px; border-radius: 12px; background: var(--wpt-bg); border: 1px solid var(--wpt-line); }
#wpz-plan-de-table .wpz-pt-seat-stepper[hidden] { display: none; }
#wpz-plan-de-table .wpz-pt-seat-stepper__lbl { flex: 1; font-size: .82rem; font-weight: 600; color: var(--wpt-soft); }
#wpz-plan-de-table .wpz-pt-seat-stepper button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--wpt-brand-border); background: #fff; color: var(--wpt-brand-dark); cursor: pointer; padding: 0; }
#wpz-plan-de-table .wpz-pt-seat-stepper button:hover:not(:disabled) { background: var(--wpt-brand-soft); }
#wpz-plan-de-table .wpz-pt-seat-stepper button:disabled { opacity: .4; cursor: default; }
#wpz-plan-de-table .wpz-pt-seat-stepper button svg { width: 16px; height: 16px; }
#wpz-plan-de-table .wpz-pt-seat-stepper output { min-width: 30px; text-align: center; font-size: 1.05rem; font-weight: 700; color: var(--wpt-ink); font-variant-numeric: tabular-nums; }
.wpz-pt-shrink-list { margin: 8px 0 0; padding-left: 18px; font-size: .9rem; line-height: 1.5; }

/* --- Bulle de message : au-dessus de la barre d'outils du bas, jamais dessus --- */
.wpz-pt-toast {
  position: fixed; left: 50%; bottom: var(--wpz-pt-float-bottom, calc(140px + env(safe-area-inset-bottom, 0px))); z-index: 100000;
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px;
  background: #1D1819; color: #fff; font: 500 14px/1.4 'DM Sans', system-ui, sans-serif; text-align: center;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.wpz-pt-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.wpz-pt-toast.is-error { background: #8A2E45; }
body:has(.wpz-pt-pickbar:not([hidden])) .wpz-pt-toast { bottom: calc(var(--wpz-pt-float-bottom, 140px) + var(--wpz-pt-pick-h, 150px) + 10px); }

/* --- Fiche de l'invité (premier toucher) --- */
.wpz-pt-pickbar { bottom: var(--wpz-pt-float-bottom, calc(140px + env(safe-area-inset-bottom, 0px))); align-items: flex-end; gap: 14px; padding: 14px 16px; }
.wpz-pt-pick__card { flex: 1; min-width: 0; display: grid; gap: 8px; }
.wpz-pt-pick__who strong { display: block; font-size: 16px; line-height: 1.25; }
.wpz-pt-pickbar .wpz-pt-pick__who span { display: block; flex: none; margin-top: 2px; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.wpz-pt-pick__tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wpz-pt-pick__tags li { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 13px; line-height: 1.3; }
.wpz-pt-pick__tags li svg { width: 22px; height: 22px; padding: 4px; border-radius: 999px; flex: none; background: rgba(255, 255, 255, .18); color: #fff; }
.wpz-pt-pick__tags li.is-child svg { background: #C08A2E; }
.wpz-pt-pick__tags li.is-ado svg { background: #fff; color: #9A6B1F; }
.wpz-pt-pick__tags li.is-allergy { background: rgba(197, 48, 48, .28); }
.wpz-pt-pick__tags li.is-allergy svg { background: #C53030; }
.wpz-pt-pick__tags li.is-veg svg { background: #5C7E62; }
.wpz-pt-pick__tags li.is-vegan svg { background: #3F5E45; }
.wpz-pt-pick__tags li.is-special svg { background: #6B6064; }
.wpz-pt-pick__tags li.is-plain { padding-left: 11px; color: rgba(255, 255, 255, .8); }
.wpz-pt-pickbar .wpz-pt-pick__hint { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.wpz-pt-pick__actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
@media (max-width: 560px) {
  .wpz-pt-pickbar { flex-wrap: wrap; }
  .wpz-pt-pick__card { flex-basis: 100%; }
  .wpz-pt-pick__actions { flex-direction: row; width: 100%; }
  .wpz-pt-pick__actions button { flex: 1; }
}
@media print { .wpz-pt-toast { display: none !important; } }

/* --- Fenêtres (téléphone, tablette jusqu’à 1100 px) : fixées à l’écran ---
   plan-de-table-premium.css remettait le fond de la fenêtre dans le flux (position: relative) :
   « Places », « Renommer », « Ajouter une table »… s’ouvraient tout en bas de la page, hors de l’écran,
   page bloquée. On la refixe sur tout l’écran. */
#wpz-plan-de-table.wpz-pt-v2 > .wpz-pt-modal-backdrop { position: fixed; inset: 0; z-index: 99999; }

/* --- Grille des tables (octobre 2026) : cartes d’au moins 360 px, donc moins de tables par ligne sur grand écran ;
   le cercle des places tient dans la carte (avant : places du bord coupées, tables collées aux bords). --- */
#wpz-plan-de-table .wpz-pt-canvas { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)) !important; gap: 20px; }
#wpz-plan-de-table .wpz-pt-table-round-wrapper { max-width: min(280px, calc(100% - 64px)); }
