/**
 * Masque la quantité pour les variations configurées (VIP), même après FooEvents.
 */
form.variations_form.plan-salle-hide-qty .woocommerce-variation-add-to-cart .quantity {
  display: none !important;
}

.plan-salle-viewer-trigger-wrap {
  margin: 0.75rem 0 1rem;
}

.plan-salle-button-container {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  vertical-align: middle;
}

body.plan-salle-viewer-modal-active {
  overflow: hidden;
}

/**
 * Masque la dialog FooEvents (`#fooevents_seating_dialog`, son wrapper jQuery UI
 * et l'overlay) tant que notre plan SVG est ouvert. Le DOM reste actif pour que
 * la simulation de clic sur les <span> continue d'alimenter `selectedSeatsObject`.
 */
.plan-salle-fe-hidden,
.plan-salle-fe-hidden.ui-dialog,
.plan-salle-fe-hidden.ui-widget-overlay {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.plan-salle-viewer-modal-active .ui-widget-overlay,
body.plan-salle-viewer-modal-active #fooevents_seating_dialog,
body.plan-salle-viewer-modal-active .ui-dialog,
body.plan-salle-viewer-modal-active .ui-effects-wrapper,
body.plan-salle-viewer-modal-active .ui-effects-placeholder {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  /* Position off-screen au cas où visibility serait surchargée par jQuery UI. */
  position: fixed !important;
  left: -100000px !important;
  top: -100000px !important;
  z-index: -1 !important;
}

/* Notre propre modal SVG ne doit pas être masquée par les règles ci-dessus. */
body.plan-salle-viewer-modal-active #plan-salle-viewer-modal,
body.plan-salle-viewer-modal-active #plan-salle-viewer-modal * {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.plan-salle-viewer-modal {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  min-height: 100vh;
  z-index: 200050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  isolation: isolate;
}

.plan-salle-viewer-modal.is-open {
  display: flex;
}

.plan-salle-viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.plan-salle-viewer-modal__dialog {
  position: relative;
  z-index: 2;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

/* Header sticky en haut : titre + bouton fermer bien visibles */
.plan-salle-viewer-modal__header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.plan-salle-viewer-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.plan-salle-viewer-modal__close {
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  color: #334155;
  border-radius: 999px;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.plan-salle-viewer-modal__close:hover,
.plan-salle-viewer-modal__close:focus-visible {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
  outline: none;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.18);
  transform: scale(1.05);
}

.plan-salle-viewer-modal__close:active {
  transform: scale(0.97);
}

.plan-salle-viewer-modal__img-wrap {
  flex: 1 1 auto;
  margin: 0;
  padding: 0.75rem;
}

.plan-salle-viewer-map {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.plan-salle-viewer-hotspots {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  pointer-events: none;
}

.plan-salle-hotspot {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  border: 2px solid rgba(34, 113, 177, 0.55);
  background: rgba(34, 113, 177, 0.12);
  cursor: pointer;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.plan-salle-hotspot:hover,
.plan-salle-hotspot:focus {
  background: rgba(34, 113, 177, 0.28);
  border-color: rgba(21, 90, 150, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
  outline: none;
}

.plan-salle-viewer-modal__img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 0 auto;
  vertical-align: top;
}

.plan-salle-viewer-modal--builtin .plan-salle-viewer-modal__dialog {
  max-width: min(98vw, 1320px);
}

/* Plan intégré : fenêtre plein écran */
.plan-salle-viewer-modal--fs {
  padding: 0 !important;
  align-items: stretch;
  justify-content: stretch;
}

.plan-salle-viewer-modal--fs .plan-salle-viewer-modal__dialog {
  width: 100%;
  max-width: none !important;
  height: 100%;
  max-height: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.plan-salle-viewer-modal--fs .plan-salle-viewer-modal__img-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
  -webkit-overflow-scrolling: touch;
}

.plan-salle-viewer-modal--builtin .plan-salle-viewer-map {
  display: block;
  width: 100%;
  max-width: 100%;
}

.plan-salle-viewer-builtin-mount {
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.plan-salle-viewer-modal--hybrid .plan-salle-viewer-builtin-mount {
  width: 100%;
}

/* ——— Mode hybride (option C) : image/SVG + même overlay interactif ——— */

.plan-salle-hybrid {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  /* Superposition sans hauteur figée sur l’image : la rangée du bas peut dépasser le bitmap */
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.plan-salle-hybrid__graphic {
  grid-area: 1 / 1;
  position: relative;
  z-index: 0;
  margin: 0;
  line-height: 0;
  width: 100%;
  align-self: start;
}

.plan-salle-hybrid__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  vertical-align: top;
}

.plan-salle-hybrid__overlay {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  pointer-events: none;
}

.plan-salle-hybrid__overlay button,
.plan-salle-hybrid__overlay .plan-salle-builtin-seat {
  pointer-events: auto;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin__topbar {
  display: none;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin__zone {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin__sheet-gap {
  opacity: 0;
  pointer-events: none;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin__zone-title,
.plan-salle-builtin--hybrid-visual .plan-salle-builtin__stage {
  opacity: 0;
  pointer-events: none;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin-table {
  opacity: 0;
  border-color: transparent;
  background: transparent !important;
  box-shadow: none !important;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin-table.is-selected {
  opacity: 0;
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin-seat.plan-salle-chair-dot--orbit {
  opacity: 0.45;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.plan-salle-builtin--hybrid-visual .plan-salle-builtin-seat.plan-salle-chair-dot--orbit:hover,
.plan-salle-builtin--hybrid-visual .plan-salle-builtin-seat.plan-salle-chair-dot--orbit:focus-visible,
.plan-salle-builtin--hybrid-visual .plan-salle-builtin-seat.plan-salle-chair-dot--orbit.is-seat-selected {
  opacity: 1;
}

.plan-salle-viewer-modal--builtin .plan-salle-viewer-hotspots:empty {
  display: none;
}

/* ——— Plan intégré SVG (rendu pixel-perfect, identique partout) ——— */

.plan-salle-builtin--svg {
  display: block;
  width: 100%;
  max-width: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #fff;
}

.plan-salle-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  background: #fff;
}

.plan-salle-svg text {
  user-select: none;
  -webkit-user-select: none;
}

.plan-salle-svg__bg {
  fill: #fff;
}

.plan-salle-svg__zone-title {
  fill: #008080;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.plan-salle-svg__logo {
  fill: #008080;
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
}

.plan-salle-svg__logo-tagline {
  fill: #64748b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.plan-salle-svg__separator {
  stroke: #c8c8c8;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.plan-salle-svg__watermark {
  fill: #f1f5f9;
  font-size: 110px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -2px;
  pointer-events: none;
}

/* SCENE */
.plan-salle-svg__stage {
  fill: #000;
  stroke: #000;
}

.plan-salle-svg__stage-text {
  fill: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 4px;
}

/* PISTE */
.plan-salle-svg__piste {
  fill: #fff;
  stroke: #b0b0b0;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.plan-salle-svg__piste-text {
  fill: #0a0a0a;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 5px;
}

.plan-salle-svg__stairs {
  fill: #000;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* BAR */
.plan-salle-svg__bar {
  fill: #f97316;
  stroke: #c2410c;
}

.plan-salle-svg__bar-text {
  fill: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2.5px;
}

/* ENTREE */
.plan-salle-svg__entree {
  fill: #34d399;
  stroke: #047857;
}

.plan-salle-svg__entree-text {
  fill: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2.5px;
}

.plan-salle-svg__entree-arrow {
  fill: #0a0a0a;
  font-size: 22px;
  font-weight: 900;
}

/* U Balcon */
.plan-salle-svg__u {
  fill: none;
  stroke: #0a0a0a;
  stroke-width: 13;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

/* Tables (cliquables) */
.plan-salle-svg-table {
  cursor: pointer;
}

.plan-salle-svg-table__bg {
  fill: #d4d4d4;
  stroke: #1f1f1f;
  stroke-width: 1;
  transition: filter 0.12s ease, stroke 0.12s ease, stroke-width 0.12s ease;
}

.plan-salle-svg-table:hover .plan-salle-svg-table__bg,
.plan-salle-svg-table:focus-visible .plan-salle-svg-table__bg {
  filter: brightness(1.06);
  stroke-width: 1.5;
}

.plan-salle-svg-table.is-selected .plan-salle-svg-table__bg {
  stroke: #008080;
  stroke-width: 3;
}

.plan-salle-svg-table:focus-visible {
  outline: none;
}

.plan-salle-svg-table__label {
  fill: #050505;
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
  text-transform: lowercase;
}

.plan-salle-svg-table__label--round {
  font-size: 9.5px;
}

.plan-salle-svg-table__cap {
  fill: #1f2937;
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
}

/* Sièges (cliquables, multi-sélection) */
.plan-salle-svg-seat {
  fill: #2f9e54;
  stroke: rgba(15, 90, 40, 0.45);
  stroke-width: 1;
  cursor: pointer;
  transition: stroke 0.12s ease, stroke-width 0.12s ease, fill 0.12s ease;
}

.plan-salle-svg-seat:hover {
  stroke: #008080;
  stroke-width: 2;
}

.plan-salle-svg-seat:focus-visible {
  outline: none;
  stroke: #008080;
  stroke-width: 2;
}

.plan-salle-svg-seat.is-seat-selected {
  fill: #16a34a;
  stroke: #008080;
  stroke-width: 3;
}

/* Modal plein écran : laisser le SVG occuper la zone disponible */
.plan-salle-viewer-modal--fs .plan-salle-builtin--svg {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.plan-salle-viewer-modal--fs .plan-salle-svg {
  max-height: calc(100vh - 5rem);
  max-height: calc(100dvh - 5rem);
}

/* Indications sous le plan */
.plan-salle-builtin--svg .plan-salle-builtin__hint {
  margin: 0.85rem 0 0.5rem;
  font-size: 0.82rem;
  color: #475569;
  text-align: center;
}

/* Mode hybride : image de fond + SVG overlay invisible (sauf tables/sièges) */
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__bg,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__zone-title,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__logo,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__logo-tagline,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__separator,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__watermark,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__stage,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__stage-text,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__piste,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__piste-text,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__stairs,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__bar,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__bar-text,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__entree,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__entree-text,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__entree-arrow,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg__u {
  display: none;
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-table__bg {
  fill: rgba(212, 212, 212, 0.001);
  stroke: rgba(31, 31, 31, 0.001);
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-table__label,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-table__cap {
  display: none;
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-table.is-selected .plan-salle-svg-table__bg {
  fill: rgba(0, 128, 128, 0.18);
  stroke: #008080;
  stroke-width: 3;
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-seat {
  opacity: 0.55;
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-seat:hover,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-seat:focus-visible,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg .plan-salle-svg-seat.is-seat-selected {
  opacity: 1;
}

/* ——— Ancien plan intégré HTML (captures e-gracia) — conservé en fallback ——— */

.plan-salle-builtin {
  --plan-teal: #008080;
  --plan-teal-dark: #006666;
  --plan-teal-entree: #009494;
  --plan-orange-bar: #f97316;
  --plan-chair: #2f9e54;
  --plan-table-fill: #d4d4d4;
  --plan-table-edge: #1f1f1f;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.25;
  color: #171717;
  max-width: 100%;
  background: #fff;
}

.plan-salle-builtin__topbar {
  text-align: center;
  padding: 0.35rem 0.6rem 0.65rem;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 0.45rem;
}

.plan-salle-builtin__logo-tagline {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.plan-salle-builtin__logo {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.plan-salle-builtin__logo--egracia {
  font-size: 1.42rem;
  font-style: italic;
  color: var(--plan-teal);
}

.plan-salle-builtin__logo--dcn {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #9ca3af;
}

.plan-salle-builtin__sheet {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.plan-salle-builtin__sheet-gap {
  display: none;
}

@media (min-width: 900px) {
  .plan-salle-builtin__sheet {
    grid-template-columns: minmax(0, 1.12fr) auto minmax(0, 0.92fr);
    gap: 0;
    align-items: start;
  }

  .plan-salle-builtin__sheet-gap {
    display: block;
    width: 0;
    justify-self: center;
    margin: 10px 6px;
    align-self: stretch;
    min-height: 180px;
    border-left: 2px dashed #bdbdbd;
  }
}

.plan-salle-builtin__zone {
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  padding: 0.65rem 0.85rem 0.75rem;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  /* Ne pas masquer les orbites de sièges / dernière rangée (tables 5–6 balcon) */
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

.plan-salle-builtin__zone--balcon {
  padding-bottom: 1.35rem;
}

.plan-salle-builtin__zone-title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--plan-teal);
  text-align: center;
}

.plan-salle-builtin__stage {
  text-align: center;
  font-size: clamp(0.82rem, 2.1vw, 1.05rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  padding: 0.48rem 0.65rem;
  margin-bottom: 0.45rem;
  background: #000;
  color: #fff;
  border-radius: 3px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

/* Chaises : nombre exact de points verts = capacité (ellipse autour de la table). */

.plan-salle-seat-unit {
  position: relative;
  box-sizing: border-box;
}

.plan-salle-seat-surround {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  max-width: 100%;
}

.plan-salle-seat-surround--rect {
  min-width: 5.5rem;
  min-height: 5rem;
  padding: 8px;
}

.plan-salle-seat-surround--round {
  min-width: 5.5rem;
  min-height: 5.5rem;
  padding: 8px;
}

.plan-salle-chair-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.plan-salle-chair-dot--orbit {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--plan-chair);
  box-shadow: 0 0 0 1px rgba(15, 90, 40, 0.35);
}

/* Sièges cliquables (chaises) : réactivent les hits sous le groupe orbit */
.plan-salle-builtin-seat.plan-salle-chair-dot--orbit {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  display: block;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
}

.plan-salle-builtin-seat.plan-salle-chair-dot--orbit.is-seat-selected {
  filter: brightness(1.08);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.98),
    0 0 0 4px var(--plan-teal),
    0 0 0 5px rgba(0, 128, 128, 0.25);
  z-index: 2;
}

.plan-salle-builtin-seat.plan-salle-chair-dot--orbit:not(.is-seat-selected):hover {
  filter: brightness(1.1);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 3px rgba(0, 128, 128, 0.55);
}

.plan-salle-builtin-seat.plan-salle-chair-dot--orbit:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--plan-teal);
}

.plan-salle-seat-unit--rect {
  margin-bottom: 20px;
}

.plan-salle-seat-unit--round {
  margin: 0 auto 16px;
}

.plan-salle-seat-surround .plan-salle-builtin-table {
  position: relative;
  z-index: 1;
}

.plan-salle-builtin-table {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.38rem 0.48rem;
  margin: 0;
  border: 1px solid var(--plan-table-edge);
  background: linear-gradient(180deg, #e8e8e8 0%, var(--plan-table-fill) 45%, #bdbdbd 100%);
  color: #0a0a0a;
  border-radius: 6px;
  min-width: 3.65rem;
  transition:
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

.plan-salle-builtin-table--rect {
  min-height: 3.15rem;
  min-width: 3.85rem;
}

.plan-salle-builtin-table--round {
  border-radius: 50%;
  width: 78px;
  height: 78px;
  min-width: 78px;
  min-height: 78px;
  padding: 0.3rem 0.36rem;
}

.plan-salle-builtin-table:not(.is-selected):hover,
.plan-salle-builtin-table:not(.is-selected):focus-visible {
  outline: none;
  filter: brightness(1.04);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.plan-salle-builtin-table.is-selected {
  outline: none;
  border-color: var(--plan-teal);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--plan-teal);
  z-index: 1;
}

.plan-salle-builtin-table__label {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.18;
  text-transform: lowercase;
  color: #050505;
}

.plan-salle-builtin-table__cap {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #111827;
}

.plan-salle-builtin-table__cap--pers {
  margin-top: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.12;
  color: #1f2937;
}

.plan-salle-builtin-table--round .plan-salle-builtin-table__label {
  font-size: 0.78rem;
  font-weight: 800;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin {
  font-size: clamp(15px, 1.85vmin + 11px, 24px);
}

.plan-salle-viewer-modal--fs .plan-salle-chair-orbit {
  transform: scale(1.06);
  transform-origin: center center;
}

.plan-salle-viewer-modal--fs .plan-salle-chair-dot--orbit {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin-seat.plan-salle-chair-dot--orbit {
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
}

.plan-salle-viewer-modal--fs .plan-salle-seat-surround--rect {
  min-width: 6.25rem;
  min-height: 5.75rem;
  padding: 10px;
}

.plan-salle-viewer-modal--fs .plan-salle-seat-surround--round {
  min-width: 6.25rem;
  min-height: 6.25rem;
  padding: 10px;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin-table--round {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin-table--rect {
  min-width: 4.65rem;
  min-height: 3.65rem;
}

.plan-salle-viewer-modal--fs .plan-salle-fosse-map__piste {
  min-height: 288px;
}

.plan-salle-viewer-modal--fs .plan-salle-balcon-map__grid {
  grid-template-rows: repeat(5, minmax(82px, auto));
  gap: 16px 22px;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin__logo--egracia {
  font-size: 1.65rem;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin__logo-tagline {
  font-size: 0.74rem;
}

.plan-salle-viewer-modal--fs .plan-salle-balcon-map__brand-sub {
  font-size: 0.62rem;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin__stage {
  font-size: clamp(1.05rem, 3vmin, 1.45rem);
  padding: 0.58rem 0.85rem;
  letter-spacing: 0.3em;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin-table__label {
  font-size: 0.82rem;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin-table__cap--pers {
  font-size: 0.74rem;
}

.plan-salle-viewer-modal--fs .plan-salle-builtin-table--round .plan-salle-builtin-table__label {
  font-size: 0.88rem;
}

/* ——— Fosse ——— */

.plan-salle-fosse-map__body {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4px 2px 8px;
  box-sizing: border-box;
  max-width: 100%;
}

.plan-salle-fosse-map__col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
  max-width: 100%;
}

.plan-salle-fosse-map__piste {
  flex: 1 1 48px;
  min-height: 260px;
  min-width: 48px;
  max-width: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px dashed #b0b0b0;
  border-radius: 2px;
}

.plan-salle-fosse-map__piste-inner {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  font-weight: 900;
  letter-spacing: 0.28em;
  color: #0a0a0a;
}

.plan-salle-fosse-map__east {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 108px;
}

.plan-salle-fosse-map__east-top {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
}

.plan-salle-fosse-map__stairs {
  align-self: flex-end;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
}

.plan-salle-fosse-map__foot-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 10px;
  align-items: stretch;
}

.plan-salle-fosse-map__bar {
  flex: 0 1 38%;
  max-width: 42%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--plan-orange-bar);
  color: #fff;
  font-weight: 900;
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  letter-spacing: 0.2em;
  border-radius: 3px;
  border: 1px solid #c2410c;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.plan-salle-fosse-map__entree {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  margin-top: 0;
  padding: 0.42rem 0.65rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  font-weight: 900;
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  letter-spacing: 0.22em;
  color: #fff;
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  border-radius: 3px;
  border: 1px solid #047857;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.plan-salle-fosse-map__entree-arrow {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  color: #0a0a0a;
  text-shadow: none;
}

.plan-salle-fosse-map__entree-word {
  letter-spacing: 0.22em;
}

.plan-salle-viewer-modal--fs .plan-salle-fosse-map__bar,
.plan-salle-viewer-modal--fs .plan-salle-fosse-map__entree {
  min-height: 52px;
  font-size: clamp(0.95rem, 2.4vmin, 1.12rem);
}

.plan-salle-viewer-modal--fs .plan-salle-fosse-map__entree-arrow {
  font-size: 1.18rem;
}

@media (max-width: 520px) {
  .plan-salle-fosse-map__body {
    flex-wrap: wrap;
  }

  .plan-salle-fosse-map__piste {
    order: 2;
    width: 100%;
    max-width: none;
    min-height: 44px;
    writing-mode: horizontal-tb;
  }

  .plan-salle-fosse-map__piste-inner {
    writing-mode: horizontal-tb;
    transform: none;
    letter-spacing: 0.12em;
  }

  .plan-salle-fosse-map__east {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
  }
}

/* ——— Balcon (U + tables rondes) ——— */

.plan-salle-balcon-map {
  position: relative;
  padding: 8px 12px 52px;
  min-height: 300px;
}

.plan-salle-balcon-map__u {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 10%;
  bottom: 26%;
  border: 10px solid #0a0a0a;
  border-bottom: none;
  border-radius: 48% 48% 0 0 / 92% 92% 0 0;
  pointer-events: none;
  z-index: 0;
}

.plan-salle-balcon-map__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(44px, 1fr) auto;
  grid-template-rows: repeat(5, minmax(72px, auto));
  gap: 14px 18px;
  align-items: center;
  justify-items: center;
}

.plan-salle-balcon-slot--t1 {
  grid-column: 1;
  grid-row: 1;
}

.plan-salle-balcon-slot--t2 {
  grid-column: 1;
  grid-row: 2;
}

.plan-salle-balcon-slot--t3 {
  grid-column: 1;
  grid-row: 3;
}

.plan-salle-balcon-slot--t4 {
  grid-column: 1;
  grid-row: 4;
}

.plan-salle-balcon-slot--t5 {
  grid-column: 1;
  grid-row: 5;
  justify-self: end;
}

.plan-salle-balcon-slot--t6 {
  grid-column: 2;
  grid-row: 5;
  justify-self: start;
}

/* Bras droit du U : de la scène vers le bas → table 10 … 7 */
.plan-salle-balcon-slot--t10 {
  grid-column: 3;
  grid-row: 1;
}

.plan-salle-balcon-slot--t9 {
  grid-column: 3;
  grid-row: 2;
}

.plan-salle-balcon-slot--t8 {
  grid-column: 3;
  grid-row: 3;
}

.plan-salle-balcon-slot--t7 {
  grid-column: 3;
  grid-row: 4;
}

.plan-salle-balcon-map__brand {
  position: absolute;
  right: 6px;
  bottom: 4px;
  z-index: 2;
  max-width: 48%;
  text-align: right;
  line-height: 1.35;
}

.plan-salle-balcon-map__brand-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #64748b;
}

.plan-salle-builtin__hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.45;
}

.plan-salle-viewer-toast {
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  background: #e7f5e9;
  color: #1e4620;
  border-radius: 4px;
  border: 1px solid #b8e0bc;
}

.plan-salle-viewer-toast.is-warning {
  background: #fff5f5;
  color: #b91c1c;
  border-color: #fecaca;
}

.plan-salle-viewer-toast.is-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

/* ========================================================================== */
/*  Header flottant : compteur de places sélectionnées + bouton "Ajouter"     */
/* ========================================================================== */

.plan-salle-viewer-modal__bottombar {
  display: none;
}

.plan-salle-viewer-modal--has-bridge .plan-salle-viewer-modal__bottombar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: linear-gradient(180deg, #f0fdfa 0%, #ecfdf5 100%);
  border-top: 2px solid #14b8a6;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 -4px 12px rgba(20, 184, 166, 0.18);
  min-height: 64px;
}

.plan-salle-viewer-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  color: #0f172a;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.plan-salle-viewer-counter__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #008080 0%, #0d9488 100%);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(0, 128, 128, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.plan-salle-viewer-counter__num.is-bumping {
  animation: plan-salle-counter-bump 0.32s ease-out;
}

@keyframes plan-salle-counter-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); box-shadow: 0 4px 14px rgba(0, 128, 128, 0.55); }
  100% { transform: scale(1); }
}

.plan-salle-viewer-counter__label {
  font-weight: 600;
  color: #115e59;
  font-size: 1rem;
  line-height: 1.25;
}

.plan-salle-viewer-cart {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 0.95rem 1.85rem;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45),
    inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease,
    opacity 0.15s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.plan-salle-viewer-cart:hover:not(:disabled),
.plan-salle-viewer-cart:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.55),
    inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.plan-salle-viewer-cart:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.plan-salle-viewer-cart:disabled {
  background: #cbd5e1;
  color: #f1f5f9;
  cursor: not-allowed;
  box-shadow: none;
}

/* Pulse léger quand le bouton devient actif (places sélectionnées). */
.plan-salle-viewer-cart:not(:disabled) {
  animation: plan-salle-cart-pulse 1.6s ease-in-out 2;
}

@keyframes plan-salle-cart-pulse {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45),
      inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  }
  50% {
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45),
      inset 0 -3px 0 rgba(0, 0, 0, 0.18),
      0 0 0 8px rgba(34, 197, 94, 0.18);
  }
}

.plan-salle-viewer-modal.is-submitting .plan-salle-viewer-cart {
  pointer-events: none;
  opacity: 0.7;
}

/* ========================================================================== */
/*  Responsive — header / bottombar / SVG                                     */
/* ========================================================================== */

/* Tablette portrait & en-dessous */
@media (max-width: 900px) {
  .plan-salle-viewer-modal__header {
    padding: 0.6rem 0.85rem;
  }
  .plan-salle-viewer-modal__title {
    font-size: 1rem;
  }
  .plan-salle-viewer-modal--has-bridge .plan-salle-viewer-modal__bottombar {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
    min-height: 60px;
  }
  .plan-salle-viewer-cart {
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
  }
}

/* Téléphone (portrait) */
@media (max-width: 640px) {
  .plan-salle-viewer-modal--fs .plan-salle-viewer-modal__img-wrap {
    padding: 0.45rem;
  }
  .plan-salle-viewer-modal__header {
    padding: 0.55rem 0.75rem;
  }
  .plan-salle-viewer-modal__title {
    font-size: 0.95rem;
  }
  .plan-salle-viewer-modal__close {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.4rem;
  }
  .plan-salle-viewer-modal--has-bridge .plan-salle-viewer-modal__bottombar {
    padding: 0.7rem 0.85rem;
    gap: 0.6rem;
    min-height: 0;
  }
  .plan-salle-viewer-counter {
    font-size: 0.92rem;
    gap: 0.5rem;
  }
  .plan-salle-viewer-counter__num {
    min-width: 2.2rem;
    height: 2.2rem;
    font-size: 1.2rem;
  }
  .plan-salle-viewer-counter__label {
    font-size: 0.85rem;
    line-height: 1.2;
  }
  .plan-salle-viewer-cart {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
  }

  /* Le SVG occupe toute la largeur ; on relâche la limite de hauteur sur mobile
     pour pouvoir scroller dans le plan (sticky header + sticky bottombar). */
  .plan-salle-viewer-modal--fs .plan-salle-svg {
    max-height: none;
    width: 100%;
    height: auto;
  }
}

/* Petit téléphone : on empile compteur / bouton sur deux lignes,
   le bouton prend toute la largeur pour être bien tappable. */
@media (max-width: 420px) {
  .plan-salle-viewer-modal--has-bridge .plan-salle-viewer-modal__bottombar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .plan-salle-viewer-counter {
    justify-content: center;
    flex: 0 0 auto;
  }
  .plan-salle-viewer-cart {
    width: 100%;
    text-align: center;
  }

  .plan-salle-viewer-modal__close {
    width: 2rem;
    height: 2rem;
    font-size: 1.3rem;
  }
}

/* Mode paysage très bas (téléphone tourné) : on compresse le header et le bottombar
   pour laisser un maximum d'espace au plan. */
@media (max-height: 480px) and (orientation: landscape) {
  .plan-salle-viewer-modal__header {
    padding: 0.4rem 0.75rem;
  }
  .plan-salle-viewer-modal--has-bridge .plan-salle-viewer-modal__bottombar {
    padding: 0.5rem 0.85rem;
    min-height: 0;
  }
  .plan-salle-viewer-counter__num {
    height: 2rem;
    min-width: 2rem;
    font-size: 1.05rem;
  }
  .plan-salle-viewer-cart {
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
  }
}

/* ========================================================================== */
/*  États sièges SVG : disponible / vendu / bloqué / déjà sélectionné par autre*/
/*  + sélection courante (couleur dédiée distincte)                            */
/* ========================================================================== */

/* État par défaut "disponible" déjà défini plus haut (.plan-salle-svg-seat) */

/* Vendu (déjà acheté par un autre client) */
.plan-salle-svg-seat.is-unavailable {
  fill: #cbd5e1;
  stroke: #94a3b8;
  stroke-width: 1;
  cursor: not-allowed;
  pointer-events: auto;
}

.plan-salle-svg-seat.is-unavailable:hover {
  stroke: #94a3b8;
  stroke-width: 1;
  filter: none;
}

/* Bloqué admin (motif rayé via stroke-dasharray pour visibilité) */
.plan-salle-svg-seat.is-blocked {
  fill: #f1f5f9;
  stroke: #475569;
  stroke-width: 1.4;
  stroke-dasharray: 2 1.2;
  cursor: not-allowed;
}

.plan-salle-svg-seat.is-blocked:hover {
  stroke: #475569;
}

/* Sélectionné par un autre attendee dans cette même commande */
.plan-salle-svg-seat.is-already-selected {
  fill: #fb923c;
  stroke: #b45309;
  stroke-width: 1.2;
  cursor: not-allowed;
}

/* Sélection courante : couleur fuchsia/rose vif, visiblement distincte */
.plan-salle-svg-seat.is-seat-selected {
  fill: #e11d48;
  stroke: #881337;
  stroke-width: 1.6;
  cursor: pointer;
}

.plan-salle-svg-seat.is-seat-selected:hover,
.plan-salle-svg-seat.is-seat-selected:focus-visible {
  fill: #be123c;
  stroke: #4c0519;
  stroke-width: 2;
}

/* Quand on n'a pas pu lire la dispo FooEvents, on permet le clic mais marque légèrement */
.plan-salle-svg-seat.is-no-data {
  /* Garde la couleur dispo par défaut, juste contour adouci */
  stroke-dasharray: none;
}

/* Animation de "shake" quand on tente de cliquer un siège indispo */
@keyframes plan-salle-shake {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-1.5px, 0); }
  40%  { transform: translate(1.5px, 0); }
  60%  { transform: translate(-1px, 0); }
  80%  { transform: translate(1px, 0); }
  100% { transform: translate(0, 0); }
}

.plan-salle-shake {
  animation: plan-salle-shake 0.32s ease-in-out;
  transform-origin: center;
  transform-box: fill-box;
}

/* Sur les tables : l'état sélectionné (au moins une place choisie via clic table) */
.plan-salle-svg-table.is-selected .plan-salle-svg-table__bg {
  fill: rgba(225, 29, 72, 0.12);
  stroke: #e11d48;
  stroke-width: 2.2;
}

/* En mode hybride, on conserve une visibilité forte pour les sièges sélectionnés */
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg
  .plan-salle-svg-seat.is-seat-selected {
  opacity: 1;
  fill: #e11d48;
  stroke: #4c0519;
  stroke-width: 2;
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg
  .plan-salle-svg-seat.is-unavailable,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg
  .plan-salle-svg-seat.is-blocked,
.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg
  .plan-salle-svg-seat.is-already-selected {
  opacity: 0.85;
}

.plan-salle-builtin--hybrid-visual.plan-salle-builtin--svg
  .plan-salle-svg-table.is-selected
  .plan-salle-svg-table__bg {
  fill: rgba(225, 29, 72, 0.18);
  stroke: #e11d48;
  stroke-width: 2.2;
}
