/* Plano arquitectónico compartido · Luco Gourmet (app + panel) */
.plano-arquitectonico {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.plano-alas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.plano-ala {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: var(--papel-claro, #F6EFE6);
  border: 1.5px solid var(--oliva, #516443);
  overflow: hidden;
  user-select: none;
}

.plano-ala-pb {
  aspect-ratio: 700 / 660;
}

.plano-ala-pa {
  aspect-ratio: 360 / 440;
  max-width: 380px;
  margin: 0 auto;
}

.plano-arq-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.plano-capa-mesas {
  position: absolute;
  inset: 0;
}

/* Nodos de mesa posicionados en planta */
.mesa-nodo {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, filter 0.16s ease;
  z-index: 2;
}
.mesa-nodo:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.07);
  z-index: 12;
}
.mesa-nodo:focus-visible {
  outline: 2.5px solid var(--cuero, #5E402D);
  outline-offset: 3px;
  z-index: 15;
}

/* Dimensiones por forma física real */
.mesa-nodo.forma-redonda { width: 10.6%; height: 11.2%; }
.mesa-nodo.forma-cuadrada { width: 11.2%; height: 11.8%; }
.mesa-nodo.forma-sillon { width: 13.5%; height: 11.6%; }
.mesa-nodo.forma-grande { width: 18.8%; height: 11.2%; }
.mesa-nodo.forma-barra { width: 11.4%; height: 9.8%; }

/* Escala proporcional dentro del ala más angosta de Terraza (360x440) */
.plano-ala-pa .mesa-nodo.forma-cuadrada { width: 22.5%; height: 18.5%; }
.plano-ala-pa .mesa-nodo.forma-grande { width: 39%; height: 17.5%; }

/* Tapa física de la mesa */
.nodo-tapa {
  position: relative;
  width: 78%;
  height: 76%;
  background: #FAF5EC;
  border: 2px solid var(--oliva, #516443);
  color: var(--tinta, #242D1E);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(36, 45, 30, 0.14);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.mesa-nodo.forma-redonda .nodo-tapa,
.mesa-nodo.forma-barra .nodo-tapa {
  border-radius: 50%;
  width: 76%;
  height: 78%;
}
.mesa-nodo.forma-cuadrada .nodo-tapa { border-radius: 3px; }
.mesa-nodo.forma-sillon .nodo-tapa { border-radius: 3px; width: 72%; height: 80%; }
.mesa-nodo.forma-grande .nodo-tapa { border-radius: 4px; width: 88%; height: 70%; }

/* Estados visuales */
.mesa-nodo.libre .nodo-tapa {
  background: #FAF5EC;
  border-color: rgba(81, 100, 67, 0.55);
}
.mesa-nodo.ocupada .nodo-tapa {
  background: #D9C3A8;
  border-color: var(--oliva-oscuro, #39482F);
  box-shadow: 0 2px 6px rgba(57, 72, 47, 0.22);
}
.mesa-nodo.de-app .nodo-tapa {
  background: var(--oliva, #516443);
  border-color: var(--oliva-oscuro, #39482F);
  color: #FAF5EC;
}
.mesa-nodo.de-app .nodo-num,
.mesa-nodo.de-app .nodo-tot,
.mesa-nodo.de-app .nodo-cap {
  color: #FAF5EC;
}

.mesa-nodo.alerta .nodo-tapa {
  border-color: var(--alerta, #A3482B);
  border-width: 2.5px;
  box-shadow: 0 0 0 2px rgba(163, 72, 43, 0.28);
}

.mesa-nodo.seleccionada .nodo-tapa {
  outline: 3px solid var(--cuero, #5E402D);
  outline-offset: 2px;
  box-shadow: 0 4px 12px rgba(94, 64, 45, 0.36);
}

.mesa-nodo.actual {
  cursor: not-allowed;
}
.mesa-nodo.actual .nodo-tapa {
  background: var(--cuero, #5E402D);
  border-color: var(--cuero-oscuro, #462F20);
  color: #FAF5EC;
}
.mesa-nodo.actual .nodo-num,
.mesa-nodo.actual .nodo-cap {
  color: #FAF5EC;
}

.mesa-nodo.origen-mover {
  opacity: 0.52;
}
.mesa-nodo.destino-libre .nodo-tapa {
  background: rgba(81, 100, 67, 0.22);
  border: 2px dashed var(--oliva-oscuro, #39482F);
  animation: pulsoDestino 1.5s ease-in-out infinite;
}
.mesa-nodo.destino-ocupada .nodo-tapa {
  border: 2px dashed var(--cuero, #5E402D);
}

/* Pulso vivo en mesas que llaman al mozo o piden cuenta */
.nodo-pulso {
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid var(--alerta, #A3482B);
  animation: pulsoMesaAlerta 1.6s ease-out infinite;
  pointer-events: none;
}

@keyframes pulsoMesaAlerta {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.38); opacity: 0; }
}
@keyframes pulsoDestino {
  0%, 100% { box-shadow: 0 0 0 0 rgba(81, 100, 67, 0.42); }
  50% { box-shadow: 0 0 0 6px rgba(81, 100, 67, 0); }
}

.mesa-recien-llegada .nodo-tapa {
  animation: llegadaMesa 0.52s ease-out;
}
@keyframes llegadaMesa {
  0% { transform: scale(1.2); box-shadow: 0 0 0 0 rgba(94, 64, 45, 0.65); }
  100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(94, 64, 45, 0); }
}

/* Tipografía sobre cada mesa */
.nodo-num {
  font-family: var(--f-disp, 'Barlow Condensed', sans-serif);
  font-size: clamp(13px, 2.6vw, 22px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--tinta, #242D1E);
}
.nodo-tot, .nodo-cap {
  font-family: var(--f-mono, 'IBM Plex Mono', monospace);
  font-size: clamp(7.5px, 1.05vw, 10px);
  line-height: 1.05;
  color: var(--tinta-suave, #55604C);
  white-space: nowrap;
  margin-top: 1px;
}
.nodo-tot {
  font-weight: 600;
  color: var(--oliva-oscuro, #39482F);
}
.nodo-tot-corto { letter-spacing: -0.02em; }

/* En modo modal compacto de app, ocultar el total en pesos para mayor limpieza */
.plano-modo-app .nodo-num { font-size: clamp(13px, 3vw, 19px); }

/* Sillas alrededor de cada mesa según cantidad de lugares */
.nodo-sillas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.silla {
  position: absolute;
  background: #8D745B;
  border: 1px solid #462F20;
  border-radius: 2px;
}
.mesa-nodo.ocupada .silla { background: #5E402D; }
.mesa-nodo.de-app .silla { background: #39482F; border-color: #242D1E; }

/* 2 sillas (redonda: izq/der) */
.s-izq { width: 13%; height: 34%; left: 0; top: 33%; border-radius: 4px 1px 1px 4px; }
.s-der { width: 13%; height: 34%; right: 0; top: 33%; border-radius: 1px 4px 4px 1px; }

/* 4 sillas (cuadrada: N/S/E/O) */
.s-n { width: 34%; height: 12%; top: 0; left: 33%; border-radius: 4px 4px 1px 1px; }
.s-s { width: 34%; height: 12%; bottom: 0; left: 33%; border-radius: 1px 1px 4px 4px; }
.s-o { width: 12%; height: 34%; left: 0; top: 33%; border-radius: 4px 1px 1px 4px; }
.s-e { width: 12%; height: 34%; right: 0; top: 33%; border-radius: 1px 4px 4px 1px; }

/* Sillón verde + 2 sillas opuestas */
.s-sillon { width: 15%; height: 82%; left: 0; top: 9%; background: #39482F !important; border-color: #242D1E !important; border-radius: 3px; }
.s-der1 { width: 12%; height: 28%; right: 1%; top: 14%; border-radius: 1px 4px 4px 1px; }
.s-der2 { width: 12%; height: 28%; right: 1%; bottom: 14%; border-radius: 1px 4px 4px 1px; }

/* 6 sillas (mesa larga: 3 arriba, 3 abajo) */
.s-t1, .s-t2, .s-t3 { width: 19%; height: 14%; top: 0; border-radius: 4px 4px 1px 1px; }
.s-d1, .s-d2, .s-d3 { width: 19%; height: 14%; bottom: 0; border-radius: 1px 1px 4px 4px; }
.s-t1, .s-d1 { left: 10%; }
.s-t2, .s-d2 { left: 40.5%; }
.s-t3, .s-d3 { right: 10%; }

/* 2 banquetas redondas de barra (abajo de la barra) */
.s-b1, .s-b2 { width: 18%; height: 22%; bottom: -2%; border-radius: 50%; background: #5E402D; }
.s-b1 { left: 24%; }
.s-b2 { right: 24%; }

/* Pin flotante de estado sobre la mesa */
.nodo-pin {
  position: absolute;
  top: -7px;
  right: -5px;
  padding: 1.5px 4px;
  font-family: var(--f-mono, 'IBM Plex Mono', monospace);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 4;
}
.pin-alerta { background: var(--alerta, #A3482B); color: #FAF5EC; }
.pin-app { background: #242D1E; color: #FAF5EC; border: 1px solid #ECE0D4; }
.pin-horno { background: #FAF5EC; color: var(--alerta, #A3482B); border: 1px solid var(--alerta, #A3482B); }
.pin-dest { background: var(--oliva-oscuro, #39482F); color: #FAF5EC; }
.pin-actual { background: var(--cuero-oscuro, #462F20); color: #FAF5EC; border: 1px solid #D6BFA8; }

/* Capa de animación del "viaje" de una cuenta de una mesa a otra */
.plano-viaje-capa {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: visible;
}
.viaje-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.viaje-ruta {
  fill: none;
  stroke: var(--cuero, #5E402D);
  stroke-width: 3;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
  opacity: 0.85;
  animation: trazoViaje 0.65s ease-out forwards;
}
.viaje-onda {
  fill: none;
  stroke: var(--oliva-oscuro, #39482F);
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: ondaDestino 0.65s ease-out 0.45s forwards;
  opacity: 0;
}
@keyframes trazoViaje {
  0% { stroke-dashoffset: 80; opacity: 0.3; }
  100% { stroke-dashoffset: 0; opacity: 0.9; }
}
@keyframes ondaDestino {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.4); }
}
.cuenta-viajera {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--cuero, #5E402D);
  color: #FAF5EC;
  border: 1.5px dashed #D6BFA8;
  padding: 5px 10px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(36, 45, 30, 0.38);
}
.cuenta-viajera strong {
  display: block;
  font-family: var(--f-disp, 'Barlow Condensed', sans-serif);
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.05em;
}
.cuenta-viajera span {
  display: block;
  font-family: var(--f-mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px;
  color: #E0CEBD;
}

@media (min-width: 820px) {
  .plano-modo-panel .plano-alas {
    grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
    align-items: stretch;
  }
  .plano-modo-panel .plano-ala-pa {
    max-width: none;
    margin: 0;
    aspect-ratio: auto;
    min-height: 100%;
  }
}

@media (max-width: 440px) {
  .nodo-tot { display: none; }
  .nodo-pin { font-size: 7px; padding: 1px 3px; top: -5px; right: -3px; }
  .mesa-nodo.forma-redonda { width: 12.2%; height: 12.2%; }
  .mesa-nodo.forma-cuadrada { width: 12.4%; height: 12.4%; }
  .mesa-nodo.forma-barra { width: 12.6%; height: 10.6%; }
}
