/* =============================================
   GASTROFLOW v0.4.0 — Fixes CSS
   Nav · Salón scroll · Pedidos layout · Entrega
   ============================================= */

/* ── SIDEBAR: toggle visible en colapsado ── */
.gf-sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}
/* El botón chevron siempre visible */
.gf-sidebar.collapsed .sidebar-toggle {
  margin-left: auto;
  margin-right: auto;
}
.gf-sidebar.collapsed .sidebar-footer > div {
  justify-content: center;
}

/* ── OVERLAY: solo bloquea contenido, no el topbar ── */
.sidebar-overlay {
  z-index: 110; /* por debajo del topbar en mobile */
}
/* Topbar sobre el overlay en mobile */
@media (max-width: 768px) {
  .gf-topbar { z-index: 130; }
  .gf-sidebar { z-index: 200; }
}

/* ── SALÓN: contenedor multi-sector con scroll Y ── */
.floor-all-sectors {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  /* Scroll suave tipo app */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.floor-sector-section {
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.floor-sector-section:last-child { border-bottom: none; }

.floor-sector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}
.floor-sector-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--tx-4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.floor-sector-stats {
  font-size: 11px;
  color: var(--tx-4);
  display: flex;
  gap: 10px;
  align-items: center;
}
.floor-sector-stats span { display: flex; align-items: center; gap: 4px; }

.floor-sector-section .floor-canvas {
  position: relative;
  width: 100%;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  padding: 32px 24px;
}

/* ── SALÓN: wrapper ajustado ── */
.salon-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - var(--topbar-h) - 48px);
  min-height: 0;
}
@media (max-width: 768px) {
  .salon-wrapper {
    height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h, 64px) - 24px);
  }
}

/* ── PEDIDOS: mesa header arriba del todo ── */
.pedidos-v4 {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - var(--topbar-h) - 48px);
  min-height: 0;
}
@media (max-width: 768px) {
  .pedidos-v4 {
    height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h, 64px) - 24px);
  }
}

/* Mesa sticky header */
.pedidos-mesa-header {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.pedidos-mesa-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--tx-1);
}
.pedidos-mesa-meta { font-size: 12px; color: var(--tx-4); margin-top: 1px; }

/* Cart badge */
.cart-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-lg);
  background: var(--brand-dim);
  border: 1px solid var(--brand);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.cart-badge-btn:hover { background: var(--brand); color: white; }
.cart-badge-btn svg { width: 16px; height: 16px; }

/* Products area */
.pedidos-productos-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

/* Desktop: side by side */
@media (min-width: 769px) {
  .pedidos-v4 {
    display: grid;
    grid-template-columns: 1fr 360px;
    grid-template-rows: 1fr;
    gap: 16px;
    height: calc(100vh - var(--topbar-h) - 48px);
  }
  .pedidos-mesa-header { display: none; } /* en desktop el header queda en el panel derecho */
  .pedidos-productos-area { gap: 12px; }
}

/* ── CARRITO SLIDE-UP (mobile) ── */
.cart-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
}
.cart-sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cart-sheet {
  width: 100%;
  max-height: 80dvh;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--t-normal);
  overflow: hidden;
}
.cart-sheet-overlay.open .cart-sheet {
  transform: translateY(0);
}
.cart-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.cart-sheet-header {
  padding: 12px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.cart-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-sheet-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ── ENTREGA: badge listo pulsante ── */
.entrega-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--s-listo-bg);
  border: 1px solid var(--s-listo-b);
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 600;
  color: var(--s-listo);
  animation: alertPulse 2s ease-in-out infinite;
}
@keyframes alertPulse {
  0%, 100% { border-color: var(--s-listo-b); }
  50%       { border-color: var(--s-listo); box-shadow: 0 0 12px rgba(168,85,247,0.2); }
}
.entrega-alert svg { width: 18px; height: 18px; flex-shrink: 0; }
