/* ═══════════════════════════════════════════════════════════════
   COMANDAS.CSS — Kitchen Order Display
   ═══════════════════════════════════════════════════════════════ */

/* ── Section layout ─────────────────────────────────────── */
#section-comandas .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Empty state ─────────────────────────────────────────── */
.comandas-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.comandas-empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
}
.comandas-empty p {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.comandas-empty small {
  font-size: 0.85rem;
}

/* ── Cards grid ──────────────────────────────────────────── */
.comandas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 4px 0 24px;
}

/* ── Individual card ─────────────────────────────────────── */
.comanda-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, border-color 0.18s;
  display: flex;
  flex-direction: column;
}
.comanda-card:hover {
  box-shadow: var(--shadow);
}
.comanda-card.estado-pendiente  { border-color: #f59e0b; }
.comanda-card.estado-preparando { border-color: #ef4444; }
.comanda-card.estado-mitad      { border-color: #8b5cf6; }
.comanda-card.estado-listo      { border-color: #10b981; opacity: 0.75; }

/* ── Card header ─────────────────────────────────────────── */
.comanda-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.comanda-head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.comanda-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.comanda-mesa-tag {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.comanda-cliente-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.comanda-time-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Estado badge ─────────────────────────────────────────── */
.comanda-estado-badge {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.badge-pendiente  { background: #fef3c7; color: #92400e; }
.badge-preparando { background: #fee2e2; color: #991b1b; }
.badge-mitad      { background: #ede9fe; color: #4c1d95; }
.badge-listo      { background: #d1fae5; color: #065f46; }

/* ── Products list ───────────────────────────────────────── */
.comanda-products {
  padding: 12px 14px 8px;
  flex: 1;
}
.comanda-prod-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border-light);
}
.comanda-prod-row:last-child { border-bottom: none; }
.comanda-prod-qty {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 28px;
}
.comanda-prod-name {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

/* ── Description block ───────────────────────────────────── */
.comanda-desc-block {
  margin: 0 14px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-left: 3px solid var(--primary);
}
.comanda-desc-icon {
  flex-shrink: 0;
}

/* ── Action buttons ──────────────────────────────────────── */
.comanda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border-light);
}
.cbtn {
  flex: 1;
  min-width: 100px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.cbtn:hover  { opacity: 0.88; transform: translateY(-1px); }
.cbtn:active { transform: scale(0.97); }

.cbtn-preparando { background: #fee2e2; color: #991b1b; }
.cbtn-mitad      { background: #ede9fe; color: #4c1d95; }
.cbtn-listo      { background: #d1fae5; color: #065f46; }
.cbtn-precuenta  { background: #e0f2fe; color: #0369a1; }

/* Botón eliminar comanda */
.cbtn-delete {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 2px 4px;
  border-radius: 6px; opacity: 0.45;
  transition: opacity 0.15s, background 0.15s;
  margin-left: 4px;
}
.cbtn-delete:hover { opacity: 1; background: rgba(239,68,68,0.12); }

/* ── Nav badge (pending count) ───────────────────────────── */
.nav-item .comanda-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Comanda pre-send modal ── */
.comanda-pre-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border-light);
}
.comanda-pre-item:last-child { border-bottom: none; }
.comanda-pre-qty  { font-weight: 800; color: var(--primary); min-width: 28px; }
.comanda-pre-name { font-size: 0.95rem; }

.comanda-modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.comanda-info-chip {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.comanda-info-chip label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.comanda-info-chip span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.comanda-items-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.comanda-modal-items-list {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  max-height: 180px;
  overflow-y: auto;
}

/* ── POS Comanda button ───────────────────────────────────── */
.btn-comanda {
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-comanda:hover { background: #fde68a; }

/* ── Dark mode ───────────────────────────────────────────── */
body.dark-mode .comanda-card     { background: var(--surface); }
body.dark-mode .comanda-card-head{ background: var(--bg); }
body.dark-mode .badge-pendiente  { background: #451a03; color: #fcd34d; }
body.dark-mode .badge-preparando { background: #450a0a; color: #fca5a5; }
body.dark-mode .badge-mitad      { background: #2e1065; color: #c4b5fd; }
body.dark-mode .badge-listo      { background: #022c22; color: #6ee7b7; }
body.dark-mode .cbtn-preparando  { background: #450a0a; color: #fca5a5; }
body.dark-mode .cbtn-mitad       { background: #2e1065; color: #c4b5fd; }
body.dark-mode .cbtn-listo       { background: #022c22; color: #6ee7b7; }
body.dark-mode .cbtn-precuenta   { background: #0c2a44; color: #7dd3fc; }
body.dark-mode .btn-comanda      { background: #451a03; color: #fcd34d; border-color: #92400e; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .comandas-grid { grid-template-columns: 1fr; }
  .comanda-card-head { flex-direction: column; gap: 6px; }
  .comanda-head-right { align-items: flex-start; flex-direction: row; gap: 8px; }
}

/* ── Area tabs (Todas / Cocina / Bar) ────────────────────── */
.comanda-area-tabs {
  display: flex; gap: 4px; align-items: center;
}
.comanda-tab-btn {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.comanda-tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.comanda-tab-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
